This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]