From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965129AbcBDMfv (ORCPT ); Thu, 4 Feb 2016 07:35:51 -0500 Received: from terminus.zytor.com ([198.137.202.10]:41696 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964835AbcBDMft (ORCPT ); Thu, 4 Feb 2016 07:35:49 -0500 Date: Thu, 4 Feb 2016 04:35:34 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, dsahern@gmail.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, mingo@kernel.org, acme@redhat.com Reply-To: acme@redhat.com, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org, dsahern@gmail.com, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <1453109064-1026-8-git-send-email-jolsa@kernel.org> References: <1453109064-1026-8-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists: Make hpp setup function generic Git-Commit-ID: 3f931f2c4274565fd6c6a642b16387358cbe6266 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: 3f931f2c4274565fd6c6a642b16387358cbe6266 Gitweb: http://git.kernel.org/tip/3f931f2c4274565fd6c6a642b16387358cbe6266 Author: Jiri Olsa AuthorDate: Mon, 18 Jan 2016 10:24:05 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 3 Feb 2016 12:24:02 -0300 perf hists: Make hpp setup function generic Now that we have the 'equal' method implemented for hpp format entries we can ease up the logic in the following functions and make them generic wrt comparing format entries: perf_hpp__setup_output_field perf_hpp__append_sort_keys Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1453109064-1026-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/hist.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index b543f4b..b0fcaec 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -551,21 +551,11 @@ void perf_hpp__setup_output_field(void) /* append sort keys to output field */ perf_hpp__for_each_sort_list(fmt) { - if (!list_empty(&fmt->list)) - continue; + struct perf_hpp_fmt *pos; - /* - * sort entry fields are dynamically created, - * so they can share a same sort key even though - * the list is empty. - */ - if (perf_hpp__is_sort_entry(fmt)) { - struct perf_hpp_fmt *pos; - - perf_hpp__for_each_format(pos) { - if (fmt_equal(fmt, pos)) - goto next; - } + perf_hpp__for_each_format(pos) { + if (fmt_equal(fmt, pos)) + goto next; } perf_hpp__column_register(fmt); @@ -580,21 +570,11 @@ void perf_hpp__append_sort_keys(void) /* append output fields to sort keys */ perf_hpp__for_each_format(fmt) { - if (!list_empty(&fmt->sort_list)) - continue; + struct perf_hpp_fmt *pos; - /* - * sort entry fields are dynamically created, - * so they can share a same sort key even though - * the list is empty. - */ - if (perf_hpp__is_sort_entry(fmt)) { - struct perf_hpp_fmt *pos; - - perf_hpp__for_each_sort_list(pos) { - if (fmt_equal(fmt, pos)) - goto next; - } + perf_hpp__for_each_sort_list(pos) { + if (fmt_equal(fmt, pos)) + goto next; } perf_hpp__register_sort_field(fmt);