Skip to content

Instantly share code, notes, and snippets.

@ynsta
ynsta / sampler.py
Last active June 8, 2023 15:33
Statistic profiling on stm32f4 with openocd by dwt_pcsr sampling
#!/usr/bin/python2
# run openocd (0.9.0) with :
# $ openocd -f stlink-v2-1.cfg -f stm32f4x.cfg &> /dev/null"
# then run
# $ python2 sampler.py path_to_myelf_with_symbols
import sys
import time
import telnetlib
@wenjianhn
wenjianhn / test_socket_prio_and_tos.c
Created January 29, 2015 03:30
Test if setsockopt(SO_PRIORITY) sets the IP type-of-service (TOS) field or not.
#include <assert.h>
#include <netinet/ip.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
void test_setsockopt()
{
int priority = 6;