From: tip-bot for Andi Kleen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, jolsa@kernel.org, ak@linux.intel.com,
hpa@zytor.com
Subject: [tip:perf/core] perf evsel: Support printing evsel name for 'duration_time'
Date: Fri, 5 Apr 2019 04:39:57 -0700 [thread overview]
Message-ID: <tip-3371f389e4be6efc496ca395b21911a8f2c2d23f@git.kernel.org> (raw)
In-Reply-To: <20190326221823.11518-4-andi@firstfloor.org>
Commit-ID: 3371f389e4be6efc496ca395b21911a8f2c2d23f
Gitweb: https://git.kernel.org/tip/3371f389e4be6efc496ca395b21911a8f2c2d23f
Author: Andi Kleen <ak@linux.intel.com>
AuthorDate: Tue, 26 Mar 2019 15:18:22 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 1 Apr 2019 14:49:24 -0300
perf evsel: Support printing evsel name for 'duration_time'
Implement printing the correct name for duration_time
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190326221823.11518-4-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 66d066f18b5b..84cfb9fe2fc6 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -580,6 +580,12 @@ static int perf_evsel__raw_name(struct perf_evsel *evsel, char *bf, size_t size)
return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret);
}
+static int perf_evsel__tool_name(char *bf, size_t size)
+{
+ int ret = scnprintf(bf, size, "duration_time");
+ return ret;
+}
+
const char *perf_evsel__name(struct perf_evsel *evsel)
{
char bf[128];
@@ -601,7 +607,10 @@ const char *perf_evsel__name(struct perf_evsel *evsel)
break;
case PERF_TYPE_SOFTWARE:
- perf_evsel__sw_name(evsel, bf, sizeof(bf));
+ if (evsel->tool_event)
+ perf_evsel__tool_name(bf, sizeof(bf));
+ else
+ perf_evsel__sw_name(evsel, bf, sizeof(bf));
break;
case PERF_TYPE_TRACEPOINT:
next prev parent reply other threads:[~2019-04-05 11:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 22:18 perf: Add duration_time to perf stat Andi Kleen
2019-03-26 22:18 ` [PATCH 1/4] perf, tools: Revert checks for duration_time Andi Kleen
2019-04-05 11:38 ` [tip:perf/core] perf stat: " tip-bot for Andi Kleen
2019-03-26 22:18 ` [PATCH 2/4] perf, tools: Implement duration_time as a proper event Andi Kleen
2019-03-27 8:58 ` Jiri Olsa
2019-03-27 13:54 ` Andi Kleen
2019-04-05 11:39 ` [tip:perf/core] perf stat: " tip-bot for Andi Kleen
2019-03-26 22:18 ` [PATCH 3/4] perf, tools: Support name for duration_time Andi Kleen
2019-04-05 11:39 ` tip-bot for Andi Kleen [this message]
2019-03-26 22:18 ` [PATCH 4/4] perf, tools, list: Output tool events Andi Kleen
2019-04-05 11:40 ` [tip:perf/core] perf " tip-bot for Andi Kleen
2019-03-27 19:51 ` perf: Add duration_time to perf stat Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-3371f389e4be6efc496ca395b21911a8f2c2d23f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox