summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples')
-rwxr-xr-xtestsuite/systemtap.examples/general/grapher.stp18
1 files changed, 13 insertions, 5 deletions
diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp
index e8655b37..c1c60437 100755
--- a/testsuite/systemtap.examples/general/grapher.stp
+++ b/testsuite/systemtap.examples/general/grapher.stp
@@ -8,7 +8,7 @@ printf ("%%DataSet:pty 50 0000ff discreet\n");
printf ("cpu %%Title:CPU utilization\n");
printf ("cpu %%XAxisTitle:Time\n");
printf ("cpu %%YAxisTitle:Percent\n");
-
+printf ("%%LineEnd:0\n");
}
# CPU utilization
@@ -26,17 +26,25 @@ function qsq_util_reset(q) {
probe timer.ms(100) { # collect utilization percentages frequently
foreach (q in qnames)
- printf("cpu %d %d\n", gettimeofday_ms(), qsq_util_reset(q))
+ printf("cpu %d %d%c", gettimeofday_ms(), qsq_util_reset(q), 0)
}
probe kernel.function("kbd_event") {
if ($event_type == 1 && $value)
- printf("kbd %d %d\n", gettimeofday_ms(), $event_code)
+ printf("kbd %d %d\n0x%x%c", gettimeofday_ms(), $event_code, $event_code, 0)
}
probe kernel.function("pty_write") {
- if (count > 0)
- printf("pty %d %.5s\n", gettimeofday_ms(), buf)
+ if ($count > 0) {
+ printf("pty %d ", gettimeofday_ms())
+ str = kernel_string($buf)
+ for (i = 0; i < $count; ++i) {
+ # yes it's gross
+ c = substr(str, i, 1)
+ printf("%s\n", text_str(c))
+ }
+ printf("%c", 0)
+ }
}