public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Create a function that indents without the tid()
@ 2009-09-30 18:11 Breno Leitao
  2009-09-30 19:15 ` Frank Ch. Eigler
  0 siblings, 1 reply; 7+ messages in thread
From: Breno Leitao @ 2009-09-30 18:11 UTC (permalink / raw)
  To: systemtap

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-01  1:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30 18:11 [PATCH] Create a function that indents without the tid() Breno Leitao
2009-09-30 19:15 ` Frank Ch. Eigler
2009-09-30 19:57   ` Breno Leitao
2009-09-30 20:25     ` Frank Ch. Eigler
2009-09-30 20:55       ` Breno Leitao
2009-09-30 21:00         ` Frank Ch. Eigler
2009-10-01  1:26           ` Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).