diff options
author | hunt <hunt> | 2005-09-04 09:40:46 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-09-04 09:40:46 +0000 |
commit | 6c100036afcfa4d038f7a7af83bcbcb28f905d35 (patch) | |
tree | c5ca93e96ad425446c1e1be02f0ecf21509a8a6e /tapset | |
parent | e479d1f47a8d83737418674bb03f780220bc4ff4 (diff) | |
download | systemtap-steved-6c100036afcfa4d038f7a7af83bcbcb28f905d35.tar.gz systemtap-steved-6c100036afcfa4d038f7a7af83bcbcb28f905d35.tar.xz systemtap-steved-6c100036afcfa4d038f7a7af83bcbcb28f905d35.zip |
2005-09-04 Martin Hunt <hunt@redhat.com>
* testsuite/buildok/context_test.stp: New test.
* tapset/logging.stp (log): Call _stp_printf().
* stapfuncs.5.in: Add contextinfo funcs.
* tapset/context.stp: Minor cleanup.
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/context.stp | 5 | ||||
-rw-r--r-- | tapset/logging.stp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tapset/context.stp b/tapset/context.stp index 6d600190..4d801956 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -12,7 +12,8 @@ function print_backtrace () %{ function backtrace:string () %{ if (CONTEXT->regs) { - /* XXX: is String really necessary for this? */ + /* XXX: this won't be necessary when runtime and translator */ + /* agree on what a string is. */ String str = _stp_string_init (0); _stp_stack_sprint (str, CONTEXT->regs, 0); strlcpy (THIS->__retvalue, _stp_string_ptr(str), MAXSTRINGLEN); @@ -80,8 +81,6 @@ function euid:long () %{ function print_stack(stk:string) %{ char *ptr = THIS->stk; char *tok = strsep(&ptr, " "); - /* XXX: is this header really necessary & accurate? */ - _stp_printf ("trace for %d (%s)\n", current->pid, current->comm); while (tok && *tok) { _stp_print_cstr(" "); _stp_symbol_print (simple_strtol(tok, NULL, 16)); diff --git a/tapset/logging.stp b/tapset/logging.stp index eff7b555..e276aa3f 100644 --- a/tapset/logging.stp +++ b/tapset/logging.stp @@ -4,10 +4,10 @@ function print (msg:string) %{ _stp_print (THIS->msg); %} -// almost the same as print -function log (msg) { - print (msg . "\n") -} +// like print but with a newline +function log (msg:string) %{ + _stp_printf ("%s\n", THIS->msg); +%} function printk (msg:string) %{ printk (KERN_INFO "%s\n", THIS->msg); |