summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/general
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-22 15:02:43 +0100
committerTim Moore <timoore@redhat.com>2009-12-23 00:08:13 +0100
commitc8985e919ed67b39f86a3070a0366a1f2d19f519 (patch)
tree7b1ea0b28e6a7f03f1ad4122d0db9e1ed30060dd /testsuite/systemtap.examples/general
parent4c18e89e50f274dd905876f725eb1cf98ad6b2df (diff)
downloadsystemtap-steved-c8985e919ed67b39f86a3070a0366a1f2d19f519.tar.gz
systemtap-steved-c8985e919ed67b39f86a3070a0366a1f2d19f519.tar.xz
systemtap-steved-c8985e919ed67b39f86a3070a0366a1f2d19f519.zip
don't assume buffer passed to pty_write is null terminated
* testsuite/systemtap.examples/general/grapher.stp: Use kernel_char instead of kernel_string to dig characters out of buffer.
Diffstat (limited to 'testsuite/systemtap.examples/general')
-rwxr-xr-xtestsuite/systemtap.examples/general/grapher.stp10
1 files changed, 3 insertions, 7 deletions
diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp
index 46f5063c..a830b153 100755
--- a/testsuite/systemtap.examples/general/grapher.stp
+++ b/testsuite/systemtap.examples/general/grapher.stp
@@ -38,17 +38,13 @@ probe kernel.function("pty_write") {
count = %(kernel_v>="2.6.31" %? $c %: $count %)
if (count > 0) {
printf("pty %d ", gettimeofday_ms())
- str = kernel_string($buf)
+ str = $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))
+ c = kernel_char(str + i)
+ printf("%c", c)
}
printf("%c", 0)
}
}
-
-
-