From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934991AbcIVPjE (ORCPT ); Thu, 22 Sep 2016 11:39:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54068 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933655AbcIVPi6 (ORCPT ); Thu, 22 Sep 2016 11:38:58 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: [PATCH 40/57] perf c2c report: Setup number of header lines for hists Date: Thu, 22 Sep 2016 17:37:08 +0200 Message-Id: <1474558645-19956-41-git-send-email-jolsa@kernel.org> In-Reply-To: <1474558645-19956-1-git-send-email-jolsa@kernel.org> References: <1474558645-19956-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 22 Sep 2016 15:38:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow to setup number of header lines for c2c hists objects. Link: http://lkml.kernel.org/n/tip-4ilsf0ulubrd4y96g7tnpwzk@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-c2c.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 8fb798c8a790..e281930e57da 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -100,11 +100,13 @@ static struct hist_entry_ops c2c_entry_ops = { }; static int c2c_hists__init(struct c2c_hists *hists, - const char *sort); + const char *sort, + int nr_header_lines); static struct c2c_hists* he__get_c2c_hists(struct hist_entry *he, - const char *sort) + const char *sort, + int nr_header_lines) { struct c2c_hist_entry *c2c_he; struct c2c_hists *hists; @@ -118,7 +120,7 @@ he__get_c2c_hists(struct hist_entry *he, if (!hists) return NULL; - ret = c2c_hists__init(hists, sort); + ret = c2c_hists__init(hists, sort, nr_header_lines); if (ret) free(hists); @@ -212,7 +214,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, if (!mi_dup) goto free_mi; - c2c_hists = he__get_c2c_hists(he, "offset"); + c2c_hists = he__get_c2c_hists(he, "offset", 2); if (!c2c_hists) goto free_mi_dup; @@ -1588,7 +1590,8 @@ static int hpp_list__parse(struct perf_hpp_list *hpp_list, } static int c2c_hists__init(struct c2c_hists *hists, - const char *sort) + const char *sort, + int nr_header_lines) { __hists__init(&hists->hists, &hists->list); @@ -1599,6 +1602,9 @@ static int c2c_hists__init(struct c2c_hists *hists, */ perf_hpp_list__init(&hists->list); + /* Overload number of header lines.*/ + hists->list.nr_header_lines = nr_header_lines; + return hpp_list__parse(&hists->list, NULL, sort); } @@ -1727,7 +1733,7 @@ static int perf_c2c__report(int argc, const char **argv) file.path = input_name; - err = c2c_hists__init(&c2c.hists, "dcacheline"); + err = c2c_hists__init(&c2c.hists, "dcacheline", 2); if (err) { pr_debug("Failed to initialize hists\n"); goto out; -- 2.7.4