summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/general
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples/general')
-rwxr-xr-xtestsuite/systemtap.examples/general/grapher.stp23
1 files changed, 12 insertions, 11 deletions
diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp
index baeeff5c..46f5063c 100755
--- a/testsuite/systemtap.examples/general/grapher.stp
+++ b/testsuite/systemtap.examples/general/grapher.stp
@@ -35,17 +35,18 @@ probe kernel.function("kbd_event") {
}
probe kernel.function("pty_write") {
- if ($count > 0) {
- printf("pty %d ", gettimeofday_ms())
- str = kernel_string($buf)
- for (i = 0; i < $count; ++i) {
- if (i > 1)
- printf("\n")
- # yes it's gross
- c = substr(str, i, 1)
- printf("%s", text_str(c))
- }
- printf("%c", 0)
+ count = %(kernel_v>="2.6.31" %? $c %: $count %)
+ if (count > 0) {
+ printf("pty %d ", gettimeofday_ms())
+ str = kernel_string($buf)
+ for (i = 0; i < count; ++i) {
+ if (i > 1)
+ printf("\n")
+ # yes it's gross
+ c = substr(str, i, 1)
+ printf("%s", text_str(c))
+ }
+ printf("%c", 0)
}
}