- http://dynamorio.org/
- http://www.drmemory.org/ is a 3x-5x times faster alternative for valgrind memcheck
- http://ics11.cs.arizona.edu/workshops/whist-2011/papers/whist-2011-rountree.pdf
- https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux | |
chmod +x extract-vmlinux | |
sudo ./extract-vmlinux /boot/vmlinuz-`uname -r` > vmlinux | |
crash vmlinux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use MAXMAPENTRIES to set the maximum size of the array | |
// for example sudo stap -D MAXMAPENTRIES=40000 ./src/driver/load_measurement.stp | |
global probe_frequency% | |
global processes% | |
probe begin | |
{ | |
printf("Ctrl-C to print the results\n"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void *rvmalloc(unsigned long size) | |
{ | |
void *mem; | |
unsigned long adr; | |
size = PAGE_ALIGN(size); | |
mem = vzalloc(size); //syscalls_trace_buffer;//vmalloc(size); | |
# if (SHM_RESERVE_PAGES > 0) | |
if (mem) { | |
// memset(mem, 0, size); vzalloc() will zero the memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stddef.h> | |
// Based on https://stackoverflow.com/questions/1872220/is-it-possible-to-iterate-over-arguments-in-variadic-macros | |
struct a | |
{ | |
int a; | |
int b; | |
int c; | |
}; |
- Parse Packages.gz https://stackoverflow.com/questions/16568621/how-to-query-and-manage-debian-package-repositories-in-python
- Parse repodata/repomd.xml https://nessy.info/?p=567
- Example of Packages.gz http://ddebs.ubuntu.com/dists/yakkety-proposed/main/binary-amd64/Packages
- Example of Yum metadata http://debuginfo.centos.org/6/x86_64/repodata/
- http://rpm-software-management.github.io/librepo/index.html - handle Yum metadata
- https://github.com/xolox/python-deb-pkg-tools , https://pypi.python.org/pypi/deb-pkg-tools
- How to create a deb repo https://askubuntu.com/questions/26534/apt-get-doesnt-see-packages-in-my-trivial-repository , http://www.handheldshell.com/software/python_bdist_debian.html , https://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline
- Debian repo format https://wiki.debian.org/DebianRepository/Format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# See also http://www.averk.net/passgen.html | |
# https://www.passwordcard.org/en | |
''' | |
The script will output something like | |
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | |
1 W j ~ E ^ y x ! N q S ! r e e g a q f P c Q : q & Q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://godbolt.org/g/56Lv4f - 62 opcodes | |
int strcmp_original(char *a, char *b) | |
{ | |
int c = strlen(a) > strlen(b) ? strlen(a) : strlen(b); | |
char * d; | |
for (d = a;d < a + c;++d, ++b) | |
{ | |
if (*d != *b) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shorter version of the same, failed after 400 driver restarts | |
/* | |
Load and run: | |
scl enable devtoolset-4 bash | |
stap -g -p4 -m test_open -v -k test_open.stp | |
count=0;while [ 1 ];do echo $count;count=$(($count+1));sudo rmmod test_open;sudo staprun test_open.ko -L ;done; | |
*/ | |
global ARRAY_FILENAME% |