08 Jan, 2012

1 commit

  • When a user tries to open so many events, perf_event_open syscall may
    fail with EMFILE. Provide advise for that case.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1325957132-10600-3-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

07 Jan, 2012

1 commit

  • It will be recalculated at __hists__output_resort, to take into account
    filters possibly applied by the TUI, etc.

    Since we do the percent math only for those entries that will appear on
    the TUI instead of for _all_ the entries at decay time, updating it for
    each sample makes the entries seem to decay faster when using the
    navigation keys (since the screen will be refreshed), as we're not
    coalescing the entries that are being batched to be merged at next
    resort/decay time, but considering their periods.

    Bug introduced in 743eb86.

    Reported-by: Ingo Molnar
    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-k0d0rq9a8nqtkqohov8cir72@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

04 Jan, 2012

1 commit

  • The 'buf' should be freed when symbol wasn't found too.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1325000151-4463-3-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

29 Nov, 2011

1 commit

  • At first tools were required to do that, but while writing the python
    bindings to simplify the API I made them auto-allocate when needed.

    This just makes record, stat and top use that auto allocation,
    simplifying them a bit.

    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-iokhcvkzzijr3keioubx8hlq@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Nov, 2011

6 commits

  • Use its 'perf_tool' base class instead.

    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-i33q40wwvk2zna8fd36ex6sm@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To better reflect that it became the base class for all tools, that must
    be in each tool struct and where common stuff will be put.

    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-qgpc4msetqlwr8y2k7537cxe@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Reducing the exposure of perf_session further, so that we can use the
    classes in cases where no perf.data file is created.

    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-stua66dcscsezzrcdugvbmvd@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that we don't need to have that many globals.

    Next steps will remove the 'session' pointer, that in most cases is
    not needed.

    Then we can rename perf_event_ops to 'perf_tool' that better describes
    this class hierarchy.

    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-wp4djox7x6w1i2bab1pt4xxp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since we have it in evsel->hists.callchain_cursor, remove it from
    perf_session.

    One more step in disentangling several places from requiring a
    perf_session pointer.

    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-rxr5dj3di7ckyfmnz0naku1z@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since symbol__alloc_hists need it, to avoid passing it around in many
    functions have it in the symbol_conf struct.

    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-cwv8ysvpywzjq4v3xtbd4zwv@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

03 Nov, 2011

1 commit

  • In the old --stdio interface the annotation is done just after one
    selects a symbol, while in --tui, now the default when the required libs
    are installed, we annotate all symbols with samples so that when
    annotation is asked we see what happened recently on that symbol.

    To achieve that the --stdio variant checks if the hist_entry being
    processed is the one selected by the user via the 's' hotkey. What
    happens now that we share the hist_entry abstractions with 'perf report'
    is that for minimizing locking contention multiple rb_trees are used,
    one for collecting the samples and other to browse/show them after
    resorting it by number of samples and decay them, which is done
    periodically.

    So the simple test in record_precise_ip doesn't work as we move
    hist_entries between those rb_trees. To fix it just check that the
    underlying struct symbol associated with those hist_entries is the same.

    Reported-by: Mike Galbraith
    Tested-by: Mike Galbraith
    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-bcfnraqkux88fox9ba9767ds@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

02 Nov, 2011

2 commits

  • It makes sense for the stdio where we can't navigate to the other pages.

    On the TUI it breaks as soon as we navigate to other pages that have,
    DSOs with longer names than the ones on the first page.

    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-zvqfp18mw229agb43cikgb0k@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Just like the old perf top --tui and the --stdio version.

    But because we have the initial menu to choose which event to show in a
    session with multiple events we can see how many chunks were lost in
    each of the event types, clarifying which events are being affected the
    most.

    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-47yyqbubmjzch2chezmb21m6@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

26 Oct, 2011

2 commits

  • As it will exit the tool after the user is notified.

    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-vy06m8xzlvkhr8tk7nylhbng@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The __perf_evsel__open routing was grouping just the threads for that
    specific events per cpu when we want to group all threads in all events
    to the first fd opened on that cpu.

    So pass the xyarray with the first event, where the other events will be
    able to get that first per cpu fd.

    At some point top and record will switch to using perf_evlist__open that
    takes care of this detail and probably will also handle the fallback
    from hw to soft counters, etc.

    Reported-by: Deng-Cheng Zhu
    Tested-by: Deng-Cheng Zhu
    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-ebm34rh098i9y9v4cytfdp0x@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

17 Oct, 2011

2 commits

  • We were not recognizing 'E' as a hotkey due to a bug introduced when
    switching to the new, hist_entry based top. Fix it by returning that 'E'
    is mapped if evlist->nr_entries > 1.

    Reported-by: Mike Galbraith
    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-zcx055vnhagddvqlaqxvdhtb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The new decay routine (__hists__decay_entries) wasn't being passed the
    toggles, fix it.

    Reported-by: Mike Galbraith
    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-hg6m0mi1colket982oq9hhly@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

13 Oct, 2011

2 commits

  • We were removing only when using a --sort order that needs collapsing,
    while we also use it in the threaded case, causing memory corruption
    because we were scribbling freed hist entries, oops.

    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-k16fb4jsulr7x0ixv43amb6d@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To do that we needed to stop using newtForm, as we don't want libnewt to
    catch the xterm resize signal.

    Remove some more newt calls and instead use the underlying libslang
    directly. In time tools/perf will use just libslang.

    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-h1824yjiru5n2ivz4bseizwj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

08 Oct, 2011

4 commits

  • And add the annotation output knobs to all the tools that have
    integrated annotation (top, report).

    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-gnlob67mke6sji2kf4nstp7m@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To disable it either:

    1. Make sure newt-devel is not installed when building it

    2. Use 'perf top --stdio' just like with report

    3. Edit your ~/.perfconfig or system wide config and have this there:

    [tui]

    top = off

    But you shouldn't, since the TUI is so much more powerful, has
    integration with annotation and where lots more interesting features
    will be developed, so if something annoys you (the colors?) just let me
    know and I'll do my best to make it pleasant as a default.

    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-cy2tn4uj1t7c3aqss5l25of5@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Just like in 'perf report', but live.

    Still needs to decay the callchains, but already somewhat useful as-is.

    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-cj3rmaf5jpsvi3v0tf7t4uvp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • This actually fixes several problems we had in the old 'perf top':

    1. Unresolved symbols not show, limitation that came from the old
    "KernelTop" codebase, to solve it we would need to do changes
    that would make sym_entry have most of the hist_entry fields.
    2. It was using the number of samples, not the sum of sample->period.

    And brings the --sort code that allows us to have all the views in
    'perf report', for instance:

    [root@emilia ~]# perf top --sort dso
    PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
    ------------------------------------------------------------------------------

    31.59% libcrypto.so.1.0.0
    21.55% [kernel]
    18.57% libpython2.6.so.1.0
    7.04% libc-2.12.so
    6.99% _backend_agg.so
    4.72% sshd
    1.48% multiarray.so
    1.39% libfreetype.so.6.3.22
    1.37% perf
    0.71% libgobject-2.0.so.0.2200.5
    0.53% [tg3]
    0.48% libglib-2.0.so.0.2200.5
    0.44% libstdc++.so.6.0.13
    0.40% libcairo.so.2.10800.8
    0.38% libm-2.12.so
    0.34% umath.so
    0.30% libgdk-x11-2.0.so.0.1800.9
    0.22% libpthread-2.12.so
    0.20% libgtk-x11-2.0.so.0.1800.9
    0.20% librt-2.12.so
    0.15% _path.so
    0.13% libpango-1.0.so.0.2800.1
    0.11% libatlas.so.3.0
    0.09% ft2font.so
    0.09% libpangoft2-1.0.so.0.2800.1
    0.08% libX11.so.6.3.0
    0.07% [vdso]
    0.06% cyclictest
    ^C

    All the filter lists can be used as well: --dsos, --comms, --symbols,
    etc.

    The 'perf report' TUI is also reused, being possible to apply all the
    zoom operations, do annotation, etc.

    This change will allow multiple simplifications in the symbol system as
    well, that will be detailed in upcoming changesets.

    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-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

06 Oct, 2011

1 commit


30 Sep, 2011

1 commit

  • Now it warns everytime that new events are lost.

    And the TUI also warns now.

    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-w1n168yrvrppnq6887s4u0wx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

24 Sep, 2011

1 commit

  • The 'perf top' tool came from the kernel where we had each DSO (vmlinux,
    modules) loaded just once at a time.

    But userspace may have DSOs loaded in multiple addresses (shared
    libraries), requiring that we use the just resolved map instead of the
    first one found.

    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-ag53wz0yllpgers0n2w7hchp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

21 Jul, 2011

1 commit

  • 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
     

28 May, 2011

3 commits

  • We now just warn the user about the fact and go on providing just
    userspace samples.

    This fixes a problem when no vmlinux is explicetely passed by the user,
    thus symbol_conf.vmlinux_name is NULL, no suitable vmlinux is found, and
    then we get:

    aldebaran:~> perf top -p 7557
    [kernel.kallsyms] with build id 44d9a989eabbd79e486bc079d6b743d397c204e0
    not found, continuing without symbols
    The (null) file can't be used

    Reported-by: Ingo Molnar
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/n/tip-cj2g81hn64wv2bipmqk4fy2m@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Reported-by: Ingo Molnar
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/n/tip-cyl5zmi1nu35vyu7l5im2pyv@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/n/tip-weqbs0tkk2u0qp1xxdxxosfg@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

22 May, 2011

2 commits


15 May, 2011

1 commit

  • The PERF_EVENT_IOC_SET_OUTPUT ioctl was returning -EINVAL when using
    --pid when monitoring multithreaded apps, as we can only share a ring
    buffer for events on the same thread if not doing per cpu.

    Fix it by using per thread ring buffers.

    Tested with:

    [root@felicio ~]# tuna -t 26131 -CP | nl
    1 thread ctxt_switches
    2 pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
    3 26131 OTHER 0 0,1 10814276 2397830 chromium-browse
    4 642 OTHER 0 0,1 14688 0 chromium-browse
    5 26148 OTHER 0 0,1 713602 115479 chromium-browse
    6 26149 OTHER 0 0,1 801958 2262 chromium-browse
    7 26150 OTHER 0 0,1 1271128 248 chromium-browse
    8 26151 OTHER 0 0,1 3 0 chromium-browse
    9 27049 OTHER 0 0,1 36796 9 chromium-browse
    10 618 OTHER 0 0,1 14711 0 chromium-browse
    11 661 OTHER 0 0,1 14593 0 chromium-browse
    12 29048 OTHER 0 0,1 28125 0 chromium-browse
    13 26143 OTHER 0 0,1 2202789 781 chromium-browse
    [root@felicio ~]#

    So 11 threads under pid 26131, then:

    [root@felicio ~]# perf record -F 50000 --pid 26131

    [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
    1 7fa4a2538000-7fa4a25b9000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    2 7fa4a25b9000-7fa4a263a000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    3 7fa4a263a000-7fa4a26bb000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    4 7fa4a26bb000-7fa4a273c000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    5 7fa4a273c000-7fa4a27bd000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    6 7fa4a27bd000-7fa4a283e000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    7 7fa4a283e000-7fa4a28bf000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    8 7fa4a28bf000-7fa4a2940000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    9 7fa4a2940000-7fa4a29c1000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    10 7fa4a29c1000-7fa4a2a42000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    11 7fa4a2a42000-7fa4a2ac3000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    [root@felicio ~]#

    11 mmaps, one per thread since we didn't specify any CPU list, so we need one
    mmap per thread and:

    [root@felicio ~]# perf record -F 50000 --pid 26131
    ^M
    ^C[ perf record: Woken up 79 times to write data ]
    [ perf record: Captured and wrote 20.614 MB perf.data (~900639 samples) ]

    [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
    1 371310 26131
    2 96516 26148
    3 95694 26149
    4 95203 26150
    5 7291 26143
    6 87 27049
    7 76 661
    8 60 29048
    9 47 618
    10 43 642
    [root@felicio ~]#

    Ok, one of the threads, 26151 was quiescent, so no samples there, but all the
    others are there.

    Then, if I specify one CPU:

    [root@felicio ~]# perf record -F 50000 --pid 26131 --cpu 1
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.680 MB perf.data (~29730 samples) ]

    [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
    1 8444 26131
    2 2584 26149
    3 2518 26148
    4 2324 26150
    5 123 26143
    6 9 661
    7 9 29048
    [root@felicio ~]#

    This machine has two cores, so fewer threads appeared on the radar, and:

    [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
    1 7f484b922000-7f484b9a3000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    [root@felicio ~]#

    Just one mmap, as now we can use just one per-cpu buffer instead of the
    per-thread needed in the previous case.

    For global profiling:

    [root@felicio ~]# perf record -F 50000 -a
    ^C[ perf record: Woken up 26 times to write data ]
    [ perf record: Captured and wrote 7.128 MB perf.data (~311412 samples) ]

    [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
    1 7fb49b435000-7fb49b4b6000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    2 7fb49b4b6000-7fb49b537000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    [root@felicio ~]#

    It uses per-cpu buffers.

    For just one thread:

    [root@felicio ~]# perf record -F 50000 --tid 26148
    ^C[ perf record: Woken up 2 times to write data ]
    [ perf record: Captured and wrote 0.330 MB perf.data (~14426 samples) ]

    [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
    1 9969 26148
    [root@felicio ~]#

    [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
    1 7f286a51b000-7f286a59c000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
    [root@felicio ~]#

    Tested-by: David Ahern
    Tested-by: Lin Ming
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/r/20110426204401.GB1746@ghostprotocols.net
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

15 Apr, 2011

1 commit

  • perf stat doesn't mmap and its perfectly fine for it to use task-bound
    counters with inheritance.

    So set the attr.inherit on the caller and leave the syscall itself to
    validate it.

    When the mmap fails perf_evlist__mmap will just emit a warning if this
    is the failure reason.

    Reported-by: Peter Zijlstra
    Acked-by: Peter Zijlstra
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/r/20110414170121.GC3229@ghostprotocols.net
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

30 Mar, 2011

2 commits

  • Resend of patch sent back in January 2011 in light of recent confusion around
    unsupported events for a given platform.

    Improve sys_perf_event_open ENOENT return handling in top and record, just
    like 5a3446b does for stat.

    Retry of Arnaldo's patch using ui_warning instead of die which allows the
    fallback from hardware cycles to software clock.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    LKML-Reference:
    Signed-off-by: David Ahern
    [ committer note: Some adjustments to make it apply to newer codebase ]
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • We have to deal with the TUI mode in perf top, so that we don't end up
    with a garbled screen when, say, a non root user on a machine with a
    paranoid setting (the default) tries to use 'perf top'.

    Introduce a ui__warning_paranoid() routine shared by top and record that
    tells the user the valid values for /proc/sys/kernel/perf_event_paranoid.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    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
     

23 Mar, 2011

1 commit

  • builtin-top.c has an uninitialized variable.
    gcc(version 4.5.1) warns about it and it results in build failure:

    builtin-top.c: In function 'display_thread':
    builtin-top.c:518:9: error: 'counter' may be used uninitialized

    This situation can indeed trigger, if the getline() call in
    prompt_integer() fails.

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

    Akihiro Nagai
     

12 Mar, 2011

3 commits

  • While going thru each of the sym_entry fields looking to reduce it to
    the set of entries needed when in an active symbols list, 'skip' should
    really be in symbol, as we set it when loading the symtab.

    And the space used by the basic symbol allocation remains the same as
    we had 5 bytes of padding.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    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
     
  • And the DSO__ORIG_ enum to SYMTAB__, to clarify that this is about from
    where the symtab was obtained.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    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
     
  • We can get it from syme->map->dso->kernel (that should be renamed to
    origin, but leave this for another patch).

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    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