Last active
August 24, 2017 17:17
-
-
Save larytet/5c361b1a4ee967655f500909026978f9 to your computer and use it in GitHub Desktop.
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% | |
global ARRAY_TIMESTAMP% | |
function current_time:long() | |
%{ /* pure */ | |
STAP_RETURN(0); | |
%} | |
probe syscall.open | |
{ | |
tid = tid() | |
ARRAY_FILENAME[tid] = filename | |
ARRAY_TIMESTAMP[tid] = current_time() | |
} | |
probe syscall.open.return | |
{ | |
tid = tid(); | |
delete ARRAY_FILENAME[tid] | |
delete ARRAY_TIMESTAMP[tid] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment