From: Namhyung Kim Date: Wed, 30 Sep 2015 01:45:25 +0000 (+0900) Subject: perf top: Fix unresolved comm when -s comm is used X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b37af595742977f1bdd8c0fd0f3e6e55b36e7b7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf top: Fix unresolved comm when -s comm is used The perf top uses 'dso,symbol' sort keys by default so it overlooked a problem in task's comm resolving. When the sort key contains 'comm', some task's comm is not shown properly. This is because the perf_top__mmap_read_idx() checks the cpumode value improperly. The cpumode value of non-sample events are 0 (PERF_RECORD_MISC_CPUMODE_ UNKNOWN) so the events will be ignored by the switch statement. This patch allows it for non-sample events. Signed-off-by: Namhyung Kim Cc: David Ahern Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1443577526-3240-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 38d4d6cac823..ae4c6420300b 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -857,9 +857,12 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx) * TODO: we don't process guest user from host side * except simple counting. */ - /* Fall thru */ - default: goto next_event; + default: + if (event->header.type == PERF_RECORD_SAMPLE) + goto next_event; + machine = &session->machines.host; + break; }