This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Create a function that indents without the tid()
- From: Breno Leitao <leitao at linux dot vnet dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Wed, 30 Sep 2009 15:10:02 -0300
- Subject: [PATCH] Create a function that indents without the tid()
Actually indent_thread() is a very useful function, but
sometimes you're probing something that is not related to
thread, as an interrupt function, and if the application
changes during the interrupt, the indentation gets confused.
For example:
0 swapper(0): -> neo_copy_data_from_queue_to_uart
69 a.out(7659): -> neo_parse_modem
74 a.out(7659): -> neo_param
14 swapper(0): <- neo_copy_data_from_queue_to_uart
83 a.out(7659): -> jsm_carrier
86 a.out(7659): <- jsm_carrier
0 swapper(0): -> neo_parse_modem
94 a.out(7659): <- jsm_tty_set_termios
8 swapper(0): <- neo_parse_modem
So, I decided to create a simpler function that doesn't
consider the thread.
---
diff --git a/tapset/indent.stp b/tapset/indent.stp
index dface78..ee4e7b5 100644
--- a/tapset/indent.stp
+++ b/tapset/indent.stp
@@ -20,3 +20,11 @@ function thread_indent (delta)
{
return _generic_indent (tid(), delta)
}
+
+function indent(delta){
+ _indent += delta
+
+ for (i=1; i<_indent; i++) r .= " "
+
+ return r
+}