Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 2b12d0199a2bbc4a02ef3834d926ac4a > files > 220

systemtap-client-1.8-6.el5.x86_64.rpm

#!/usr/bin/stap
# Copyright (C) 2012 Red Hat, Inc.
# by William Cohen <wcohen@redhat.com>
#
# pstrace_exec prints out the chain of processes from the current process
# back to the init process whenever an exec matches the argument.
#
# Run the script with:
#   stap pstrace_exec.stp "command_to_match"
#
# control-c to exit data collection

probe kprocess.exec
{
  if (isinstr(filename, @1)) {
    printf("process traceback:\n %s\n", pstrace(task_current()))
  }
}