lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/28] perf tools: Update cpumode for each cumulative entry
    Date
    The cpumode and level in struct addr_localtion was set for a sample
    and but updated as cumulative callchains were added. This led to have
    non-matching symbol and cpumode in the output.

    Update it accordingly based on the fact whether the map is a part of
    the kernel or not. This is a reverse of what thread__find_addr_map()
    does.

    Cc: Arun Sharma <asharma@fb.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
    ---
    tools/perf/builtin-report.c | 30 ++++++++++++++++++++++++++++--
    1 file changed, 28 insertions(+), 2 deletions(-)

    diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
    index 27e477df0730..06330736485b 100644
    --- a/tools/perf/builtin-report.c
    +++ b/tools/perf/builtin-report.c
    @@ -401,9 +401,35 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter,
    else
    al->addr = node->ip;

    - if (iter->rep->hide_unresolved && al->sym == NULL)
    - return 0;
    + if (al->sym == NULL) {
    + if (iter->rep->hide_unresolved)
    + return 0;
    + if (al->map == NULL)
    + goto out;
    + }
    +
    + if (al->map->groups == &iter->machine->kmaps) {
    + if (machine__is_host(iter->machine)) {
    + al->cpumode = PERF_RECORD_MISC_KERNEL;
    + al->level = 'k';
    + } else {
    + al->cpumode = PERF_RECORD_MISC_GUEST_KERNEL;
    + al->level = 'g';
    + }
    + } else {
    + if (machine__is_host(iter->machine)) {
    + al->cpumode = PERF_RECORD_MISC_USER;
    + al->level = '.';
    + } else if (perf_guest) {
    + al->cpumode = PERF_RECORD_MISC_GUEST_USER;
    + al->level = 'u';
    + } else {
    + al->cpumode = PERF_RECORD_MISC_HYPERVISOR;
    + al->level = 'H';
    + }
    + }

    +out:
    callchain_cursor_advance(&callchain_cursor);
    return 1;
    }
    --
    1.7.11.7


    \
     
     \ /
      Last update: 2014-01-08 10:41    [W:4.076 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site