From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/2] perf, tools, list: Print aliases with --raw-dump
Date: Mon, 19 Sep 2016 10:14:38 +0200 [thread overview]
Message-ID: <20160919081438.GD26906@krava> (raw)
In-Reply-To: <1474222699-28969-1-git-send-email-andi@firstfloor.org>
On Sun, Sep 18, 2016 at 11:18:18AM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> Print aliases like 'cycles' with perf list --raw-dump, so that
> they can be completed by perf-completion.sh
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> tools/perf/util/parse-events.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 94846271cb1c..9716c2bc6869 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -2191,13 +2191,21 @@ restart:
>
> if (!evt_num_known) {
> evt_num++;
> + if (strlen(syms->alias))
> + evt_num++;
> continue;
> }
>
> if (!name_only && strlen(syms->alias))
> snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
> - else
> + else {
> + if (strlen(syms->alias)) {
> + evt_list[evt_i++] = strdup(syms->alias);
why don't you copy syms->alias into name and let the code below do the queue?
thanks,
jirka
> + if (evt_list[evt_i - 1] == NULL)
> + goto out_enomem;
> + }
> strncpy(name, syms->symbol, MAX_NAME_LEN);
> + }
>
> evt_list[evt_i] = strdup(name);
> if (evt_list[evt_i] == NULL)
> --
> 2.5.5
>
next prev parent reply other threads:[~2016-09-19 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-18 18:18 [PATCH 1/2] perf, tools, list: Print aliases with --raw-dump Andi Kleen
2016-09-18 18:18 ` [PATCH 2/2] perf, tools: Fix completion script to handle comma list Andi Kleen
2016-09-19 8:14 ` Jiri Olsa [this message]
2016-09-19 16:07 ` [PATCH 1/2] perf, tools, list: Print aliases with --raw-dump Andi Kleen
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=20160919081438.GD26906@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.