#!/usr/sbin/dtrace -s /* usage is: trace2processes.d */ # pragma D option quiet BEGIN { inXlib=0; doingXlib=0; } pid$2::$3:entry { inXlib=1; printf("%s: %s: enters\n",execname, probefunc); } pid$2::$3:return { doingXlib=1; printf("%s: %s: returns\n",execname, probefunc); } pid$2::XFlush:return, pid$2::XSync:return /doingXlib/ { inXlib=0; doingXlib=1; } pid$1:a.out::entry /inXlib/ { printf("%s: %s: entering\n",execname,probefunc); } pid$1:a.out::return /inXlib/ { printf("%s: %s: return = %d\n",execname, probefunc, arg1); }