From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbbI3B7O (ORCPT ); Tue, 29 Sep 2015 21:59:14 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:33053 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbbI3B7J (ORCPT ); Tue, 29 Sep 2015 21:59:09 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: [PATCH 2/3] perf top: Fix unresolved comm when -s comm is used Date: Wed, 30 Sep 2015 10:45:25 +0900 Message-Id: <1443577526-3240-2-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1443577526-3240-1-git-send-email-namhyung@kernel.org> References: <1443577526-3240-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 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; } -- 2.5.0