aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/profiling
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-04-29 10:41:38 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-04-29 10:41:38 -0700
commit735987bea0e48cfe579b48a969d71298ae973c31 (patch)
tree494d376d79c9c9bdaf126a24d9b8d733fa3fb060 /test/core/profiling
parentc3edfc4b2b58b073fd9b981b1ab802a93bdc1877 (diff)
Added documentation to stap script.
Diffstat (limited to 'test/core/profiling')
-rw-r--r--test/core/profiling/mark_timings.stp14
1 files changed, 10 insertions, 4 deletions
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]));
}
}