diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-21 12:31:14 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-21 12:31:14 +0100 |
commit | 75dfa5cb9b3584995f9e634a6e769b8a1576bc0d (patch) | |
tree | f532cc39d3199dace4bff95b7844f73ec763d0f1 /testsuite/systemtap.examples | |
parent | 32902edf1f17bb62144f21ed38ae085bd2755e9f (diff) | |
download | systemtap-steved-75dfa5cb9b3584995f9e634a6e769b8a1576bc0d.tar.gz systemtap-steved-75dfa5cb9b3584995f9e634a6e769b8a1576bc0d.tar.xz systemtap-steved-75dfa5cb9b3584995f9e634a6e769b8a1576bc0d.zip |
conditionalize pty_write count variable on kernel version
* testsuite/systemtap.examples/general/grapher.stp: Conditionalize
pty_write count variable on kernel version.
Diffstat (limited to 'testsuite/systemtap.examples')
-rwxr-xr-x | testsuite/systemtap.examples/general/grapher.stp | 23 |
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) } } |