From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759542AbcJTPFG (ORCPT ); Thu, 20 Oct 2016 11:05:06 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:34173 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757686AbcJTPEw (ORCPT ); Thu, 20 Oct 2016 11:04:52 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Linux Weekly News , Jiri Olsa , Andi Kleen , David Ahern , Don Zickus , Joe Mario , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 40/52] perf c2c report: Add c2c related stats stdio output Date: Thu, 20 Oct 2016 12:04:24 -0300 Message-Id: <1476975876-2522-41-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476975876-2522-1-git-send-email-acme@kernel.org> References: <1476975876-2522-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa Display c2c related configuration options/setup. So far it's output of monitored events: $ perf c2c report --stats ... ================================================= c2c details ================================================= Events : cpu/mem-loads,ldlat=50/pp : cpu/mem-stores/pp Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-ypz84f3a9fumyttrxurm458z@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 7bbb969f284a..c36d1dc668ac 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -13,6 +13,8 @@ #include "tool.h" #include "data.h" #include "sort.h" +#include "evlist.h" +#include "evsel.h" #include #include "ui/browsers/hists.h" @@ -1893,13 +1895,32 @@ static void print_pareto(FILE *out) } } -static void perf_c2c__hists_fprintf(FILE *out) +static void print_c2c_info(FILE *out, struct perf_session *session) +{ + struct perf_evlist *evlist = session->evlist; + struct perf_evsel *evsel; + bool first = true; + + fprintf(out, "=================================================\n"); + fprintf(out, " c2c details \n"); + fprintf(out, "=================================================\n"); + + evlist__for_each_entry(evlist, evsel) { + fprintf(out, "%-36s: %s\n", first ? " Events" : "", + perf_evsel__name(evsel)); + first = false; + } +} + +static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session) { setup_pager(); print_c2c__display_stats(out); fprintf(out, "\n"); print_shared_cacheline_info(out); + fprintf(out, "\n"); + print_c2c_info(out, session); if (c2c.stats_only) return; @@ -2073,18 +2094,18 @@ static int perf_c2c__hists_browse(struct hists *hists) return 0; } -static void perf_c2c_display(void) +static void perf_c2c_display(struct perf_session *session) { if (c2c.use_stdio) - perf_c2c__hists_fprintf(stdout); + perf_c2c__hists_fprintf(stdout, session); else perf_c2c__hists_browse(&c2c.hists.hists); } #else -static void perf_c2c_display(void) +static void perf_c2c_display(struct perf_session *session) { use_browser = 0; - perf_c2c__hists_fprintf(stdout); + perf_c2c__hists_fprintf(stdout, session); } #endif /* HAVE_SLANG_SUPPORT */ @@ -2197,7 +2218,7 @@ static int perf_c2c__report(int argc, const char **argv) ui_quirks(); - perf_c2c_display(); + perf_c2c_display(session); out_session: perf_session__delete(session); -- 2.7.4