1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
global serial
global startTime
global finalTime
function callFunction(probefunc, tid) {
if (startTime == 0) {
startTime = gettimeofday_ns()
printf("<%s,,%d,,%d,,%d\n", probefunc, serial, startTime, tid)
} else
printf("<%s,,%d,,%d,,%d\n", probefunc, serial, gettimeofday_ns(), tid)
serial++
}
function returnFunction(probefunc, tid) {
finalTime = gettimeofday_ns()
printf(">%s,,%d,,%d\n", probefunc, finalTime, tid)
}
probe end {
printf("-%d\n",finalTime);
printf("+%d\n",finalTime - startTime);
exit()
}
probe process(@1).end {
finalTime = gettimeofday_ns()
}
|