diff options
author | hunt <hunt> | 2005-11-18 21:57:30 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-11-18 21:57:30 +0000 |
commit | b1f3e72e9fb1f41b0dbb5be20506e375fcf89561 (patch) | |
tree | d6ddcc2b52307f5b0c8e8a143311b17aa114a82f | |
parent | d02548c0925a02dd0af64a9dc13cce9e84d87b4f (diff) | |
download | systemtap-steved-b1f3e72e9fb1f41b0dbb5be20506e375fcf89561.tar.gz systemtap-steved-b1f3e72e9fb1f41b0dbb5be20506e375fcf89561.tar.xz systemtap-steved-b1f3e72e9fb1f41b0dbb5be20506e375fcf89561.zip |
2005-11-18 Martin Hunt <hunt@redhat.com>
PR 1837
* testsuite/buildko/one.stp: Replace printk.
* testsuite/buildok/one.stp: Ditto.
* testsuite/buildok/two.stp: Ditto.
* testsuite/semko/fifteen.stp: Ditto.
* testsuite/semko/fourteen.stp: Ditto.
* testsuite/semko/thirteen.stp: Ditto.
* testsuite/transok/eight.stp: Ditto.
* testsuite/transok/seven.stp: Ditto.
* testsuite/transok/six.stp: Ditto.
* tapsets.cxx (*::emit_probe_entries): Replace printk() calls
with _stp_warn().
* stap.1.in: Replace printk with printf in example.
* stapfuncs.5.in: Remove docs for printk and add for
print and printf.
* tapset/logging.stp (printk): Deleted.
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | stap.1.in | 2 | ||||
-rw-r--r-- | stapfuncs.5.in | 15 | ||||
-rw-r--r-- | tapset/logging.stp | 4 | ||||
-rw-r--r-- | tapsets.cxx | 10 | ||||
-rwxr-xr-x | testsuite/buildko/one.stp | 2 | ||||
-rwxr-xr-x | testsuite/buildok/one.stp | 2 | ||||
-rwxr-xr-x | testsuite/buildok/two.stp | 2 | ||||
-rwxr-xr-x | testsuite/semko/fifteen.stp | 2 | ||||
-rwxr-xr-x | testsuite/semko/fourteen.stp | 2 | ||||
-rwxr-xr-x | testsuite/semko/thirteen.stp | 2 | ||||
-rwxr-xr-x | testsuite/transok/eight.stp | 4 | ||||
-rwxr-xr-x | testsuite/transok/seven.stp | 2 | ||||
-rwxr-xr-x | testsuite/transok/six.stp | 2 |
14 files changed, 47 insertions, 27 deletions
@@ -1,3 +1,26 @@ +2005-11-18 Martin Hunt <hunt@redhat.com> + + PR 1837 + * testsuite/buildko/one.stp: Replace printk. + * testsuite/buildok/one.stp: Ditto. + * testsuite/buildok/two.stp: Ditto. + * testsuite/semko/fifteen.stp: Ditto. + * testsuite/semko/fourteen.stp: Ditto. + * testsuite/semko/thirteen.stp: Ditto. + * testsuite/transok/eight.stp: Ditto. + * testsuite/transok/seven.stp: Ditto. + * testsuite/transok/six.stp: Ditto. + + * tapsets.cxx (*::emit_probe_entries): Replace printk() calls + with _stp_warn(). + + * stap.1.in: Replace printk with printf in example. + + * stapfuncs.5.in: Remove docs for printk and add for + print and printf. + + * tapset/logging.stp (printk): Deleted. + 2005-11-13 Graydon Hoare <graydon@redhat.com> * staptree.h (struct indexable): New struct. @@ -366,7 +366,7 @@ with the given assignment as a prologue. Another probe definition may use the alias like this: .SAMPLE probe syscall.read { - printk ("reading fd=" . string (fildes)) + printf("reading fd=%d\n", fildes) } .ESAMPLE diff --git a/stapfuncs.5.in b/stapfuncs.5.in index 72d048eb..806a0906 100644 --- a/stapfuncs.5.in +++ b/stapfuncs.5.in @@ -26,18 +26,19 @@ and take no parameters. .SS LOGGING .TP -printk:unknown (msg:string) -Log the given string to the kernel's printk buffer, at KERN_INFO severity. -Append an implicit end-of-line. +log:unknown (msg:string) +Log the given string to the common trace buffer. Append an implicit +end-of-line. .TP print:unknown (msg:string) -Print the given string to the common trace buffer. +print:unknown (k:long) +Print the given integer or string to the common trace buffer. .TP -log:unknown (msg:string) -Log the given string to the common trace buffer. Append an implicit -end-of-line. +printf:unknown (fmt:string, ...) +Like the C printf, except valid types are limited to string ("%s") +and integer ("%d"). .TP warn:unknown (msg:string) diff --git a/tapset/logging.stp b/tapset/logging.stp index 37cfc771..d0222a86 100644 --- a/tapset/logging.stp +++ b/tapset/logging.stp @@ -15,10 +15,6 @@ function log (msg:string) %{ _stp_printf ("%s\n", THIS->msg); %} -function printk (msg:string) %{ - printk (KERN_INFO "%s\n", THIS->msg); -%} - function warn (msg:string) %{ _stp_warn ("%s", THIS->msg); %} diff --git a/tapsets.cxx b/tapsets.cxx index d9a75340..99c4c38a 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -158,7 +158,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j) else o->line() << "STAP_SESSION_STOPPING)"; o->newline(1) << "return;"; o->newline(-1) << "if (atomic_inc_return (&c->busy) != 1) {"; - o->newline(1) << "printk (KERN_ERR \"probe reentrancy (%s vs %s)\\n\", " + o->newline(1) << "_stp_warn (\"probe reentrancy (%s vs %s)\\n\", " << "c->probe_point, probe_point);"; o->newline() << "atomic_set (& session_state, STAP_SESSION_ERROR);"; o->newline() << "atomic_dec (&c->busy);"; @@ -2729,8 +2729,8 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, o->newline() << "int stap_kprobe_fault_handler (struct kprobe* kp, " << "struct pt_regs* regs, int trapnr) {"; o->newline(1) << "struct context *c = & contexts [smp_processor_id()];"; - o->newline() << "printk (KERN_ERR \"systemtap probe fault\\n\");"; - o->newline() << "printk (KERN_ERR \"cpu %d, probe %s, near %s\\n\", "; + o->newline() << "_stp_warn (\"systemtap probe fault\\n\");"; + o->newline() << "_stp_warn (\"cpu %d, probe %s, near %s\\n\", "; o->newline(1) << "smp_processor_id(), "; o->newline() << "c->probe_point ? c->probe_point : \"unknown\", "; o->newline() << "c->last_stmt ? c->last_stmt : \"unknown\");"; @@ -2842,7 +2842,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, o->newline() << "if (atomic_read (&session_state) != STAP_SESSION_RUNNING)"; o->newline(1) << "return 0;"; o->newline(-1) << "if (atomic_inc_return (&c->busy) != 1) {"; - o->newline(1) << "printk (KERN_ERR \"probe reentrancy (%s vs %s)\\n\", " + o->newline(1) << "_stp_warn (\"probe reentrancy (%s vs %s)\\n\", " << "c->probe_point, probe_point);"; o->newline() << "atomic_set (& session_state, STAP_SESSION_ERROR);"; o->newline() << "atomic_dec (&c->busy);"; @@ -2994,7 +2994,7 @@ timer_derived_probe::emit_probe_entries (translator_output* o, unsigned j) o->newline(1) << "return;"; o->newline(-1) << "if (atomic_inc_return (&c->busy) != 1) {"; - o->newline(1) << "printk (KERN_ERR \"probe reentrancy (%s vs %s)\\n\", " + o->newline(1) << "_stp_warn (\"probe reentrancy (%s vs %s)\\n\", " << "c->probe_point, probe_point);"; o->newline() << "atomic_set (& session_state, STAP_SESSION_ERROR);"; o->newline() << "atomic_dec (&c->busy);"; diff --git a/testsuite/buildko/one.stp b/testsuite/buildko/one.stp index 1b4da936..f0d22f25 100755 --- a/testsuite/buildko/one.stp +++ b/testsuite/buildko/one.stp @@ -13,7 +13,7 @@ THIS->__retvalue = 5; probe begin { - printk("hello from systemtap, kernel version " . get_release()) + log("hello from systemtap, kernel version " . get_release()) } END diff --git a/testsuite/buildok/one.stp b/testsuite/buildok/one.stp index 491d059e..76cdcca8 100755 --- a/testsuite/buildok/one.stp +++ b/testsuite/buildok/one.stp @@ -19,7 +19,7 @@ probe begin baz[10] = "" q = baz[223] - printk("hello from systemtap") + print("hello from systemtap\n") } diff --git a/testsuite/buildok/two.stp b/testsuite/buildok/two.stp index 7453cae1..e10a036d 100755 --- a/testsuite/buildok/two.stp +++ b/testsuite/buildok/two.stp @@ -12,7 +12,7 @@ strncpy(THIS->__retvalue, UTS_RELEASE, MAXSTRINGLEN); probe begin { - printk("hello from systemtap, kernel version " . get_release()) + log("hello from systemtap, kernel version " . get_release()) } END diff --git a/testsuite/semko/fifteen.stp b/testsuite/semko/fifteen.stp index 612271db..136d4b2e 100755 --- a/testsuite/semko/fifteen.stp +++ b/testsuite/semko/fifteen.stp @@ -8,7 +8,7 @@ probe begin { state = tangle[state]++ } - printk("hello from systemtap") + log("hello from systemtap") } diff --git a/testsuite/semko/fourteen.stp b/testsuite/semko/fourteen.stp index 16bd784b..686d9343 100755 --- a/testsuite/semko/fourteen.stp +++ b/testsuite/semko/fourteen.stp @@ -14,7 +14,7 @@ probe begin { bar() } - printk("hello from systemtap") + log("hello from systemtap") } diff --git a/testsuite/semko/thirteen.stp b/testsuite/semko/thirteen.stp index 88761ded..a5d6c400 100755 --- a/testsuite/semko/thirteen.stp +++ b/testsuite/semko/thirteen.stp @@ -14,7 +14,7 @@ probe begin { bar() } - printk("hello from systemtap") + log("hello from systemtap") } diff --git a/testsuite/transok/eight.stp b/testsuite/transok/eight.stp index e703a5ae..6723b993 100755 --- a/testsuite/transok/eight.stp +++ b/testsuite/transok/eight.stp @@ -21,10 +21,10 @@ probe begin foreach ([x,y,z] in baz) { - printk(baz[x,y,z] . y) + log(baz[x,y,z] . y) } - printk("hello from systemtap") + log("hello from systemtap") } diff --git a/testsuite/transok/seven.stp b/testsuite/transok/seven.stp index 0c0e00d7..7471e9e8 100755 --- a/testsuite/transok/seven.stp +++ b/testsuite/transok/seven.stp @@ -13,7 +13,7 @@ probe begin ++foo["hello"] x = foo["hello"] foo["yo"] *= bar[x, foo["hello"], "goodbye"]++; - printk("hello from systemtap") + log("hello from systemtap") } diff --git a/testsuite/transok/six.stp b/testsuite/transok/six.stp index 8684107e..0b3bdccf 100755 --- a/testsuite/transok/six.stp +++ b/testsuite/transok/six.stp @@ -2,7 +2,7 @@ probe begin { - printk("kernel time") + print("kernel time\n") log("hello there") warn("this is a builtin") } |