[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151222144907.GB4508@danjae.kornet>
Date: Tue, 22 Dec 2015 23:49:07 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Andi Kleen <andi@...stfloor.org>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 09/10] perf tools: Make 'trace' sort key default for
tracepoint events
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@...hat.com>
> > Cc: Steven Rostedt <rostedt@...dmis.org>
> > Signed-off-by: Namhyung Kim <namhyung@...nel.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists