diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-04 13:08:01 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-04 13:08:01 +0100 |
commit | 5ddc5963ce06ecea574e90ca503a3ee598522d8f (patch) | |
tree | cd6dd73b8104da1c2527180b24b38b48828b307e /testsuite/systemtap.examples/general/grapher.stp | |
parent | 388924acea820c7a1328eb2ac8a4128437853c3a (diff) | |
download | systemtap-steved-5ddc5963ce06ecea574e90ca503a3ee598522d8f.tar.gz systemtap-steved-5ddc5963ce06ecea574e90ca503a3ee598522d8f.tar.xz systemtap-steved-5ddc5963ce06ecea574e90ca503a3ee598522d8f.zip |
support multiline data output from scripts run under the grapher
This is accompanied by support for multiline output in hover text.
* grapher/StapParser.cxx (ioCallback): Read data 'til the end of line
character, not just '\n'. Be careful to use I/O functions that don't
treat '\n' specially.
* grapher/StapParser.hxx: ditto
* grapher/CairoWidget.cxx (CairoTextBox::draw): Perform line breaks
for hover text.
* testsuite/systemtap.examples/general/grapher.stp: Do multiline
output of keyboard events. Also, fix longstanding breaking in the
pty probe.
Diffstat (limited to 'testsuite/systemtap.examples/general/grapher.stp')
-rwxr-xr-x | testsuite/systemtap.examples/general/grapher.stp | 18 |
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) + } } |