Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates > by-pkgid > fe7c341633b7d979ab8178b22304d6b5 > files > 146

systemtap-1.3-1.1.mga1.i586.rpm

#! /usr/bin/env stap
#
# This is a stap script to monitor process creations (fork(), exec()'s).
# Based on stap script found: http://picobot.org/wordpress/?p=27
# With some minor modifications (i.e. timestamping)
# 
# Usage: stap forktracker.stp
#
# Sample output:
#
# timestamp: process_name (pid) new_pid
#
# Version 0.1

probe kprocess.create {
  printf("%-25s: %s (%d) created %d\n",
         ctime(gettimeofday_s()), execname(), pid(), new_pid)
}

probe kprocess.exec {
  printf("%-25s: %s (%d) is exec'ing %s\n",
         ctime(gettimeofday_s()), execname(), pid(), filename)
}