24 Sep, 2011

5 commits

  • Try and pick the best symbol based on a few heuristics:

    - Prefer a non weak symbol over a weak one
    - Prefer a global symbol over a non global one
    - Prefer a symbol with less underscores (idea taken from kallsyms.c)
    - If all else fails, choose the symbol with the longest name

    Cc: Eric B Munson
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110824065243.161953371@samba.org
    Signed-off-by: Anton Blanchard
    Signed-off-by: Arnaldo Carvalho de Melo

    Anton Blanchard
     
  • kallsyms__parse capitalises the symbol type, so every symbol is marked
    global. Remove this and fix symbol_type__is_a to handle both local and
    global symbols.

    Cc: Eric B Munson
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110824065243.077125989@samba.org
    Signed-off-by: Anton Blanchard
    Signed-off-by: Arnaldo Carvalho de Melo

    Anton Blanchard
     
  • kallsyms__parse assumes that /proc/kallsyms is sorted and sets the end
    of the previous symbol to the start of the current one.

    Unfortunately module symbols are not sorted, eg:

    ffffffffa0081f30 t e1000_clean_rx_irq [e1000e]
    ffffffffa00817a0 t e1000_alloc_rx_buffers [e1000e]

    Some symbols end up with a negative length and others have a length
    larger than they should. This results in confusing perf output.

    We already have a function to fixup the end of zero length symbols so
    use that instead.

    Cc: Eric B Munson
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110824065242.969681349@samba.org
    Signed-off-by: Anton Blanchard
    Signed-off-by: Arnaldo Carvalho de Melo

    Anton Blanchard
     
  • 64bit PowerPC debuginfo files have an empty function descriptor section.
    I hit a SEGV when perf tried to use this section for symbol resolution.

    To fix this we need to check the section is valid and we can do this by
    checking for type SHT_PROGBITS.

    Cc:
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Eric B Munson
    Link: http://lkml.kernel.org/r/20110824065242.895239970@samba.org
    Signed-off-by: Anton Blanchard
    Signed-off-by: Arnaldo Carvalho de Melo

    Anton Blanchard
     
  • Fix to call convert_variable() if previous call does not fail.

    To call convert_variable, it ensures "ret" is 0. However, since
    "ret" has the return value of synthesize_perf_probe_arg() which
    always returns positive value if it succeeded, perf probe doesn't
    call convert_variable(). This will cause a SEGV when we add an
    event with arguments.

    This has to be fixed as it ensures "ret" is greater than 0
    (or not negative).

    This regression has been introduced by my previous patch, f182e3e1.

    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/20110820053922.3286.65805.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

18 Aug, 2011

4 commits

  • Upstream glibc commit 295e904 added a definition for __attribute_const__
    to cdefs.h. This causes the following error when building perf:

    util/include/linux/compiler.h:8:0: error: "__attribute_const__"
    redefined [-Werror] /usr/include/sys/cdefs.h:226:0: note: this is the
    location of the previous definition

    Wrap __attribute_const__ in #ifndef as we do for __always_inline.

    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110818113720.GL2227@zod.bos.redhat.com
    Signed-off-by: Josh Boyer
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Boyer
     
  • There was a problem with the parse_events() code not printing the
    correct event name when an event was unknown and starting with an 'r'.
    The source of the problem was the way raw notation was parsed.

    Without the patch:
    $ perf stat -e retired_foo
    invalid event modifier: 'tired_foo'

    With the patch:
    $ perf stat -e retired_foo
    invalid or unsupported event: 'retired_foo'

    This also covers the case where the name of the event was not printed at
    all when perf was linked with libpfm4.

    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110723021043.GA20178@quad
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • When no event is given to perf record, perf top, a default event is
    initialized (cycles). However, perf_evlist__add_default() was not
    setting the symbolic name for the event. Perf top worked simply because
    it was reconstructing the name from the event code. But it should not
    have to do this. This patch initializes the evsel->name field properly.

    This second version improves the code flow on the non error path.

    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110607161936.GA8163@quad
    Signed-off-by: Stephane Eranian
    [committer note: Use perf_evsel__delete() instead of plain free()]
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • This patch fixes an issue with the exit value of perf list:

    $ perf list; echo $?
    129

    perf list returns an error exit code even though there is no error.

    There was a stray exit(129) in print_events(). This patch removes this
    exit().

    $ perf list; echo $?
    0

    $ perf list hw sw
    cpu-cycles OR cycles [Hardware event]
    stalled-cycles-frontend OR idle-cycles-frontend [Hardware event]
    stalled-cycles-backend OR idle-cycles-backend [Hardware event]
    instructions [Hardware event]
    cache-references [Hardware event]
    cache-misses [Hardware event]
    branch-instructions OR branches [Hardware event]
    branch-misses [Hardware event]
    bus-cycles [Hardware event]

    cpu-clock [Software event]
    task-clock [Software event]
    page-faults OR faults [Software event]
    minor-faults [Software event]
    major-faults [Software event]
    context-switches OR cs [Software event]
    cpu-migrations OR migrations [Software event]
    alignment-faults [Software event]
    emulation-faults [Software event]
    $ echo $?
    0

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110523123917.GA31060@quad
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     

12 Aug, 2011

9 commits

  • With gcc4.6, some instances of concrete inlined function looks redundant
    and broken, because it appears inside of a concrete instance and its
    call_file and call_line are same as the original abstruct's decl_file
    and decl_line respectively.

    e.g.
    [ d1aa] subprogram
    external (flag) Yes
    name (strp) "add_timer"
    decl_file (data1) 2 ;here is original
    decl_line (data2) 847 ;line and file
    prototyped (flag) Yes
    inline (data1) inlined (1)
    sibling (ref4) [ d1c6]
    ...
    [ 11d84] subprogram
    abstract_origin (ref4) [ d1aa] ; concrete instance
    low_pc (addr) .text+0x000000000000246f
    high_pc (addr) .text+0x000000000000248b
    frame_base (block1) [ 0] call_frame_cfa
    sibling (ref4) [ 11dd9]
    [ 11d9f] formal_parameter
    abstract_origin (ref4) [ d1b9]
    location (data4) location list [ 701b]
    [ 11da8] inlined_subroutine
    abstract_origin (ref4) [ d1aa] ; redundant instance
    low_pc (addr) .text+0x000000000000247e
    high_pc (addr) .text+0x0000000000002480
    call_file (data1) 2 ; call line and file
    call_line (data2) 847 ; are same as above

    Those redundant instances leads unwilling results;

    e.g. find probe points inside of functions even if we specify
    a function entry as below;

    $ perf probe -V add_timer
    Available variables at add_timer
    @
    struct timer_list* timer
    @
    (No matched variables)

    So, this filters out those redundant instances based on call-site and
    decl-site information.

    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/20110811110317.19900.59525.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • gcc 4.6 generates a concrete out-of-line instance when there is a
    function which is implicitly inlined somewhere but also has its own
    instance. The concrete out-of-line instance means that it has an
    abstract origin of the function which is referred by not only
    inlined-subroutines but also a concrete subprogram.

    Since current dwarf_func_inline_instances() can find only instances of
    inlined-subroutines, this introduces new die_walk_instances() to find
    both of subprogram and inlined-subroutines.

    e.g. without this,
    Available variables at sched_group_rt_period
    @
    struct task_group* tg

    perf probe failed to find actual subprogram instance of
    sched_group_rt_period().

    With this,

    Available variables at sched_group_rt_period
    @
    struct task_group* tg
    @
    struct task_group* tg

    Now it found the sched_group_rt_period() itself.

    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/20110811110311.19900.63997.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix variable searching logic to search one in inner than local scope or
    global(CU) scope. In the other words, skip searching in intermediate
    scopes.

    e.g., in the following code,

    int var1;

    void inline infunc(int i)
    {
    i++; without.vars

    With this:
    $ perf probe -V pre_schedule --externs > with.vars

    Check the diff:
    $ diff without.vars with.vars
    88d87
    < int cpu
    133d131
    < long unsigned int* switch_count

    These vars are actually in the scope of schedule(), the caller of
    pre_schedule().

    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/20110811110305.19900.94374.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix perf probe to search local variables in appropriate local inlined
    function scope. For example, pre_schedule() has only 2 local variables,
    as below;

    $ perf probe -L pre_schedule

    0 static inline void pre_schedule(struct rq *rq, struct task_struct *prev)
    {
    2 if (prev->sched_class->pre_schedule)
    3 prev->sched_class->pre_schedule(rq, prev);
    }

    However, current perf probe shows 4 local variables on pre_schedule(),
    because it searches variables in the caller(schedule()) scope.

    $ perf probe -V pre_schedule
    Available variables at pre_schedule
    @
    int cpu
    long unsigned int* switch_count
    struct rq* rq
    struct task_struct* prev

    This patch fixes this issue by searching variables in the local scope of
    the instance of inlined function. Here is the result.

    $ perf probe -V pre_schedule
    Available variables at pre_schedule
    @
    struct rq* rq
    struct task_struct* prev

    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/20110811110259.19900.85664.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix line-range collector to walk all instances of inlined function,
    because some execution paths can be optimized out depending on the
    function argument of instances.

    E.g.)
    inline_func (arg) {
    if (arg)
    do_something;
    else
    do_another;
    }

    func_A() {
    inline_func(1)
    }

    func_B() {
    inline_func(0)
    }

    In this case, func_A may have only do_something code and func_B may have
    only do_another.

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

    Masami Hiramatsu
     
  • Fix perf probe to walk through the lines of all nested inlined function
    call sites and declared lines when a whole CU is passed to the line
    walker.

    The die_walk_lines() can have two different type of DIEs, subprogram (or
    inlined-subroutine) DIE and CU DIE.

    If a caller passes a subprogram DIE, this means that the walker walk on
    lines of given subprogram. In this case, it just needs to search on
    direct children of DIE tree for finding call-site information of inlined
    function which directly called from given subprogram.

    On the other hand, if a caller passes a CU DIE to the walker, this means
    that the walker have to walk on all lines in the source files included
    in given CU DIE. In this case, it has to search whole DIE trees of all
    subprograms to find the call-site information of all nested inlined
    functions.

    Without this patch:

    $ perf probe --line kernel/cpu.c:151-157

    static int cpu_notify(unsigned long val, void *v)
    {
    154 return __cpu_notify(val, v, -1, NULL);
    }

    With this:
    $ perf probe --line kernel/cpu.c:151-157

    152 static int cpu_notify(unsigned long val, void *v)
    {
    154 return __cpu_notify(val, v, -1, NULL);
    }

    As you can see, --line option with source line range shows the declared
    lines as probe-able.

    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/20110811110241.19900.34994.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix line walker to check whether a given DIE is CU or not.

    Actually this function accepts CU, subprogram and inlined_subroutine
    DIEs.

    Without this fix, perf probe always fails to analyze lines on inlined
    functions;

    $ perf probe -L pre_schedule
    Debuginfo analysis failed. (-2)
    Error: Failed to show lines. (-2)

    This fixes that bug, as below.

    $ perf probe -L pre_schedule

    0 static inline void pre_schedule(struct rq *rq, struct task_struct *prev
    {
    2 if (prev->sched_class->pre_schedule)
    3 prev->sched_class->pre_schedule(rq, prev);
    }

    /* rq->lock is NOT held, but preemption is disabled */

    Changes from v1:
    - Update against current tip tree.(Fix dwarf-aux.c)

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

    Masami Hiramatsu
     
  • Fix a memory leak for scopes array when it finds a variable in the
    global scope.

    Reviewed-by: Pekka Enberg
    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/20110811110229.19900.63019.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • A file in /tmp/ might be a symlink, so lstat() should be used instead of
    stat().

    Acked-by: Pekka Enberg
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros
    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Arnaldo Carvalho de Melo

    Vasiliy Kulikov
     

11 Aug, 2011

1 commit

  • If we bring the recorded perf data together with kernel binary from another
    machine using:

    on server A:
    perf archive

    on server B:
    tar xjvf perf.data.tar.bz2 -C ~/.debug

    the build_id kernel dso is not properly recognized during the "perf report"
    command on server B.

    The reason is, that build_id dsos are added during the session initialization,
    while the kernel maps are created during the sample event processing.

    The machine__create_kernel_maps functions ends up creating new dso object for
    kernel, but it does not check if we already have one added by build_id
    processing.

    Also the build_id reading ABI quirk added in commit:

    - commit b25114817a73bbd2b84ce9dba02ee1ef8989a947
    perf build-id: Add quirk to deal with perf.data file format breakage

    populates the "struct build_id_event::pid" with 0, which
    is later interpreted as DEFAULT_GUEST_KERNEL_ID.

    This is not always correct, so it's better to guess the pid
    value based on the "struct build_id_event::header::misc" value.

    - Tested with data generated on x86 kernel version v2.6.34
    and reported back on x86_64 current kernel.
    - Not tested for guest kernel case.

    Note the problem stays for PERF_RECORD_MMAP events recorded by perf that
    does not use proper pid (HOST_KERNEL_ID/DEFAULT_GUEST_KERNEL_ID). They are
    misinterpreted within the current perf code. Probably there's not much we
    can do about that.

    Cc: Avi Kivity
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Yanmin Zhang
    Link: http://lkml.kernel.org/r/20110601194346.GB1934@jolsa.brq.redhat.com
    Signed-off-by: Jiri Olsa
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

10 Aug, 2011

2 commits

  • It will be immediately replaced in perf_top_browser__run.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-q7e2jzb44elqpkvdllk94x0i@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The external symbol files are generated by JIT compilers, for example, but we
    need to make sure they're ours before injecting them to 'perf report'.

    Requested-by: Ingo Molnar
    Cc: Frederic Weisbecker
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1312919658-17158-1-git-send-email-penberg@kernel.org
    Signed-off-by: Pekka Enberg
    Signed-off-by: Arnaldo Carvalho de Melo

    Pekka Enberg
     

09 Aug, 2011

1 commit

  • Just like we do already for perf.data files.

    Requested-by: Ingo Molnar
    Cc: Ben Hutchings
    Cc: Christian Ohm
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jonathan Nieder
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-qgokmxsmvppwpc5404qhyk7e@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

08 Aug, 2011

3 commits

  • Adding install-python_ext target to install python extension related
    files. Installation directory is governed by python distutils package
    and follows the DESTDIR variable settings.

    Also moving python extension build output into '$(O)python_ext_build'
    directory and making it configurable via PYTHON_EXTBUILD variable.

    Keeping the '$(O)python/perf.so' file, so it could be used for testing
    as of until now.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110722113307.GA1931@jolsa.brq.redhat.com
    Signed-off-by: Jiri Olsa
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • In addition to /etc/perfconfig and $HOME/.perfconfig, perf looks for
    configuration in the file ./config, imitating git which looks at
    $GIT_DIR/config. If ./config is not a perf configuration file, it
    fails, or worse, treats it as a configuration file and changes behavior
    in some unexpected way.

    "config" is not an unusual name for a file to be lying around and perf
    does not have a private directory dedicated for its own use, so let's
    just stop looking for configuration in the cwd. Callers needing
    context-sensitive configuration can use the PERF_CONFIG environment
    variable.

    Requested-by: Christian Ohm
    Cc: 632923@bugs.debian.org
    Cc: Ben Hutchings
    Cc: Christian Ohm
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110805165838.GA7237@elie.gateway.2wire.net
    Signed-off-by: Jonathan Nieder
    Signed-off-by: Arnaldo Carvalho de Melo

    Jonathan Nieder
     
  • perf will coredump if the user doesn't give the "-m" option in probe
    command, this patch fixes it.

    [root@localhost perf]# ./perf probe --add='PROBE'
    Segmentation fault (core dumped)

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1311602888-2389-1-git-send-email-bookjovi@gmail.com
    Signed-off-by: Jovi Zhang
    Signed-off-by: Arnaldo Carvalho de Melo

    Jovi Zhang
     

26 Jul, 2011

1 commit

  • So those friggin "spurious" PERF_RECORD_MMAP events were actually a
    brain fart copy'n'paste error in the python binding, doh. I.e. they
    weren't MMAPs, just SAMPLEs.

    Fix it by providing routines for these events instead of using the MMAP
    ones.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-b0rc8y5jd03f9f11kftodvkm@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

25 Jul, 2011

1 commit

  • To remove the last case of access to the FD() macro outside the library.

    Inspired by a patch by Borislav that moved the FD() macro to util.h, for
    namespace concerns I rather preferred to constrain it to ev{sel,list}.c.

    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-qn893qsstcg366tkucu649qj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

22 Jul, 2011

1 commit

  • The readlink() function doesn't append a null byte to buf. So we should
    zero out buf with zalloc(). Or we'll see sometimes error like this:

    [root@intel-s3e36-01]~# /usr/bin/perf buildid-cache -a /lib/modules/2.6.32-130.el6.x86_64/kernel/crypto/twofish_common.ko -v
    Adding f64ba8efd5f53c7ad332fc17db1d21de309038e1 /lib/modules/2.6.32-130.el6.x86_64/kernel/crypto/twofish_common.ko: Ok
    [root@intel-s3e36-01]~# /usr/bin/perf buildid-cache -r /lib/modules/2.6.32-130.el6.x86_64/kernel/crypto/twofish_common.ko -v
    Removing f64ba8efd5f53c7ad332fc17db1d21de309038e1 /lib/modules/2.6.32-130.el6.x86_64/kernel/crypto/twofish_common.ko: FAIL
    /lib/modules/2.6.32-130.el6.x86_64/kernel/crypto/twofish_common.ko wasn't in the cache

    The change in build_id_cache__add_s() is a defense.

    Tested-by: Jiri Olsa
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/20110718031314.GA5802@hpt.nay.redhat.com
    Signed-off-by: Han Pingtian
    Signed-off-by: Arnaldo Carvalho de Melo

    Han Pingtian
     

21 Jul, 2011

4 commits

  • Moving out the option parameter from parse_events function,
    and adding new parse_events_option function instead.

    The option parameter is used only to carry "struct perf_evlist"
    pointer for chaining new events. Putting it away, enable us
    to call parse_events from other places without using the
    option parameter.

    Signed-off-by: Jiri Olsa
    Cc: acme@redhat.com
    Cc: a.p.zijlstra@chello.nl
    Cc: paulus@samba.org
    Link: http://lkml.kernel.org/r/1310635534-4013-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Ingo Molnar

    Jiri Olsa
     
  • Non-callchain path is using al.addr which prints as:
    openssl 14564 17672.003587: 7862d _x86_64_AES_encrypt_compact

    This should be sample->ip to print as:
    openssl 14564 17672.003587: 3f7867862d _x86_64_AES_encrypt_compact

    Signed-off-by: David Ahern
    Acked-by: Frederic Weisbecker
    Cc: acme@ghostprotocols.net
    Cc: peterz@infradead.org
    Cc: paulus@samba.org
    Link: http://lkml.kernel.org/r/1306768587-15376-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Ingo Molnar

    David Ahern
     
  • The perf_event_attr struct has two __u32's at the top and
    they need to be swapped individually.

    With this change I was able to analyze a perf.data collected in a
    32-bit PPC VM on an x86 system. I tested both 32-bit and 64-bit
    binaries for the Intel analysis side; both read the PPC perf.data
    file correctly.

    -v2:
    - changed the existing perf_event__attr_swap() to swap only elements
    of perf_event_attr and exported it for use in swapping the
    attributes in the file header
    - updated swap_ops used for processing events

    Signed-off-by: David Ahern
    Acked-by: Frederic Weisbecker
    Cc: acme@ghostprotocols.net
    Cc: peterz@infradead.org
    Cc: paulus@samba.org
    Cc:
    Link: http://lkml.kernel.org/r/1310754849-12474-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Ingo Molnar

    David Ahern
     
  • Add "node" as a simple alias for NODE cache events.

    The addition of NODE cache events broke the parse_alias
    function, so any mismatched event caused the segfault, like:

    # ./perf stat -e krava ls

    The hw_cache/hw_cache_op/hw_cache_result arrays needs to follow
    PERF_COUNT_HW_CACHE_*MAX enums. Adding those MAXs to be size
    of those arrays, so possible ommision in future wil not lead to
    segfault.

    Adding read/write/prefetch as allowed operations for node cache
    event.

    Signed-off-by: Jiri Olsa
    Acked-by: Peter Zijlstra
    Cc: acme@redhat.com
    Link: http://lkml.kernel.org/r/20110713205818.GB7827@jolsa.brq.redhat.com
    Signed-off-by: Ingo Molnar

    Jiri Olsa
     

16 Jul, 2011

7 commits

  • 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
     
  • Add probed module name and ":" in front of function name
    if -m module option is given. In the result, the symbol
    name passed to kprobe-tracer becomes MODULE:FUNCTION,
    so that kallsyms can solve it as a symbol in the module
    correctly.

    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/20110627072745.6528.26416.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     
  • Introduce debuginfo to encapsulate dwarf information.
    This new object allows us to reuse and expand debuginfo easily.

    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/20110627072739.6528.12438.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     
  • Move dwarf library related routines to dwarf-aux.{c,h}.
    This includes several minor changes.
    - Add simple documents for each API.
    - Rename die_find_real_subprogram() to die_find_realfunc()
    - Rename line_walk_handler_t to line_walk_callback_t.
    - Minor cleanups.

    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/20110627072727.6528.57647.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     
  • Since there are dwarf_bitsize, dwarf_bitoffset and dwarf_bytesize
    defined in libdw, we don't need die_get_bit_size, die_get_bit_offset
    and die_get_byte_size anymore.

    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/20110627072721.6528.2747.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     
  • Since strtailcmp() is enough generic, it should be defined in string.c.

    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/20110627072715.6528.10677.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     
  • Since die_find/walk* callbacks use DIE_FIND_CB_FOUND for
    both of failed and found cases, it should be "END"
    instead "FOUND" for avoiding confusion.

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

    Masami Hiramatsu
     

15 Jul, 2011

1 commit

  • While attempting to create a timechart of boot up I found perf didn't
    tolerate modules being loaded/unloaded. This patch fixes this by
    reading the file once and then writing the size read at the correct
    point in the file. It also simplifies the code somewhat.

    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Sonny Rao
    Signed-off-by: Michael Neuling
    Link: http://lkml.kernel.org/r/10011.1310614483@neuling.org
    Signed-off-by: Steven Rostedt

    Sonny Rao