• Masami Hiramatsu's avatar
    perf probe: Add basic module support · 469b9b88
    Masami Hiramatsu authored
    Add basic module probe support on perf probe. This introduces "--module
    <MODNAME>" option to perf probe for putting probes and showing lines and
    variables in the given module.
    
    Currently, this supports only probing on running modules.  Supporting off-line
    module probing is the next step.
    
    e.g.)
    [show lines]
     # ./perf probe --module drm -L drm_vblank_info
    <drm_vblank_info:0>
          0  int drm_vblank_info(struct seq_file *m, void *data)
          1  {
                    struct drm_info_node *node = (struct drm_info_node *) m->private
          3         struct drm_device *dev = node->minor->dev;
     ...
    [show vars]
     # ./perf probe --module drm -V drm_vblank_info:3
    Available variables at drm_vblank_info:3
            @<drm_vblank_info+20>
                    (unknown_type)  data
                    struct drm_info_node*   node
                    struct seq_file*        m
    [put a probe]
     # ./perf probe --module drm drm_vblank_info:3 node m
    Add new event:
      probe:drm_vblank_info (on drm_vblank_info:3 with node m)
    
    You can now use it on all perf tools, such as:
    
            perf record -e probe:drm_vblank_info -aR sleep 1
    [list probes]
     # ./perf probe -l
    probe:drm_vblank_info (on drm_vblank_info:3@drivers/gpu/drm/drm_info.c with ...
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <20101021101341.3542.71638.stgit@ltc236.sdl.hitachi.co.jp>
    Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    469b9b88
probe-event.h 3.98 KB