Created
September 1, 2016 11:08
-
-
Save vincentbernat/93d21986c832146911af15b49b5d34ba 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
global closed_trace% | |
global closed_timestamp% | |
global closed_tid% | |
probe syscall.close { | |
if (target() != pid()) { | |
next | |
} | |
closed_trace[$fd] = ubacktrace() | |
closed_timestamp[$fd] = gettimeofday_us() | |
closed_tid[$fd] = tid() | |
} | |
probe syscall.read.return { | |
if (target() != pid()) { | |
next | |
} | |
if ($return == -9) { | |
now = gettimeofday_us() | |
printf("%s.%06d, read(%d) == -EBADF\n", ctime(now/1000000), now%1000000, $fd) | |
printf("%s\n", print_usyms(ubacktrace())) | |
printf("Closed in %d at %s.%06d:\n", | |
closed_tid[$fd], | |
ctime(closed_timestamp[$fd]/1000000), closed_timestamp[$fd]%1000000) | |
printf("%s\n", print_usyms(closed_trace[$fd])) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment