From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751095AbdCMIif (ORCPT ); Mon, 13 Mar 2017 04:38:35 -0400 Received: from mga06.intel.com ([134.134.136.31]:21458 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbdCMIic (ORCPT ); Mon, 13 Mar 2017 04:38:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,158,1486454400"; d="scan'208";a="74712818" From: changbin.du@intel.com To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org Cc: linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH] perf sort: only insert overhead && overhead_children when no overhead* field given Date: Mon, 13 Mar 2017 16:36:01 +0800 Message-Id: <20170313083601.24465-1-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changbin Du If we always insert 'overhead' and 'overhead_children' as sort keys, this make it impossible to sort as overhead (which displayed as Self) first. This patch forbid adding any overhead* field if there is one already given. Signed-off-by: Changbin Du --- tools/perf/util/sort.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index b6db140..7695b54 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -2543,6 +2543,13 @@ static char *setup_overhead(char *keys) if (sort__mode == SORT_MODE__DIFF) return keys; + /* + * Only insert overhead && overhead_children when + * no overhead* field given. + */ + if (strstr(keys, "overhead")) + return keys; + keys = prefix_if_not_in("overhead", keys); if (symbol_conf.cumulate_callchain) -- 2.7.4