From a26d3d1f488dff1870b9783f0315adb4521a8b61 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 17 Sep 2009 17:33:47 -0400 Subject: Add task_backtrace systemtap function. --- tapset/context-unwind.stp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tapset/context-unwind.stp') diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp index 4ad45dba..33431fd0 100644 --- a/tapset/context-unwind.stp +++ b/tapset/context-unwind.stp @@ -47,6 +47,19 @@ function backtrace:string () %{ /* pure */ strlcpy (THIS->__retvalue, "", MAXSTRINGLEN); %} +/** + * sfunction task_backtrace - Hex backtrace of an arbitrary task + * @task: pointer to task_struct + * + * Return a string of hex addresses that are a backtrace of the + * stack of a particular task. Output may be truncated as per + * maximum string length. + */ +function task_backtrace:string (task:long) %{ /* pure */ + _stp_stack_snprint_tsk(THIS->__retvalue, MAXSTRINGLEN, + (struct task_struct *)(unsigned long)THIS->task, 0, MAXTRACE); +%} + /** * sfunction caller - Return name and address of calling function * -- cgit