Skip to content

Instantly share code, notes, and snippets.

View simark's full-sized avatar

Simon Marchi simark

  • Montréal, Canada
View GitHub Profile
@simark
simark / setup-for-benchmarks
Created April 13, 2022 14:43
Scripts to configure / unconfigure system for benchmarks
#!/usr/bin/env bash
echo "Disabling CPU boost"O
echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost
for i in $(seq 16 31); do
echo "Disabling CPU core ${i}"
echo 0 | sudo tee /sys/devices/system/cpu/cpu${i}/online
done
@simark
simark / PKGBUILD
Created December 23, 2020 04:36
PKGBUILD for esp-idf 4.2
# Maintainer: Artyom Melnikov <a@arti-nt.ru>
pkgname=esp-idf
pkgver=4.2
pkgrel=1
pkgdesc="Espressif IoT Development Framework. Official development framework for ESP32."
arch=('i686' 'x86_64' 'aarch' 'aarch64' 'armv7h')
url="https://github.com/espressif/esp-idf"
license=('APACHE')
depends=('python' 'python-click' 'python-pyserial' 'python-future' 'python-cryptography' 'python-pyparsing' 'python-pyelftools')
makedepends=('git')
.extern bar
.text
.globl foo
.type foo, @function
foo:
.cfi_startproc
xor %rsp, (%rsp)
// exp RA len const -8 plus dup deref xor
.cfi_escape 0x16, 0x10, 0x06, 0x09, 0xf8, 0x22, 0x12, 0x06, 0x27
@simark
simark / Makefile
Last active May 29, 2016 01:38
Segfault when dlopening/dlclosing two instrumented .so.
all: main liblol.so libmdr.so
main: main.c
gcc -o main main.c -ldl -g3 -O0
liblol.so: lol.o tracepoints_lol.o
gcc -shared -o liblol.so lol.o tracepoints_lol.o -llttng-ust
lol.o: lol.c tracepoints_lol.h
gcc -fpic -c lol.c -g3 -O0
@simark
simark / return.c
Created May 26, 2016 13:08
gdb.base/return.exp reproduction
double
func3 ()
{
return -5.0;
}
double tmp3;
int main ()
{
@simark
simark / toutv-v2.py
Last active March 9, 2016 06:27 — forked from eepp/toutv-v2.py
import requests
import mechanicalsoup as ms
import sys
import logging
import urllib
import json
import subprocess
# Uncomment this to make the requests print some debug info.
#
@simark
simark / 1. steps
Last active February 2, 2016 18:06
OLA cross compile
# Terminology
Throughout this document, "host" refers to the build machine and "target"
refers to the machine where OLA will run. Note that this does not match
Autoconf's terminology, where "host" means the machine where things will run.
During the process, we will need to build some things that will run on the host
machine, and others that will run on the target machine. We will therefore
work with two separate terminals, one set up to build things for each. I'll
refer to those as "host terminal" and "target terminal".
all: libtruc.so app
app: app.o
gcc -o app app.o -ldl -llttng-ust
app.o: app.c
gcc -c app.c -g3 -O0 -Wall
libtruc.so: truc.o tracepoints.o
gcc -shared -o libtruc.so truc.o tracepoints.o -llttng-ust
@simark
simark / gist:ef475431a804cad220f2
Created November 17, 2014 06:06
stacktraces of threads in python
def stacktraces():
code = []
for threadId, stack in sys._current_frames().items():
code.append("\n# ThreadID: %s" % threadId)
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' %
(filename, lineno, name))
if line:
code.append(" %s" % (line.strip()))