linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/4] perf, tools: Support name for duration_time
Date: Tue, 26 Mar 2019 15:18:22 -0700	[thread overview]
Message-ID: <20190326221823.11518-4-andi@firstfloor.org> (raw)
In-Reply-To: <20190326221823.11518-1-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

Implement printing the correct name for duration_time

Signed-off-by: Andi Kleen <ak@linux.intel.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 7835e05f0c0a..6872394b6f55 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -579,6 +579,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];
@@ -600,7 +606,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:
-- 
2.20.1


  parent reply	other threads:[~2019-03-26 22:18 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 ` Andi Kleen [this message]
2019-04-05 11:39   ` [tip:perf/core] perf evsel: Support printing evsel name for 'duration_time' tip-bot for Andi Kleen
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=20190326221823.11518-4-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).