summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
Diffstat (limited to 'tapset')
-rw-r--r--tapset/context-unwind.stp4
-rw-r--r--tapset/ucontext-unwind.stp22
2 files changed, 22 insertions, 4 deletions
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp
index 741031c0..8f35a783 100644
--- a/tapset/context-unwind.stp
+++ b/tapset/context-unwind.stp
@@ -28,7 +28,7 @@
*/
function print_backtrace () %{
if (CONTEXT->regs) {
- _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE, NULL);
+ _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE, NULL, NULL);
} else {
_stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point);
}
@@ -42,7 +42,7 @@ function print_backtrace () %{
*/
function backtrace:string () %{ /* pure */
if (CONTEXT->regs)
- _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE, NULL);
+ _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE, NULL, NULL);
else
strlcpy (THIS->__retvalue, "", MAXSTRINGLEN);
%}
diff --git a/tapset/ucontext-unwind.stp b/tapset/ucontext-unwind.stp
index d699e588..399ce0c5 100644
--- a/tapset/ucontext-unwind.stp
+++ b/tapset/ucontext-unwind.stp
@@ -28,7 +28,25 @@ function print_ubacktrace () %{ /* unprivileged */
assert_is_myproc();
if (CONTEXT->regs) {
_stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE,
- current);
+ current, CONTEXT->ri);
+ } else {
+ _stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point);
+ }
+%}
+
+/**
+ * sfunction print_ubacktrace_brief- Print stack back trace for current task. EXPERIMENTAL!
+ *
+ * Equivalent to print_ubacktrace(), but output for each symbol is
+ * shorter (just name and offset), and the function address is
+ * printed if it can't be mapped to a name.
+ */
+
+function print_ubacktrace_brief () %{ /* unprivileged */
+ assert_is_myproc();
+ if (CONTEXT->regs) {
+ _stp_stack_print(CONTEXT->regs, SYM_VERBOSE_BRIEF, CONTEXT->pi,
+ MAXTRACE, current, CONTEXT->ri);
} else {
_stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point);
}
@@ -47,7 +65,7 @@ function ubacktrace:string () %{ /* pure */ /* unprivileged */
if (CONTEXT->regs)
_stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN,
CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE,
- current);
+ current, CONTEXT->ri);
else
strlcpy (THIS->__retvalue, "", MAXSTRINGLEN);
%}