08 Dec, 2012

1 commit


20 Nov, 2012

1 commit

  • Make perf build for x86 once the UAPI disintegration patches for that arch
    have been applied by adding the appropriate -I flags - in the right order -
    and then converting some #includes that use ../.. notation to find main kernel
    headerfiles to use and instead.

    Note that -Iarch/foo/include/uapi is present _before_ -Iarch/foo/include.
    This makes sure we get the userspace version of the pt_regs struct. Ideally,
    we wouldn't have the latter -I flag at all, but unfortunately we want
    asm/svm.h and asm/vmx.h in builtin-kvm.c and these aren't part of the UAPI -
    at least not for x86. I wonder if the bits outside of the __KERNEL__ guards
    *should* be transferred there.

    I note also that perf seems to do its dependency handling manually by listing
    all the header files it might want to use in LIB_H in the Makefile. Can this
    be changed to use -MD?

    Note that to do make this work, we need to export and UAPI disintegrate
    linux/hw_breakpoint.h, which I think should've been exported previously so that
    perf can access the bits. We have to do this in the same patch to maintain
    bisectability.

    Signed-off-by: David Howells

    David Howells
     

15 Nov, 2012

13 commits

  • To clarify what is being tested, instead of assuming that evsel->leader
    == NULL means either an 'isolated' evsel or a 'group leader'.

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

    Arnaldo Carvalho de Melo
     
  • We now have proper fallback logic, so always build it regardless of TUI
    or GTK setting.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352813436-14173-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Sometimes we need to know when the progress bar should disappear.

    Checking curr >= total wasn't enough since there're cases not met that
    condition for the last call.

    So add a new ->finish callback to identify this explicitly. Currently
    only GTK frontend needs it.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352813436-14173-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Updating event parser to allow any non zero string containing [ukhpGH]
    characters for event modifier.

    The modifier sanity is checked later in parse-event object logic. The
    check validates modifier to contain only one instance of any modifier
    (apart from 'p') present.

    v2:
    - added length check suggested Namhyung Kim

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20121113143258.GA2481@krava.brq.redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • There's no need to disable/enable ordinary group member events,
    because they are initialy enabled and get scheduled by the leader.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352741644-16809-5-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Currently the record command sets all events initially as disabled.

    There's non conditional perf_evlist__enable call, that enables all
    events before we exec tracee program. That actually screws whole
    enable_on_exec logic, because the event is enabled before the traced
    program got executed.

    What we actually want is:

    1) For any type of traced program:
    - all independent events and group leaders are disabled
    - all group members are enabled

    Group members are ruled by group leaders. They need to
    be enabled, because the group scheduling relies on that.

    2) For traced programs executed by perf:
    - all independent events and group leaders have
    enable_on_exec set
    - we don't specifically enable or disable any event during
    the record command

    Independent events and group leaders are initially disabled
    and get enabled by exec. Group members are ruled by group
    leaders as stated in 1).

    3) For traced programs attached by perf (pid/tid):
    - we specifically enable or disable all events during
    the record command

    When attaching events to already running traced we
    enable/disable events specifically, as there's no
    initial traced exec call.

    Fixing appropriate perf_event_attr test case to cover this change.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352741644-16809-3-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Fixing events attributes for groups defined via '{}'.

    Currently 'enable_on_exec' attribute in record command and both
    'disabled ' and 'enable_on_exec' attributes in stat command are set
    based on the 'group' option. This eliminates proper setup for '{}'
    defined groups as they don't set 'group' option.

    Making above attributes values based on the 'evsel->leader' as this is
    common to both group definition.

    Moving perf_evlist__set_leader call within builtin-record ahead
    perf_evlist__config_attrs call, because the latter needs possible group
    leader links in place.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352741644-16809-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • When reading those files to synthesize MMAP events. It makes the code
    shorter and cleaner.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1352643651-13891-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • CC builtin-annotate.o
    In file included from util/evsel.h:10:0,
    from util/evlist.h:8,
    from builtin-annotate.c:20:
    util/hist.h: In function ‘script_browse’:
    util/hist.h:198:45: error: unused parameter ‘script_opt’ [-Werror=unused-parameter]
    cc1: all warnings being treated as errors
    make: *** [builtin-annotate.o] Error 1
    make: *** Waiting for unfinished jobs....

    Signed-off-by: Namhyung Kim
    Cc: Feng Tang
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352697240-422-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Not just nr_events and period.

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

    Arnaldo Carvalho de Melo
     
  • As suggested by tglx long ago.

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

    Arnaldo Carvalho de Melo
     
  • Final function renames to match test__* style and include cleanup.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352508412-16914-12-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Separating pmu's object tests into pmu object under tests directory.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352508412-16914-11-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

10 Nov, 2012

2 commits

  • The --print-line option of perf annotate command shows summary for
    each source line. But it didn't merge same lines so that it can
    appear multiple times.

    * before:

    Sorted summary for file /home/namhyung/bin/mcol
    ----------------------------------------------
    21.71 /home/namhyung/tmp/mcol.c:26
    20.66 /home/namhyung/tmp/mcol.c:25
    9.53 /home/namhyung/tmp/mcol.c:24
    7.68 /home/namhyung/tmp/mcol.c:25
    7.67 /home/namhyung/tmp/mcol.c:25
    7.66 /home/namhyung/tmp/mcol.c:26
    7.49 /home/namhyung/tmp/mcol.c:26
    6.92 /home/namhyung/tmp/mcol.c:25
    6.81 /home/namhyung/tmp/mcol.c:25
    1.07 /home/namhyung/tmp/mcol.c:26
    0.52 /home/namhyung/tmp/mcol.c:25
    0.51 /home/namhyung/tmp/mcol.c:25
    0.51 /home/namhyung/tmp/mcol.c:24

    * after:

    Sorted summary for file /home/namhyung/bin/mcol
    ----------------------------------------------
    50.77 /home/namhyung/tmp/mcol.c:25
    37.94 /home/namhyung/tmp/mcol.c:26
    10.04 /home/namhyung/tmp/mcol.c:24

    To do that, introduce percent_sum field so that the normal
    line-by-line output doesn't get changed.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352440729-21848-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Some lines are indented by whitespace characters rather than tabs. Fix
    them.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1352482044-3443-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

09 Nov, 2012

5 commits

  • This time out of map.[ch] mostly, just code move plus a buch of 'self'
    removal, using machine or machines instead.

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

    Arnaldo Carvalho de Melo
     
  • That given two hists will find the hist_entries (buckets) in the second
    hists that are for the same bucket in the first and link them, then it
    will look for all buckets in the second that don't have a counterpart in
    the first and will create a dummy counterpart that will then be linked
    to the entry in the second.

    For multiple events this will be done pairing the leader with all the
    other events in the group, so that in the end the leader will have all
    the buckets in all the hists in a group, dummy or not while the other
    hists will be left untouched.

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

    Arnaldo Carvalho de Melo
     
  • Its not 'diff' specific and will be useful for other use cases, like
    bucketizing multiple events in a single session.

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

    Arnaldo Carvalho de Melo
     
  • We want to match more than two hists, so that we can match more than two
    perf.data files and moreover, match hist_entries (buckets) in multiple
    events in a group.

    So the "baseline"/"leader" will instead of a ->pair pointer, use a
    list_head, that will link to the pairs and hists__match use it.

    Following that perf_evlist__link will link the hists in its evsel
    groups.

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

    Arnaldo Carvalho de Melo
     
  • - Add missing scanner symbol for arbitrary aliases inside the config
    region.

    - looks nicer than _, so allow - in the event names. Used for various of
    the arch perfmon and Haswell events.

    Signed-off-by: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352123463-7346-6-git-send-email-eranian@google.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Andi Kleen
     

08 Nov, 2012

3 commits

  • Those data should be free along with the associated hist_entry,
    otherwise it'll be leaked.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1352273234-28912-7-git-send-email-namhyung@kernel.org
    [ committer note: mem_info is not yet in perf/core, free just branch_info ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Output of /proc//maps contains helpful information to anonymous
    mappings like stack, heap, ... For the case of stack, it can show
    multiple stack area for each thread in the process:

    $ cat /proc/$(pidof gnome-shell)/maps | grep stack
    7fe019946000-7fe01a146000 rw-p 00000000 00:00 0 [stack:1624]
    7fe040e32000-7fe041632000 rw-p 00000000 00:00 0 [stack:1451]
    7fe041643000-7fe041e43000 rw-p 00000000 00:00 0 [stack:1450]
    7fe04204b000-7fe04284b000 rw-p 00000000 00:00 0 [stack:1449]
    7fe042a7e000-7fe04327e000 rw-p 00000000 00:00 0 [stack:1446]
    7fe0432ff000-7fe043aff000 rw-p 00000000 00:00 0 [stack:1445]
    7fe043b00000-7fe044300000 rw-p 00000000 00:00 0 [stack:1444]
    7fe044301000-7fe044b01000 rw-p 00000000 00:00 0 [stack:1443]
    7fe044b02000-7fe045302000 rw-p 00000000 00:00 0 [stack:1442]
    7fe045303000-7fe045b03000 rw-p 00000000 00:00 0 [stack:1441]
    7fe045b04000-7fe046304000 rw-p 00000000 00:00 0 [stack:1440]
    7fe046305000-7fe046b05000 rw-p 00000000 00:00 0 [stack:1439]
    7fe046b06000-7fe047306000 rw-p 00000000 00:00 0 [stack:1438]
    7fff4b16f000-7fff4b190000 rw-p 00000000 00:00 0 [stack]

    However perf only knew about the main thread's. Fix it.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1352273234-28912-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Currently only text (function) mapping was set, so that the kernel data
    addresses couldn't parsed correctly. Fix it.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1352273234-28912-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

06 Nov, 2012

2 commits

  • David reported that current perf report refused to run on a data file
    captured from a different machine because of objdump.

    Since the objdump tools won't be used unless annotation was requested,
    checking its presence at init time doesn't make sense.

    Reported-by: David Ahern
    Signed-off-by: Namhyung Kim
    Reviewed-by: David Ahern
    Tested-by: David Ahern
    Cc: Ingo Molnar
    Cc: Irina Tirdea
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351835406-15208-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Currently various hist browser functions receive 3 arguments for
    refreshing histogram but only used from a few places. Also it's only
    for perf top command so that it can be NULL for other (and probably
    most) cases. Pack them into a struct in order to reduce number of those
    unused arguments.

    This is a mechanical change and does not intend a functional change.

    Signed-off-by: Namhyung Kim
    Tested-by: David Ahern
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Irina Tirdea
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351835406-15208-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

01 Nov, 2012

1 commit

  • Separating test objects into 'tests' directory.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351634526-1516-3-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

31 Oct, 2012

4 commits

  • So that the browser still shows the abort label.

    Signed-off-by: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1351643663-23828-18-git-send-email-andi@firstfloor.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Andi Kleen
     
  • If git is installed we'll have a 'perf --version' output of this form:

    $ make -j8 -C tools/perf/ O=/home/acme/git/build/perf install
    $ perf --version
    perf version 3.7.rc3.g3afad6

    Now on a machine without git installed:

    $ mv /home/acme/bin/git /home/acme/bin/git.OFF
    $ make -j8 -C tools/perf/ O=/home/acme/git/build/perf install
    $ perf --version
    perf version 3.7.0-rc2

    That is, no error message due to git not being installed will appear on the
    screen and instead the version string in the top level Makefile will be
    used.

    Requested-by: Ingo Molnar
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-am6yp6phvxyjmyndxogpunjv@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • There's another source of overhead in the perf version string generator:

    git update-index -q --refresh

    ... which will iterate the whole checked out tree. This can be pretty
    slow on NFS volumes, but takes some time even with local SSD disks and a
    fully cached kernel tree:

    $ perf stat --null --repeat 3 --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty

    Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

    0.306999221 seconds time elapsed ( +- 0.56% )

    So remove the .dirty differentiator as well - it adds little information
    because locally patched git trees are common, but seldom are the perf
    tools modified.

    So a lot of version strings are reported as 'dirty' while in fact they
    are pristine perf builds. For example 99% of my perf builds are not
    patched but the kernel tree is slightly patched, which adds the .dirty
    tag.

    Eliminating that tag speeds up version generation by another order of
    magnitude:

    $ perf stat --null --repeat 3 --sync --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
    PERF_VERSION = 3.7.rc3.g4b0bd3
    PERF_VERSION = 3.7.rc3.g4b0bd3
    PERF_VERSION = 3.7.rc3.g4b0bd3

    Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

    0.021270923 seconds time elapsed ( +- 1.94% )

    (Also clean up some of the comments around this code.)

    Signed-off-by: Ingo Molnar
    Cc: Andrew Vagin
    Cc: Borislav Petkov
    Cc: David Howells
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20121030085441.GC8245@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     
  • Building perf is pretty slow on trees that have a lot of commits
    relative to the nearest Git tag. This slowness manifests itself during
    version string generation:

    $ perf stat --null --repeat 3 --sync --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
    PERF_VERSION = 3.7.rc3.1458.g5399b3b
    PERF_VERSION = 3.7.rc3.1458.g5399b3b
    PERF_VERSION = 3.7.rc3.1458.g5399b3b

    Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

    2.857503976 seconds time elapsed ( +- 0.22% )

    The build can be even slower than that, when one over NFS volumes.

    The reason for the slowness is that util/PERF-VERSION-GEN uses "git
    describe" to generate the string, which has to count the "number of
    commits distance" from the nearest tag - the ".1458." count in the
    output above. For that Git had to extract and decompress 1458 Git
    objects, which takes time and bandwidth.

    But this "number of commits" value is mostly irrelevant in practice. We
    either want to know an approximate tag name, or we want to know the
    precise sha1.

    So this patch simplifies the version string to:

    PERF_VERSION = 3.7.rc3.g5399b3b.dirty

    which speeds up the version string generation script by an order of
    magnitude:

    $ perf stat --null --repeat 3 --sync --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty
    PERF_VERSION = 3.7.rc3.g5399b3b.dirty

    Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

    0.307633559 seconds time elapsed ( +- 0.84% )

    Signed-off-by: Ingo Molnar
    Cc: Andrew Vagin
    Cc: Borislav Petkov
    Cc: David Howells
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20121030084600.GB8245@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

30 Oct, 2012

2 commits

  • This was found during chasing down the header output regression. The
    strbuf_addf() was checking buffer length with a result of vscnprintf()
    which cannot be greater than that of strbuf_avail().

    Since numa topology and pmu mapping info in header were converted to use
    strbuf, it sometimes caused uninteresting behaviors with the broken
    strbuf.

    Fix it by using vsnprintf() which returns desired output string length
    regardless of the available buffer size and grow the buffer if needed.

    Reported-by: Andrew Jones
    Tested-by: Andrew Jones
    Signed-off-by: Namhyung Kim
    Cc: Andrew Jones
    Link: http://lkml.kernel.org/r/1350999890-6920-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Andrew reported that the commit 7e94cfcc9d20 ("perf header: Use pre-
    processed session env when printing") regresses the header output. It
    was because of a missed string pointer calculation in the loop.

    Reported-by: Andrew Jones
    Tested-by: Andrew Jones
    Signed-off-by: Namhyung Kim
    Cc: Andrew Jones
    Link: http://lkml.kernel.org/r/1350999890-6920-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

29 Oct, 2012

6 commits

  • The commit 0c1fe6b:

    'perf tools: Have the page size value available for all tools'

    Broke the python binding because the global variable 'page_size' is
    initialized on the main() routine, that is not called when using
    just the python binding, causing evlist.mmap() to fail because it
    expects that variable to be initialized to the system's page size.

    Fix it by initializing it on the binding init routine.

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

    Arnaldo Carvalho de Melo
     
  • With this function, other modules can basically check whether a file is
    a legal perf data file by checking its first 8 bytes against all
    possible perf magic numbers.

    Change the function name from check_perf_magic to more meaningful
    is_perf_magic as suggested by acme.

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351569369-26732-7-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     
  • Create a script browser, so that user can check all the available
    scripts for current perf data file and run them inside the main perf
    report or annotation browsers, for all perf samples or for samples
    belong to one thread/symbol.

    Please be noted: current script browser is only for report use, and
    doesn't cover the record phase, IOW it must run against one existing
    perf data file.

    The work flow is, users can use function key to list all the available
    scripts for current perf data file in system and chose one, which will
    be executed with popen("perf script -s xxx.xx",) and all the output
    lines are put into one ui browser, pressing 'q' or left arrow key will
    make it return to previous browser.

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351569369-26732-4-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     
  • Moving dso_* related functions into dso object.

    Keeping symbol loading related functions still in the symbol object as
    it seems more convenient.

    Signed-off-by: Jiri Olsa
    Reviewed-by: Namhyung Kim
    Tested-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351372712-21104-6-git-send-email-jolsa@redhat.com
    [ committer note: Use "symbol.h" instead of to make it build with O= ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Moving strxfrchar function into string object.

    Signed-off-by: Jiri Olsa
    Reviewed-by: Namhyung Kim
    Tested-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351372712-21104-5-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Moving hex2u64 function into util object.

    Signed-off-by: Jiri Olsa
    Reviewed-by: Namhyung Kim
    Tested-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351372712-21104-4-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa