12 Aug, 2011

1 commit

  • Check multiple --lines option and print warning informing that only the
    first specified --line option is valid.

    Changes from the 1st post:

    - Accept only the first option instead of the last.
    - Fix warning message according to David's comment.
    - Mark as a bugfix.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110253.19900.96192.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

16 Jul, 2011

1 commit

  • Support adding probes on offline kernel modules. This enables
    perf-probe to trace kernel-module init functions via perf-probe.
    If user gives the path of module with -m option, perf-probe
    expects the module is offline.
    This feature works with --add, --funcs, and --vars.

    E.g)
    # perf probe -m /lib/modules/`uname -r`/kernel/fs/btrfs/btrfs.ko \
    -a "extent_io_init:5 extent_state_cache"
    Add new events:
    probe:extent_io_init (on extent_io_init:5 with extent_state_cache)
    probe:extent_io_init_1 (on extent_io_init:5 with extent_state_cache)

    You can now use it on all perf tools, such as:

    perf record -e probe:extent_io_init_1 -aR sleep 1

    Signed-off-by: Masami Hiramatsu
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/20110627072751.6528.10230.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     

01 Feb, 2011

1 commit

  • %td is for ptrdiff_t, avoiding this warning on 32-bit:

    cc1: warnings being treated as errors
    builtin-probe.c: In function ‘opt_set_filter’:
    builtin-probe.c:176:4: error: format ‘%ld’ expects type ‘long int’, but
    argument 3 has type ‘int’

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Jan, 2011

2 commits

  • Add filters support for available function list.

    Default filter is "!_*" for filtering out local-purpose symbols.

    e.g.:
    # perf probe --filter="add*" -F
    add_disk
    add_disk_randomness
    add_input_randomness
    add_interrupt_randomness
    add_memory
    add_page_to_unevictable_list
    add_page_wait_queue
    ...

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Chase Douglas
    Cc: Franck Bui-Huu
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Add filters support for available variable list.

    Default filter is "!__k???tab_*&!__crc_*" for filtering out
    automatically generated symbols.

    The format of filter rule is "[!]GLOBPATTERN", so you can use wild
    cards. If the filter rule starts with '!', matched variables are filter
    out.

    e.g.:
    # perf probe -V schedule --externs --filter=cpu*
    Available variables at schedule
    @
    cpumask_var_t cpu_callout_mask
    cpumask_var_t cpu_core_map
    cpumask_var_t cpu_isolated_map
    cpumask_var_t cpu_sibling_map
    int cpu_number
    long unsigned int* cpu_bit_bitmap
    ...

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Chase Douglas
    Cc: Franck Bui-Huu
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    [ committer note: Removed the elf.h include as it was fixed up in e80711c]
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

24 Jan, 2011

1 commit

  • Add --funcs to show available functions in symtab.

    Originally this feature came from Srikar's uprobes patches
    ( http://lkml.org/lkml/2010/8/27/244 )

    e.g.
    ...
    __ablkcipher_walk_complete
    __absent_pages_in_range
    __account_scheduler_latency
    __add_pages
    __alloc_pages_nodemask
    __alloc_percpu
    __alloc_reserved_percpu
    __alloc_skb
    __alloc_workqueue_key
    __any_online_cpu
    __ata_ehi_push_desc
    ...

    This also supports symbols in module, e.g.

    ...
    cleanup_module
    cpuid_maxphyaddr
    emulate_clts
    emulate_instruction
    emulate_int_real
    emulate_invlpg
    emulator_get_dr
    emulator_set_dr
    emulator_task_switch
    emulator_write_emulated
    emulator_write_phys
    fx_init
    ...

    Original-patch-from: Srikar Dronamraju
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Franck Bui-Huu
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    [ committer note: Add missing elf.h for STB_GLOBAL that broke a RHEL4 build ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

16 Dec, 2010

1 commit

  • Users were not being able to have the explicitely specified vmlinux
    pathname used, instead a search on the vmlinux path was always being
    made.

    Reported-by: Francis Moreau
    Acked-by: Masami Hiramatsu
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Francis Moreau
    Cc: Franck Bui-Huu
    Cc: Masami Hiramatsu
    LPU-Reference:
    Signed-off-by: Franck Bui-Huu
    Signed-off-by: Arnaldo Carvalho de Melo

    Franck Bui-Huu
     

22 Oct, 2010

4 commits

  • Add basic module probe support on perf probe. This introduces "--module
    " 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

    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
    @
    (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
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Add --externs for allowing --vars to show accessible global (externally
    defined) variables from a given probe point too.

    This will give you a hint which globals can be accessible from the probe point.

    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Just change the order of function arguments for ease of read; moving optional
    bool flag to the last.

    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Add -V (--vars) option for listing accessible local variables at given probe
    point. This will help finding which local variables are available for event
    arguments.

    e.g.)
    # perf probe -V call_timer_fn:23
    Available variables at call_timer_fn:23
    @
    function_type* fn
    int preempt_count
    long unsigned int data
    struct list_head work_list
    struct list_head* head
    struct timer_list* timer
    struct tvec_base* base

    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

30 Jul, 2010

1 commit

  • As a precursor for perf to support uprobes, rename fields/functions
    that had kprobe in their name but can be shared across perf-kprobes
    and perf-uprobes to probe.

    Cc: Ananth N Mavinakayanahalli
    Cc: Andrew Morton
    Cc: Christoph Hellwig
    Cc: "Frank Ch. Eigler"
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jim Keniston
    Cc: Linus Torvalds
    Cc: Mark Wielaard
    Cc: Mathieu Desnoyers
    Cc: Naren A Devaiah
    Cc: Oleg Nesterov
    Cc: "Paul E. McKenney"
    Cc: Peter Zijlstra
    Cc: Randy Dunlap
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Srikar Dronamraju
    Signed-off-by: Arnaldo Carvalho de Melo

    Srikar Dronamraju
     

17 Jun, 2010

1 commit

  • The probe plugin requires access to the source code for some operations. The
    source code must be in the exact same location as specified by the DWARF tags,
    but sometimes the location is an absolute path that cannot be replicated by a
    normal user. This change adds the -s|--source option to allow the user to
    specify the root of the kernel source tree.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Chase Douglas
    Signed-off-by: Arnaldo Carvalho de Melo

    Chase Douglas
     

19 May, 2010

1 commit

  • Functions that were calling xzalloc also returned -1 when, for other
    reasons, it could fail, and the calleds are coping with failures, so
    stop using die() and xzalloc().

    Cc: Frédéric Weisbecker
    Cc: Masami Hiramatsu
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

27 Apr, 2010

1 commit

  • Add --max-probes option to change the maximum limit of
    findable probe points per event, since inlined function can be
    expanded into thousands of probe points. Default value is 128.

    Signed-off-by: Masami Hiramatsu
    Suggested-by: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

15 Apr, 2010

3 commits

  • Instead of using debugfs_path, use debugfs_find_mountpoint()
    to find actual debugfs path.

    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Reported-by: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Frederic Weisbecker
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Remove die() and DIE_IF() code from util/probe-event.c since
    these 'sudden death' in utility functions make reusing it from
    other code (especially tui/gui) difficult.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Set given names to event arguments. The syntax is same as kprobe-tracer,
    you can add 'NAME=' right before each argument.

    e.g.
    ./perf probe vfs_read foo=file

    then, 'foo' is set to the argument name as below.

    ./perf probe -l
    probe:vfs_read (on vfs_read@linux-2.6-tip/fs/read_write.c with foo)

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

14 Apr, 2010

1 commit

  • Parsing an option from the command line with OPT_BOOLEAN on a
    bool data type would not work on a big-endian machine due to the
    manner in which the boolean was being cast into an int and
    incremented. For example, running 'perf probe --list' on a
    PowerPC machine would fail to properly set the list_events bool
    and would therefore print out the usage information and
    terminate.

    This patch makes OPT_BOOLEAN work as expected with a bool
    datatype. For cases where the original OPT_BOOLEAN was
    intentionally being used to increment an int each time it was
    passed in on the command line, this patch introduces OPT_INCR
    with the old behaviour of OPT_BOOLEAN (the verbose variable is
    currently the only such example of this).

    I have reviewed every use of OPT_BOOLEAN to verify that a true
    C99 bool was passed. Where integers were used, I verified that
    they were only being used for boolean logic and changed them to
    bools to ensure that they would not be mistakenly used as ints.
    The major exception was the verbose variable which now uses
    OPT_INCR instead of OPT_BOOLEAN.

    Signed-off-by: Ian Munsie
    Acked-by: David S. Miller
    Cc: # NOTE: wont apply to .3[34].x cleanly, please backport
    Cc: Git development list
    Cc: Ian Munsie
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: KOSAKI Motohiro
    Cc: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Eric B Munson
    Cc: Valdis.Kletnieks@vt.edu
    Cc: WANG Cong
    Cc: Thiago Farina
    Cc: Masami Hiramatsu
    Cc: Xiao Guangrong
    Cc: Jaswinder Singh Rajput
    Cc: Arjan van de Ven
    Cc: OGAWA Hirofumi
    Cc: Mike Galbraith
    Cc: Tom Zanussi
    Cc: Anton Blanchard
    Cc: John Kacur
    Cc: Li Zefan
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ian Munsie
     

03 Apr, 2010

1 commit


23 Mar, 2010

1 commit

  • Cleanup debuginfo related code to eliminate fragile code which
    pointed by Ingo (Thanks!).
    1) Invert logic of NO_DWARF_SUPPORT to DWARF_SUPPORT.
    2) For removing assymetric/local variable ifdefs, introduce
    more helper functions.
    3) Change options order to reduce the number of ifdefs.

    Reported-by: Ingo Molnar
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

17 Mar, 2010

5 commits

  • Introduce kprobe_trace_event and perf_probe_event and replace
    old probe_point structure with it. probe_point structure is
    not enough flexible nor extensible. New data structures
    will help implementing further features.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Add --dry-run option for debugging and testing.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Since this name 'session' conflicts with 'perf_session', and
    this structure just holds parameters anymore.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Move add-probe routine to util/probe_event.c. This simplifies
    main routine for reducing maintenance cost.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Use wrapped functions as much as possible, to check out of
    memory conditions in perf probe.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

13 Mar, 2010

1 commit

  • Fix probe_point array-size overrun problem. In some cases (e.g.
    inline function), one user-specified probe-point can be
    translated to many probe address, and it overruns pre-defined
    array-size. This also removes redundant MAX_PROBES macro
    definition.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc:
    LKML-Reference:
    [ Note that only root can create new probes. Eventually we should remove
    the MAX_PROBES limit, but that is a larger patch not eligible to
    perf/urgent treatment. ]
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

04 Mar, 2010

1 commit


26 Feb, 2010

4 commits

  • Add lazy line matching support for specifying new probes.
    This also changes the syntax of perf probe a bit. Now
    perf probe accepts one of below probe event definitions.

    1) Define event based on function name
    [EVENT=]FUNC[@SRC][:RLN|+OFF|%return|;PTN] [ARG ...]

    2) Define event based on source file with line number
    [EVENT=]SRC:ALN [ARG ...]

    3) Define event based on source file with lazy pattern
    [EVENT=]SRC;PTN [ARG ...]

    - New lazy matching pattern(PTN) follows ';' (semicolon). And it
    must be put the end of the definition.
    - So, @SRC is no longer the part which must be put at the end
    of the definition.

    Note that ';' (semicolon) can be interpreted as the end of
    a command by the shell. This means that you need to quote it.
    (anyway you will need to quote the lazy pattern itself too,
    because it may contains other sensitive characters, like
    '[',']' etc.).

    Lazy matching
    -------------
    The lazy line matching is similar to glob matching except
    ignoring spaces in both of pattern and target.

    e.g.
    'a=*' can matches 'a=b', 'a = b', 'a == b' and so on.

    This provides some sort of flexibility and robustness to
    probe point definitions against minor code changes.
    (for example, actual 10th line of schedule() can be changed
    easily by modifying schedule(), but the same line matching
    'rq=cpu_rq*' may still exist.)

    Changes in v3:
    - Cast Dwarf_Addr to uintmax_t for printf-formats.

    Changes in v2:
    - Cast Dwarf_Addr to unsigned long long for printf-formats.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Newer gcc introduces newer & richer debuginfo, and only libdw
    in elfutils project can support it. So perf probe moves onto
    elfutils-libdw from libdwarf.

    Changes in v3:
    - Cast Dwarf_Addr/Dwarf_Word to uintmax_t for printf-formats.
    - Recover a sign-prefix which was removed in v2 by mistake.

    Changes in v2:
    - Fix a type-casting bug in Makefile.
    - Cast Dwarf_Addr/Dwarf_Word to unsigned long long for printf-formats.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: K.Prasad
    Cc: Ulrich Drepper
    Cc: Roland McGrath
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Rename *_probepoint to *_probe_point, for nothing
    but a cosmetic reason.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Do not show --line option in help message when perf
    doesn't support dwarf.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

04 Feb, 2010

2 commits

  • With the recent modifications done to untie the session and
    symbol layers, 'perf probe' now can use just the symbols layer.

    Signed-off-by: Arnaldo Carvalho de Melo
    Acked-by: Masami Hiramatsu
    Cc: Frédéric Weisbecker
    Cc: Masami Hiramatsu
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • I noticed while writing the first test in 'perf regtest' that to
    just test the symbol handling routines one needs to create a
    perf session, that is a layer centered on a perf.data file,
    events, etc, so I untied these layers.

    This reduces the complexity for the users as the number of
    parameters to most of the symbols and session APIs now was
    reduced while not adding more state to all the map instances by
    only having data that is needed to split the kernel (kallsyms
    and ELF symtab sections) maps and do vmlinux relocation on the
    main kernel map.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

17 Jan, 2010

1 commit

  • I got this build error when building tip tree:

    | cc1: warnings being treated as errors
    | builtin-probe.c:123: error: 'opt_show_lines' defined but not used

    This error is caused by:

    | #ifndef NO_LIBDWARF
    | OPT_CALLBACK('L', "line", NULL,
    | "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
    | "Show source code lines.", opt_show_lines),
    | #endif

    My environment defines NO_LIBDWARF, so gcc treated
    opt_show_lines() as garbage. So I moved opt_show_lines() into
    #ifndef NO_LIBDWARF ... #endif block.

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    Cc: Masami Hiramatsu
    Cc: Mike Galbraith
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

13 Jan, 2010

2 commits

  • Add --line option to support showing probable source-code lines.

    perf probe --line SRC:LN[-LN|+NUM]
    or
    perf probe --line FUNC[:LN[-LN|+NUM]]

    This option shows source-code with line number if the line can
    be probed. Lines without line number (and blue color) means that
    the line can not be probed, because debuginfo doesn't have the
    information of those lines.

    The argument specifies the range of lines, "source.c:100-120"
    shows lines between 100th to l20th in source.c file. And
    "func:10+20" shows 20 lines from 10th line of func function.

    e.g.
    # ./perf probe --line kernel/sched.c:1080

    *
    * called with rq->lock held and irqs disabled
    */
    static void hrtick_start(struct rq *rq, u64 delay)
    {
    struct hrtimer *timer = &rq->hrtick_timer;
    1086 ktime_t time = ktime_add_ns(timer->base->get_time(), delay);

    hrtimer_set_expires(timer, time);

    1090 if (rq == this_rq()) {
    1091 hrtimer_restart(timer);
    1092 } else if (!rq->hrtick_csd_pending) {
    1093 __smp_call_function_single(cpu_of(rq), &rq->hrtick_csd,
    1094 rq->hrtick_csd_pending = 1;

    If you specifying function name, this shows function-relative
    line number.

    # ./perf probe --line schedule

    asmlinkage void __sched schedule(void)
    1 {
    struct task_struct *prev, *next;
    unsigned long *switch_count;
    struct rq *rq;
    int cpu;

    need_resched:
    preempt_disable();
    9 cpu = smp_processor_id();
    10 rq = cpu_rq(cpu);
    11 rcu_sched_qs(cpu);
    12 prev = rq->curr;
    13 switch_count = &prev->nivcsw;

    Signed-off-by: Masami Hiramatsu
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • So that tools such as 'perf probe' don't have to lookup
    '[kernel.kallsyms]' but instead access them directly after
    perf_session__create_kernel_maps or
    map_groups__create_kernel_maps.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

17 Dec, 2009

1 commit

  • Check whether the debugfs path is correct before executing
    a command, because perf-probe depends on debugfs.

    Signed-off-by: Masami Hiramatsu
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

16 Dec, 2009

2 commits

  • This simplifies a lot of functions, less stuff to be done by
    tool writers.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Fix perf probe to show which probe point is not found.
    With out this patch, it shows just "No probe point found."
    This doesn't help users if they specify several probes.
    e.g.

    # perf probe -f --add schedule --add test
    Fatal: No probe point found.

    This patch makes error message more helpful as below.

    # perf probe --add schedule --add test
    Fatal: Probe point 'test' not found. - probe not added.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu