lkml.org 
[lkml]   [2015]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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


\
 
 \ /
  Last update: 2015-12-22 16:01    [W:0.041 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site