Debian Codegraph @

testsuite/systemtap.examples/process/pstrace_exec.stp

raw
1 #! /usr/bin/env stap
2 # Copyright (C) 2012 Red Hat, Inc.
3 # by William Cohen <[email protected]>
4 #
5 # pstrace_exec prints out the chain of processes from the current process
6 # back to the init process whenever an exec matches the argument.
7 #
8 # Run the script with:
9 # stap pstrace_exec.stp "command_to_match"
10 #
11 # control-c to exit data collection
12
13 probe kprocess.exec
14 {
15 if (isinstr(filename, @1)) {
16 printf("process traceback:\n %s\n", pstrace(task_current()))
17 }
18 }