From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
dsahern@gmail.com, artagnon@gmail.com
Subject: Re: [PATCH 5/8] perf tools: Add support of name_only for print_events_type() function.
Date: Wed, 8 Jan 2014 13:19:28 -0200 [thread overview]
Message-ID: <20140108151928.GD2626@infradead.org> (raw)
In-Reply-To: <0ad3f31b5c2d27da0a4cbd82129821136f56a581.1388416837.git.yangds.fnst@cn.fujitsu.com>
Em Mon, Dec 30, 2013 at 10:26:40AM -0500, Dongsheng Yang escreveu:
> The all print_xxx_event() functions are supporting name_only argument except
> print_event_type().
>
> This patch add an argument of name_only for print_events_type() function.
This one looks ok, as the 'name_only' parameter name together with your
changeset comments provides enough context to understand the patch at a
glance.
But it doesn't applies, as the previous one needs changes to address my
comments,
- Arnaldo
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
> tools/perf/util/parse-events.c | 14 ++++++++------
> tools/perf/util/parse-events.h | 2 +-
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index e2a2066..d70f362 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -1122,7 +1122,7 @@ static bool is_event_supported(u8 type, unsigned config)
> }
>
> static unsigned int __print_events_type(u8 type, struct event_symbol *syms,
> - unsigned max)
> + unsigned max, bool name_only)
> {
> char name[64];
> unsigned i;
> @@ -1137,20 +1137,22 @@ static unsigned int __print_events_type(u8 type, struct event_symbol *syms,
> syms->symbol, syms->alias);
> else
> snprintf(name, sizeof(name), "%s", syms->symbol);
> -
> - printf(" %-50s [%s]\n", name, event_type_descriptors[type]);
> + if (name_only)
> + printf(" %-50s\n", name);
> + else
> + printf(" %-50s [%s]\n", name, event_type_descriptors[type]);
> count++;
> }
>
> return count;
> }
>
> -unsigned int print_events_type(u8 type)
> +unsigned int print_events_type(u8 type, bool name_only)
> {
> if (type == PERF_TYPE_SOFTWARE)
> - return __print_events_type(type, event_symbols_sw, PERF_COUNT_SW_MAX);
> + return __print_events_type(type, event_symbols_sw, PERF_COUNT_SW_MAX, name_only);
> else
> - return __print_events_type(type, event_symbols_hw, PERF_COUNT_HW_MAX);
> + return __print_events_type(type, event_symbols_hw, PERF_COUNT_HW_MAX, name_only);
> }
>
> unsigned int print_hwcache_events(const char *event_glob, bool name_only)
> diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
> index bb7d674..148a767 100644
> --- a/tools/perf/util/parse-events.h
> +++ b/tools/perf/util/parse-events.h
> @@ -102,7 +102,7 @@ void parse_events_update_lists(struct list_head *list_event,
> void parse_events_error(void *data, void *scanner, char const *msg);
>
> unsigned int print_events(const char *event_glob, bool name_only);
> -unsigned int print_events_type(u8 type);
> +unsigned int print_events_type(u8 type, bool name_only);
> unsigned int print_tracepoint_events(const char *subsys_glob, const char *event_glob,
> bool name_only);
> unsigned int print_hwcache_events(const char *event_glob, bool name_only);
> --
> 1.8.2.1
next prev parent reply other threads:[~2014-01-08 15:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 15:26 [PATCH 0/8 V2] Enhancement for perf list Dongsheng Yang
2013-12-30 15:26 ` [PATCH 1/8] perf tools: Make the all print_xxx_event functions to return unsigned int Dongsheng Yang
2013-12-30 15:26 ` [PATCH 2/8] perf tools: Make the print_pmu_events funtion " Dongsheng Yang
2014-01-08 15:10 ` Arnaldo Carvalho de Melo
2014-01-09 14:58 ` Dongsheng Yang
2014-01-09 22:23 ` Dongsheng Yang
2013-12-30 15:26 ` [PATCH 3/8] perf tools: free aliases[j] in pmu.c if name_only is true Dongsheng Yang
2014-01-08 15:12 ` Arnaldo Carvalho de Melo
2014-01-09 14:53 ` Dongsheng Yang
2013-12-30 15:26 ` [PATCH 4/8] perf tools: Improve the message of perf list for unexpected input Dongsheng Yang
2014-01-08 15:16 ` Arnaldo Carvalho de Melo
2014-01-09 14:38 ` Dongsheng Yang
2013-12-30 15:26 ` [PATCH 5/8] perf tools: Add support of name_only for print_events_type() function Dongsheng Yang
2014-01-08 15:19 ` Arnaldo Carvalho de Melo [this message]
2014-01-09 14:37 ` Dongsheng Yang
2013-12-30 15:26 ` [PATCH 6/8] perf tools: Make --raw-dump work as a proper option for perf list Dongsheng Yang
2013-12-30 8:09 ` Ramkumar Ramachandra
2014-01-08 15:20 ` Arnaldo Carvalho de Melo
2014-01-08 21:44 ` David Ahern
2014-01-09 14:36 ` Dongsheng Yang
2014-01-10 15:30 ` David Ahern
2014-01-13 21:03 ` Dongsheng Yang
2013-12-30 15:26 ` [PATCH 7/8] perf tools: Fix bug when --raw-dump is not the first arguement " Dongsheng Yang
2013-12-30 15:26 ` [PATCH 8/8] perf tools: Enhancement for perf list with --raw-dump Dongsheng Yang
-- strict thread matches above, loose matches on Subject: below --
2013-12-27 23:03 [PATCH 0/8] Enhancement for perf list Dongsheng Yang
2013-12-27 23:03 ` [PATCH 5/8] perf tools: Add support of name_only for print_events_type() function Dongsheng Yang
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=20140108151928.GD2626@infradead.org \
--to=acme@redhat.com \
--cc=artagnon@gmail.com \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=yangds.fnst@cn.fujitsu.com \
/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
Powered by JetHome