From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941054AbcISNNl (ORCPT ); Mon, 19 Sep 2016 09:13:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21941 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940082AbcISNMN (ORCPT ); Mon, 19 Sep 2016 09:12:13 -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 50/61] perf c2c report: Add c2c related stats stdio output Date: Mon, 19 Sep 2016 15:09:59 +0200 Message-Id: <1474290610-23241-51-git-send-email-jolsa@kernel.org> In-Reply-To: <1474290610-23241-1-git-send-email-jolsa@kernel.org> References: <1474290610-23241-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.25]); Mon, 19 Sep 2016 13:12:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Link: http://lkml.kernel.org/n/tip-ypz84f3a9fumyttrxurm458z@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-c2c.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index e463da572207..f4bdef5004c9 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" @@ -1894,13 +1896,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; @@ -2183,7 +2204,7 @@ static int perf_c2c__report(int argc, const char **argv) ui_progress__finish(); if (c2c.use_stdio) - perf_c2c__hists_fprintf(stdout); + perf_c2c__hists_fprintf(stdout, session); else perf_c2c__hists_browse(&c2c.hists.hists); -- 2.7.4