1. 10 Mar, 2009 2 commits
  2. 09 Mar, 2009 3 commits
    • KOSAKI Motohiro's avatar
      tracing: Don't use tracing_record_cmdline() in workqueue tracer · c3ffc7a4
      KOSAKI Motohiro authored
      Impact: improve workqueue tracer output
      
      Currently, /sys/kernel/debug/tracing/trace_stat/workqueues can display
      wrong and strange thread names.
      
      Why?
      
      Currently, ftrace has tracing_record_cmdline()/trace_find_cmdline()
      convenience function that implements a task->comm string cache.
      
      This can avoid unnecessary memcpy overhead and the workqueue tracer
      uses it.
      
      However, in general, any trace statistics feature shouldn't use
      tracing_record_cmdline() because trace statistics can display
      very old process. Then comm cache can return wrong string because
      recent process overrides the cache.
      
      Fortunately, workqueue trace guarantees that displayed processes
      are live. Thus we can search comm string from PID at display time.
      
      <before>
      
      % cat workqueues
       # CPU  INSERTED  EXECUTED   NAME
       # |      |         |          |
      
         7 431913     431913       kondemand/7
         7      0          0       tail
         7     21         21       git
         7      0          0       ls
         7      9          9       cat
         7 832632     832632       unix_chkpwd
         7 236292     236292       ls
      
      Note: tail, git, ls, cat unix_chkpwd are obiously not workqueue thread.
      
      <after>
      
      % cat workqueues
       # CPU  INSERTED  EXECUTED   NAME
       # |      |         |          |
      
         7    510        510       kondemand/7
         7      0          0       kmpathd/7
         7     15         15       ata/7
         7      0          0       aio/7
         7     11         11       kblockd/7
         7   1063       1063       work_on_cpu/7
         7    167        167       events/7
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c3ffc7a4
    • Ingo Molnar's avatar
      tracing: optimize trace_printk() · 7bffc23e
      Ingo Molnar authored
      Impact: micro-optimization
      
      trace_printk() does this unconditionally:
      
      	trace_printk_fmt = fmt;
      
      Where trace_printk_fmt is an entry into a global array. This is
      very SMP-unfriendly.
      
      So only write it once per bootup.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1236356510-8381-5-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7bffc23e
    • Ingo Molnar's avatar
      tracing: trace_printk() fix, move format array to data section · 8a20d84d
      Ingo Molnar authored
      Impact: fix kernel crash when using trace_printk()
      
      trace_printk_fmt section is defined into the readonly section.
      But we do:
      
      	trace_printk_fmt = fmt;
      
      to fill in that table of format strings - which is not read-only.
      Under CONFIG_DEBUG_RODATA=y this crashes ...
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1236356510-8381-5-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8a20d84d
  3. 08 Mar, 2009 21 commits
  4. 06 Mar, 2009 14 commits