Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292262 > unrolled thread

[PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)

Started byNamhyung Kim <namhyung@kernel.org>
First post2015-12-15 16:40 +0100
Last post2015-12-17 13:30 +0100
Articles 4 on this page of 24 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2) Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 02/10] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
      [PATCH v2.1] perf hist: Save raw_data/size for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-17 09:20 +0100
        Re: [PATCH v2.1] perf hist: Save raw_data/size for tracepoint events Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-17 13:30 +0100
    [PATCH 01/10] perf hist: Pass struct sample to __hists__add_entry() Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 03/10] tools lib traceevent: Factor out and export print_event_field[s] Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 06/10] perf tools: Try to show pretty printed output for dynamic sort keys Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
      Re: [PATCH 06/10] perf tools: Try to show pretty printed output for  dynamic sort keys Jiri Olsa <jolsa@redhat.com> - 2015-12-20 15:20 +0100
        Re: [PATCH 06/10] perf tools: Try to show pretty printed output for  dynamic sort keys Namhyung Kim <namhyung@kernel.org> - 2015-12-21 09:40 +0100
    [PATCH 10/10] perf tools: Support shortcuts for events in dynamic sort keys Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 07/10] perf tools: Add 'trace' sort key Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 08/10] perf tools: Add --raw-trace option Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
      Re: [PATCH 08/10] perf tools: Add --raw-trace option Jiri Olsa <jolsa@redhat.com> - 2015-12-20 16:00 +0100
        Re: [PATCH 08/10] perf tools: Add --raw-trace option Namhyung Kim <namhyung@kernel.org> - 2015-12-21 09:50 +0100
          Re: [PATCH 08/10] perf tools: Add --raw-trace option Jiri Olsa <jolsa@redhat.com> - 2015-12-22 08:00 +0100
            Re: [PATCH 08/10] perf tools: Add --raw-trace option Namhyung Kim <namhyung@kernel.org> - 2015-12-22 17:30 +0100
    [PATCH 04/10] perf tools: Pass evlist to setup_sorting() Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    [PATCH 05/10] perf tools: Add dynamic sort key for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
      Re: [PATCH 05/10] perf tools: Add dynamic sort key for tracepoint  events Jiri Olsa <jolsa@redhat.com> - 2015-12-20 15:00 +0100
        Re: [PATCH 05/10] perf tools: Add dynamic sort key for tracepoint  events Namhyung Kim <namhyung@kernel.org> - 2015-12-20 15:10 +0100
    [PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events Namhyung Kim <namhyung@kernel.org> - 2015-12-15 16:40 +0100
    Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for  tracepoints (v2) Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-17 01:20 +0100
      Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for  tracepoints (v2) Namhyung Kim <namhyung@kernel.org> - 2015-12-17 09:00 +0100
        Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for  tracepoints (v2) Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-17 13:30 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1292282 — [PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events

FromNamhyung Kim <namhyung@kernel.org>
Date2015-12-15 16:40 +0100
Subject[PATCH 09/10] perf tools: Make 'trace' sort key default for tracepoint events
Message-ID<qFZRN-64B-55@gated-at.bofh.it>
In reply to#1292262
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 da65b07258bb..e661d3dd3ef3 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2049,7 +2049,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,
@@ -2058,13 +2058,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";
+
 	return default_sort_orders[sort__mode];
 }
 
-static int setup_sort_order(void)
+static int setup_sort_order(struct perf_evlist *evlist)
 {
 	char *new_sort_order;
 
@@ -2085,7 +2097,7 @@ static int setup_sort_order(void)
 	 * because it's checked over the rest of the code.
 	 */
 	if (asprintf(&new_sort_order, "%s,%s",
-		     get_default_sort_order(), sort_order + 1) < 0) {
+		     get_default_sort_order(evlist), sort_order + 1) < 0) {
 		error("Not enough memory to set up --sort");
 		return -ENOMEM;
 	}
@@ -2100,7 +2112,7 @@ static int __setup_sorting(struct perf_evlist *evlist)
 	const char *sort_keys;
 	int ret = 0;
 
-	ret = setup_sort_order();
+	ret = setup_sort_order(evlist);
 	if (ret)
 		return ret;
 
@@ -2114,7 +2126,7 @@ static int __setup_sorting(struct perf_evlist *evlist)
 			return 0;
 		}
 
-		sort_keys = get_default_sort_order();
+		sort_keys = get_default_sort_order(evlist);
 	}
 
 	str = strdup(sort_keys);
-- 
2.6.4

--
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/

[toc] | [prev] | [next] | [standalone]


#1293417 — Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-12-17 01:20 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)
Message-ID<qGusx-oe-5@gated-at.bofh.it>
In reply to#1292262
Em Wed, Dec 16, 2015 at 12:35:33AM +0900, Namhyung Kim escreveu:
> Hello,
> 
> This is an attempt to improve perf to deal with tracepoint events
> better.  The perf tools can handle tracepoint events but perf report
> on them is less useful since they're always sampled in a fixed
> location and not provide event specific info.  We can use perf script
> but I always wishes there's more convenient way to see the result.
> 
>  * changes in v2)
>   - add 'trace' sort key and make it default  (Jiri)
>   - add '--raw-trace' option and '/raw' field modifier  (Jiri)
>   - support event name shortcuts  (David)

Can you take a look if you can reproduce this? Without callchains it works in
all tests I did.

[root@zoo ~]# perf record -g -e kmem:kmalloc -a
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.193 MB perf.data (250 samples) ]

[root@zoo ~]# perf report
perf: Segmentation fault
-------- backtrace --------
perf[0x539f1b]
/lib64/libc.so.6(+0x34960)[0x7fc8e3752960]
perf(pevent_read_number+0x78)[0x542e40]
perf(pevent_read_number_field+0x70)[0x542ed3]
/root/.traceevent/plugins/plugin_kmem.so(+0x603)[0x7fc8e1a6c603]
perf(pevent_event_info+0x96)[0x547597]
perf[0x4dce26]
perf[0x4e0e89]
perf(hist_entry_iter__add+0xee)[0x4e125e]
perf[0x4304be]
perf[0x4c2db3]
perf[0x4c3301]
perf[0x4c6089]
perf(perf_session__process_events+0x3f1)[0x4c4b91]
perf(cmd_report+0x120b)[0x4319cb]
perf[0x47c871]
perf(main+0x63f)[0x42242f]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7fc8e373dfe0]
perf[0x422549]
[0x0]
[root@zoo ~]# ls -la ~/.traceevent/
total 12
drwxr-xr-x.  3 acme acme 4096 May  4  2015 .
drwx------. 61 acme acme 4096 Dec 16 21:12 ..
drwxr-xr-x.  2 acme acme 4096 Nov 23 11:15 plugins
[root@zoo ~]# ls -la ~/.traceevent
lrwxrwxrwx. 1 root root 23 May  4  2015 /root/.traceevent -> /home/acme/.traceevent/
[root@zoo ~]# perf record -e sched:sched_switch -a


^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.704 MB perf.data (4967 samples) ]

[root@zoo ~]# perf report
[root@zoo ~]# perf record -g -e sched:sched_switch -a
^C[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 2.062 MB perf.data (4743 samples) ]

[root@zoo ~]# perf report
perf: Segmentation fault
-------- backtrace --------
perf[0x539f1b]
/lib64/libc.so.6(+0x34960)[0x7fecb3223960]
perf(pevent_read_number+0x60)[0x542e28]
perf(pevent_read_number_field+0x70)[0x542ed3]
perf(get_field_val+0x6b)[0x548cd5]
perf(pevent_get_field_val+0x6b)[0x548e77]
/root/.traceevent/plugins/plugin_sched_switch.so(+0x95b)[0x7fecb194195b]
perf(pevent_event_info+0x96)[0x547597]
perf[0x4dce26]
perf[0x4e0e89]
perf(hist_entry_iter__add+0xee)[0x4e125e]
perf[0x4304be]
perf[0x4c2db3]
perf[0x4c3301]
perf[0x4c5fdb]
perf[0x4c3535]
perf(perf_session__process_events+0x3a0)[0x4c4b40]
perf(cmd_report+0x120b)[0x4319cb]
perf[0x47c871]
perf(main+0x63f)[0x42242f]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7fecb320efe0]
perf[0x422549]
[0x0]
[root@zoo ~]# 

--
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/

[toc] | [prev] | [next] | [standalone]


#1293664 — Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)

FromNamhyung Kim <namhyung@kernel.org>
Date2015-12-17 09:00 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)
Message-ID<qGBDH-4O5-3@gated-at.bofh.it>
In reply to#1293417
Hi Arnaldo,

On Wed, Dec 16, 2015 at 09:17:59PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Dec 16, 2015 at 12:35:33AM +0900, Namhyung Kim escreveu:
> > Hello,
> > 
> > This is an attempt to improve perf to deal with tracepoint events
> > better.  The perf tools can handle tracepoint events but perf report
> > on them is less useful since they're always sampled in a fixed
> > location and not provide event specific info.  We can use perf script
> > but I always wishes there's more convenient way to see the result.
> > 
> >  * changes in v2)
> >   - add 'trace' sort key and make it default  (Jiri)
> >   - add '--raw-trace' option and '/raw' field modifier  (Jiri)
> >   - support event name shortcuts  (David)
> 
> Can you take a look if you can reproduce this? Without callchains it works in
> all tests I did.

Argh, it was because I forgot to set raw_data/size field for
--children case.  I'll send the fix soon.

Maybe we can disable --children for tracepoint sessions (or if it
doesn't have symbol sort key)?

Thanks,
Namhyung


> 
> [root@zoo ~]# perf record -g -e kmem:kmalloc -a
> ^C[ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 1.193 MB perf.data (250 samples) ]
> 
> [root@zoo ~]# perf report
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x539f1b]
> /lib64/libc.so.6(+0x34960)[0x7fc8e3752960]
> perf(pevent_read_number+0x78)[0x542e40]
> perf(pevent_read_number_field+0x70)[0x542ed3]
> /root/.traceevent/plugins/plugin_kmem.so(+0x603)[0x7fc8e1a6c603]
> perf(pevent_event_info+0x96)[0x547597]
> perf[0x4dce26]
> perf[0x4e0e89]
> perf(hist_entry_iter__add+0xee)[0x4e125e]
> perf[0x4304be]
> perf[0x4c2db3]
> perf[0x4c3301]
> perf[0x4c6089]
> perf(perf_session__process_events+0x3f1)[0x4c4b91]
> perf(cmd_report+0x120b)[0x4319cb]
> perf[0x47c871]
> perf(main+0x63f)[0x42242f]
> /lib64/libc.so.6(__libc_start_main+0xf0)[0x7fc8e373dfe0]
> perf[0x422549]
> [0x0]
> [root@zoo ~]# ls -la ~/.traceevent/
> total 12
> drwxr-xr-x.  3 acme acme 4096 May  4  2015 .
> drwx------. 61 acme acme 4096 Dec 16 21:12 ..
> drwxr-xr-x.  2 acme acme 4096 Nov 23 11:15 plugins
> [root@zoo ~]# ls -la ~/.traceevent
> lrwxrwxrwx. 1 root root 23 May  4  2015 /root/.traceevent -> /home/acme/.traceevent/
> [root@zoo ~]# perf record -e sched:sched_switch -a
> 
> 
> ^C[ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 1.704 MB perf.data (4967 samples) ]
> 
> [root@zoo ~]# perf report
> [root@zoo ~]# perf record -g -e sched:sched_switch -a
> ^C[ perf record: Woken up 2 times to write data ]
> [ perf record: Captured and wrote 2.062 MB perf.data (4743 samples) ]
> 
> [root@zoo ~]# perf report
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x539f1b]
> /lib64/libc.so.6(+0x34960)[0x7fecb3223960]
> perf(pevent_read_number+0x60)[0x542e28]
> perf(pevent_read_number_field+0x70)[0x542ed3]
> perf(get_field_val+0x6b)[0x548cd5]
> perf(pevent_get_field_val+0x6b)[0x548e77]
> /root/.traceevent/plugins/plugin_sched_switch.so(+0x95b)[0x7fecb194195b]
> perf(pevent_event_info+0x96)[0x547597]
> perf[0x4dce26]
> perf[0x4e0e89]
> perf(hist_entry_iter__add+0xee)[0x4e125e]
> perf[0x4304be]
> perf[0x4c2db3]
> perf[0x4c3301]
> perf[0x4c5fdb]
> perf[0x4c3535]
> perf(perf_session__process_events+0x3a0)[0x4c4b40]
> perf(cmd_report+0x120b)[0x4319cb]
> perf[0x47c871]
> perf(main+0x63f)[0x42242f]
> /lib64/libc.so.6(__libc_start_main+0xf0)[0x7fecb320efe0]
> perf[0x422549]
> [0x0]
> [root@zoo ~]# 
> 
--
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/

[toc] | [prev] | [next] | [standalone]


#1293841 — Re: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-12-17 13:30 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Support dynamic sort keys for tracepoints (v2)
Message-ID<qGFR1-7NE-37@gated-at.bofh.it>
In reply to#1293664
Em Thu, Dec 17, 2015 at 04:56:31PM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> On Wed, Dec 16, 2015 at 09:17:59PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Dec 16, 2015 at 12:35:33AM +0900, Namhyung Kim escreveu:
> > > Hello,
> > > 
> > > This is an attempt to improve perf to deal with tracepoint events
> > > better.  The perf tools can handle tracepoint events but perf report
> > > on them is less useful since they're always sampled in a fixed
> > > location and not provide event specific info.  We can use perf script
> > > but I always wishes there's more convenient way to see the result.
> > > 
> > >  * changes in v2)
> > >   - add 'trace' sort key and make it default  (Jiri)
> > >   - add '--raw-trace' option and '/raw' field modifier  (Jiri)
> > >   - support event name shortcuts  (David)
> > 
> > Can you take a look if you can reproduce this? Without callchains it works in
> > all tests I did.
> 
> Argh, it was because I forgot to set raw_data/size field for
> --children case.  I'll send the fix soon.
> 
> Maybe we can disable --children for tracepoint sessions (or if it
> doesn't have symbol sort key)?

Looks like a plan, unless we want to have all the callchains that get to
some specific DSO or pid.

- Arnaldo
 
> Thanks,
> Namhyung
> 
> 
> > 
> > [root@zoo ~]# perf record -g -e kmem:kmalloc -a
> > ^C[ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 1.193 MB perf.data (250 samples) ]
> > 
> > [root@zoo ~]# perf report
> > perf: Segmentation fault
> > -------- backtrace --------
> > perf[0x539f1b]
> > /lib64/libc.so.6(+0x34960)[0x7fc8e3752960]
> > perf(pevent_read_number+0x78)[0x542e40]
> > perf(pevent_read_number_field+0x70)[0x542ed3]
> > /root/.traceevent/plugins/plugin_kmem.so(+0x603)[0x7fc8e1a6c603]
> > perf(pevent_event_info+0x96)[0x547597]
> > perf[0x4dce26]
> > perf[0x4e0e89]
> > perf(hist_entry_iter__add+0xee)[0x4e125e]
> > perf[0x4304be]
> > perf[0x4c2db3]
> > perf[0x4c3301]
> > perf[0x4c6089]
> > perf(perf_session__process_events+0x3f1)[0x4c4b91]
> > perf(cmd_report+0x120b)[0x4319cb]
> > perf[0x47c871]
> > perf(main+0x63f)[0x42242f]
> > /lib64/libc.so.6(__libc_start_main+0xf0)[0x7fc8e373dfe0]
> > perf[0x422549]
> > [0x0]
> > [root@zoo ~]# ls -la ~/.traceevent/
> > total 12
> > drwxr-xr-x.  3 acme acme 4096 May  4  2015 .
> > drwx------. 61 acme acme 4096 Dec 16 21:12 ..
> > drwxr-xr-x.  2 acme acme 4096 Nov 23 11:15 plugins
> > [root@zoo ~]# ls -la ~/.traceevent
> > lrwxrwxrwx. 1 root root 23 May  4  2015 /root/.traceevent -> /home/acme/.traceevent/
> > [root@zoo ~]# perf record -e sched:sched_switch -a
> > 
> > 
> > ^C[ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 1.704 MB perf.data (4967 samples) ]
> > 
> > [root@zoo ~]# perf report
> > [root@zoo ~]# perf record -g -e sched:sched_switch -a
> > ^C[ perf record: Woken up 2 times to write data ]
> > [ perf record: Captured and wrote 2.062 MB perf.data (4743 samples) ]
> > 
> > [root@zoo ~]# perf report
> > perf: Segmentation fault
> > -------- backtrace --------
> > perf[0x539f1b]
> > /lib64/libc.so.6(+0x34960)[0x7fecb3223960]
> > perf(pevent_read_number+0x60)[0x542e28]
> > perf(pevent_read_number_field+0x70)[0x542ed3]
> > perf(get_field_val+0x6b)[0x548cd5]
> > perf(pevent_get_field_val+0x6b)[0x548e77]
> > /root/.traceevent/plugins/plugin_sched_switch.so(+0x95b)[0x7fecb194195b]
> > perf(pevent_event_info+0x96)[0x547597]
> > perf[0x4dce26]
> > perf[0x4e0e89]
> > perf(hist_entry_iter__add+0xee)[0x4e125e]
> > perf[0x4304be]
> > perf[0x4c2db3]
> > perf[0x4c3301]
> > perf[0x4c5fdb]
> > perf[0x4c3535]
> > perf(perf_session__process_events+0x3a0)[0x4c4b40]
> > perf(cmd_report+0x120b)[0x4319cb]
> > perf[0x47c871]
> > perf(main+0x63f)[0x42242f]
> > /lib64/libc.so.6(__libc_start_main+0xf0)[0x7fecb320efe0]
> > perf[0x422549]
> > [0x0]
> > [root@zoo ~]# 
> > 
--
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/

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web