Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758093AbaFANge (ORCPT ); Sun, 1 Jun 2014 09:36:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4142 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757546AbaFANcI (ORCPT ); Sun, 1 Jun 2014 09:32:08 -0400 From: Jiri Olsa To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Namhyung Kim , Frederic Weisbecker , Jiri Olsa Subject: [PATCH 14/27] perf tools: Add more hpp helper functions Date: Sun, 1 Jun 2014 15:31:25 +0200 Message-Id: <1401629498-8726-15-git-send-email-jolsa@kernel.org> In-Reply-To: <1401629498-8726-1-git-send-email-jolsa@kernel.org> References: <1401629498-8726-1-git-send-email-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim Sometimes it needs to disable some columns at runtime. Add help functions to support that. Signed-off-by: Namhyung Kim Tested-by: Arun Sharma Tested-by: Rodrigo Campos Cc: Frederic Weisbecker Link: http://lkml.kernel.org/r/1401335910-16832-15-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa --- tools/perf/ui/hist.c | 17 +++++++++++++++++ tools/perf/util/hist.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 0ce3e79..8ca6387 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -489,6 +489,11 @@ 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__register_sort_field(struct perf_hpp_fmt *format) { list_add_tail(&format->sort_list, &perf_hpp__sort_list); @@ -500,6 +505,18 @@ void perf_hpp__column_enable(unsigned col) 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; +} + void perf_hpp__setup_output_field(void) { struct perf_hpp_fmt *fmt; diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index efd73e4..99ad3cb 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -237,7 +237,11 @@ 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); + void perf_hpp__register_sort_field(struct perf_hpp_fmt *format); void perf_hpp__setup_output_field(void); void perf_hpp__reset_output_field(void); -- 1.8.3.1 -- 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/