From 735987bea0e48cfe579b48a969d71298ae973c31 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 29 Apr 2015 10:41:38 -0700 Subject: Added documentation to stap script. --- test/core/profiling/mark_timings.stp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test/core/profiling') diff --git a/test/core/profiling/mark_timings.stp b/test/core/profiling/mark_timings.stp index a7ccc83c61..45d5e0d217 100644 --- a/test/core/profiling/mark_timings.stp +++ b/test/core/profiling/mark_timings.stp @@ -1,10 +1,15 @@ -global starts, times, times_per_tag +/* This script requires a command line argument, to be used in the "process" + * probe definition. + * + * For a statically build binary, that'd be the name of the binary itself. + * For dinamically built ones, point to the location of the libgprc.so being + * used. */ -probe process.mark("timing_ns_begin") { +probe process(@1).mark("timing_ns_begin") { starts[$arg1, tid()] = gettimeofday_ns(); } -probe process.mark("timing_ns_end") { +probe process(@1).mark("timing_ns_end") { tag = $arg1 t = gettimeofday_ns(); if (s = starts[tag, tid()]) { @@ -27,6 +32,7 @@ probe end { } printf("%15s %10s %10s\n", "tag", "count", "avg(ns)"); foreach ([tag+] in times_per_tag) { - printf("%15X %10d %10d\n", tag, @count(times_per_tag[tag]), @avg(times_per_tag[tag])); + printf("%15X %10d %10d\n", tag, @count(times_per_tag[tag]), + @avg(times_per_tag[tag])); } } -- cgit v1.2.3