Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752217AbaBGBkb (ORCPT ); Thu, 6 Feb 2014 20:40:31 -0500 Received: from lgeamrelo01.lge.com ([156.147.1.125]:50477 "EHLO LGEAMRELO01.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbaBGBfp (ORCPT ); Thu, 6 Feb 2014 20:35:45 -0500 X-AuditID: 9c93017d-b7b1fae00000636d-c0-52f4386e7756 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Paul Mackerras , Namhyung Kim , LKML , Arun Sharma , Frederic Weisbecker , Rodrigo Campos , Andi Kleen , David Ahern , Jiri Olsa Subject: [PATCH 14/21] perf tools: Add more hpp helper functions Date: Fri, 7 Feb 2014 10:35:16 +0900 Message-Id: <1391736923-30765-15-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1391736923-30765-1-git-send-email-namhyung@kernel.org> References: <1391736923-30765-1-git-send-email-namhyung@kernel.org> X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes it needs to disable some columns at runtime. Add help functions to support that. Cc: Jiri Olsa Tested-by: Arun Sharma Cc: Frederic Weisbecker Signed-off-by: Namhyung Kim --- tools/perf/ui/hist.c | 17 +++++++++++++++++ tools/perf/util/hist.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index eb9c07bcdb01..1f9e25211da2 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -275,12 +275,29 @@ void perf_hpp__column_register(struct perf_hpp_fmt *format) list_add_tail(&format->list, &perf_hpp__list); } +void perf_hpp__column_unregister(struct perf_hpp_fmt *format) +{ + list_del(&format->list); +} + void perf_hpp__column_enable(unsigned col) { BUG_ON(col >= PERF_HPP__MAX_INDEX); perf_hpp__column_register(&perf_hpp__format[col]); } +void perf_hpp__column_disable(unsigned col) +{ + BUG_ON(col >= PERF_HPP__MAX_INDEX); + perf_hpp__column_unregister(&perf_hpp__format[col]); +} + +void perf_hpp__cancel_cumulate(void) +{ + perf_hpp__column_disable(PERF_HPP__OVERHEAD_ACC); + perf_hpp__format[PERF_HPP__OVERHEAD].header = hpp__header_overhead; +} + int hist_entry__sort_snprintf(struct hist_entry *he, char *s, size_t size, struct hists *hists) { diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 60e2ef2a4c6e..a02342141db9 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -201,7 +201,10 @@ enum { void perf_hpp__init(void); void perf_hpp__column_register(struct perf_hpp_fmt *format); +void perf_hpp__column_unregister(struct perf_hpp_fmt *format); void perf_hpp__column_enable(unsigned col); +void perf_hpp__column_disable(unsigned col); +void perf_hpp__cancel_cumulate(void); static inline size_t perf_hpp__use_color(void) { -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/