Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1296814
| From | Namhyung Kim <namhyung@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events |
| Date | 2015-12-22 15:50 +0100 |
| Message-ID | <qIwqd-5cg-7@gated-at.bofh.it> (permalink) |
| References | <qI9Dj-7AS-3@gated-at.bofh.it> <qI9Dj-7AS-1@gated-at.bofh.it> <qIpyq-SZ-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Dec 22, 2015 at 08:29:46AM +0100, Jiri Olsa wrote:
> On Mon, Dec 21, 2015 at 11:26:52PM +0900, Namhyung Kim wrote:
> > When an evlist contains tracepoint events only, use 'trace' sort key as
> > default. This will make users more convenient to see trace result.
> >
> > Suggested-by: Jiri Olsa <jolsa@redhat.com>
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> > tools/perf/util/sort.c | 22 +++++++++++++++++-----
> > 1 file changed, 17 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> > index f38a0577967a..43cb9b638718 100644
> > --- a/tools/perf/util/sort.c
> > +++ b/tools/perf/util/sort.c
> > @@ -2067,7 +2067,7 @@ static int sort_dimension__add(const char *tok,
> > return -ESRCH;
> > }
> >
> > -static const char *get_default_sort_order(void)
> > +static const char *get_default_sort_order(struct perf_evlist *evlist)
> > {
> > const char *default_sort_orders[] = {
> > default_sort_order,
> > @@ -2076,13 +2076,25 @@ static const char *get_default_sort_order(void)
> > default_top_sort_order,
> > default_diff_sort_order,
> > };
> > + bool use_trace = true;
> > + struct perf_evsel *evsel;
> >
> > BUG_ON(sort__mode >= ARRAY_SIZE(default_sort_orders));
> >
> > + evlist__for_each(evlist, evsel) {
> > + if (evsel->attr.type != PERF_TYPE_TRACEPOINT) {
> > + use_trace = false;
> > + break;
> > + }
> > + }
> > +
> > + if (use_trace)
> > + return "trace";
>
> I wonder it'd be little 'nicer' to keep the current style
> for sort orders for tracepoint even thought it has just single
> column.. like adding:
> - default_tracepoint_sort_order = "trace"
> - SORT_MODE__TRACEPOINT
Will change.
Thanks,
Namhyung
>
> > +
> > return default_sort_orders[sort__mode];
> > }
>
> SNIP
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-21 15:30 +0100
Re: [PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events Jiri Olsa <jolsa@redhat.com> - 2015-12-22 08:30 +0100
Re: [PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-22 15:50 +0100
csiph-web