1. 05 Jul, 2010 3 commits
    • Masami Hiramatsu's avatar
      perf probe: Support tracing an entry of array · b2a3c12b
      Masami Hiramatsu authored
      Add array-entry tracing support to perf probe. This enables to trace an entry
      of array which is indexed by constant value, e.g. array[0].
      
      For example:
      
        $ perf probe -a 'bio_split bi->bi_io_vec[0]'
      
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195742.2885.5344.stgit@localhost6.localdomain6>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b2a3c12b
    • Masami Hiramatsu's avatar
      perf probe: Support "string" type · 73317b95
      Masami Hiramatsu authored
      Support string type casting to event argument. If perf-probe finds an argument
      casted as string, it ensures the target variable is "(unsigned/signed) char
      *(or []). perf-probe also adds dereference if the target is a pointer.
      
      So, both of 'char buf[10];' and 'char *buf;' can be accessed by 'buf:string'
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195734.2885.1666.stgit@localhost6.localdomain6>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      73317b95
    • Masami Hiramatsu's avatar
      tracing/kprobes: Support "string" type · e09c8614
      Masami Hiramatsu authored
      Support string type tracing and printing in kprobe-tracer.
      
      This allows user to trace string data in kernel including __user data. Note
      that sometimes __user data may not be accessed if it is paged-out (sorry, but
      kprobes operation should be done in atomic, we can not wait for page-in).
      
      Commiter note: Fixed up conflicts with b7e2ecef.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195724.2885.18788.stgit@localhost6.localdomain6>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e09c8614
  2. 02 Jul, 2010 1 commit
  3. 29 Jun, 2010 4 commits
    • Srikar Dronamraju's avatar
      perf: Fix hist_entry__tui_annotate() build failure · 0879b100
      Srikar Dronamraju authored
      When compiling perf on latest tip/master I see the following
      error:
      
        cc1: warnings being treated as errors
        util/newt.c: In function 'hist_entry__tui_annotate':
        util/newt.c:764: warning: 'ret' is used uninitialized in
        this function make: *** [util/newt.o] Error 1
      
      I think the problem was introduced by commit
      13f499f0
      
      Below is a patch that fixes the problem.
      Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20100629173226.GC23231@linux.vnet.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0879b100
    • Masami Hiramatsu's avatar
      kprobes/x86: Fix kprobes to skip prefixes correctly · 567a9fd8
      Masami Hiramatsu authored
      Fix resume_execution() and is_IF_modifier() to skip x86
      instruction prefixes correctly by using x86 instruction
      attribute.
      
      Without this fix, resume_execution() can't handle instructions
      which have non-REX prefixes (REX prefixes are skipped). This
      will cause unexpected kernel panic by hitting bad address when a
      kprobe hits on two-byte ret (e.g. "repz ret" generated for
      Athlon/K8 optimization), because it just checks "repz" and can't
      recognize the "ret" instruction.
      
      These prefixes can be found easily with x86 instruction
      attribute. This patch introduces skip_prefixes() and uses it in
      resume_execution() and is_IF_modifier() to skip prefixes.
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <4C298A6E.8070609@hitachi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      567a9fd8
    • Steven Rostedt's avatar
      tracing: Use class->reg() for all registering of events · a1d0ce82
      Steven Rostedt authored
      Because kprobes and syscalls need special processing to register
      events, the class->reg() method was created to handle the differences.
      
      But instead of creating a default ->reg for perf and ftrace events,
      the code was scattered with:
      
      	if (class->reg)
      		class->reg();
      	else
      		default_reg();
      
      This is messy and can also lead to bugs.
      
      This patch cleans up this code and creates a default reg() entry for
      the events allowing for the code to directly call the class->reg()
      without the condition.
      Reported-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a1d0ce82
    • Chase Douglas's avatar
      tracing/function-graph: Use correct string size for snprintf · d62f85d1
      Chase Douglas authored
      The nsecs_str string is a local variable defined as:
      
      char nsecs_str[5];
      
      It is possible for the snprintf call to use a size value larger than the
      size of the string. This should not cause a buffer overrun as it is
      written now due to the value for the string format "%03lu" can not be
      larger than 1000. However, this change makes it correct. By making the
      size correct we guard against potential future changes that could actually
      cause a buffer overrun.
      Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
      LKML-Reference: <1276619355-18116-1-git-send-email-chase.douglas@canonical.com>
      
      [ added 'UL' to number 8 to fix gcc warning comparing it to sizeof() ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d62f85d1
  4. 28 Jun, 2010 21 commits
  5. 27 Jun, 2010 11 commits