From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbbJCHtT (ORCPT ); Sat, 3 Oct 2015 03:49:19 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59100 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712AbbJCHtP (ORCPT ); Sat, 3 Oct 2015 03:49:15 -0400 Date: Sat, 3 Oct 2015 00:48:59 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, namhyung@kernel.org, a.p.zijlstra@chello.nl, acme@redhat.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, tglx@linutronix.de Reply-To: hpa@zytor.com, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, jolsa@redhat.com, dsahern@gmail.com, tglx@linutronix.de In-Reply-To: <1443577526-3240-2-git-send-email-namhyung@kernel.org> References: <1443577526-3240-2-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Fix unresolved comm when -s comm is used Git-Commit-ID: 4b37af595742977f1bdd8c0fd0f3e6e55b36e7b7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4b37af595742977f1bdd8c0fd0f3e6e55b36e7b7 Gitweb: http://git.kernel.org/tip/4b37af595742977f1bdd8c0fd0f3e6e55b36e7b7 Author: Namhyung Kim AuthorDate: Wed, 30 Sep 2015 10:45:25 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 1 Oct 2015 09:54:33 -0300 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 --- tools/perf/builtin-top.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 38d4d6c..ae4c642 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; }