linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf report: Create option to disable raw event ordering
@ 2021-02-19  7:00 Jin Yao
  2021-02-22 21:32 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Jin Yao @ 2021-02-19  7:00 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, Jin Yao

Warning "dso not found" is reported when using "perf report -D".

 66702781413407 0x32c0 [0x30]: PERF_RECORD_SAMPLE(IP, 0x2): 28177/28177: 0x55e493e00563 period: 106578 addr: 0
  ... thread: perf:28177
  ...... dso: <not found>

 66702727832429 0x9dd8 [0x38]: PERF_RECORD_COMM exec: triad_loop:28177/28177

The PERF_RECORD_SAMPLE event (timestamp: 66702781413407) should be after the
PERF_RECORD_COMM event (timestamp: 66702727832429), but it's early processed.

So for most of cases, it makes sense to keep the event ordered even for dump
mode. But it would be also useful to disable ordered_events for reporting raw
dump to see events as they are stored in the perf.data file.

So now, set ordered_events by default to true and add a new option
'disable-order' to disable it. For example,

perf report -D --disable-order

Fixes: 977f739b7126b ("perf report: Disable ordered_events for raw dump")
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
---
 tools/perf/Documentation/perf-report.txt | 3 +++
 tools/perf/builtin-report.c              | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index f546b5e9db05..87112e8d904e 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -224,6 +224,9 @@ OPTIONS
 --dump-raw-trace::
         Dump raw trace in ASCII.
 
+--disable-order::
+	Disable raw trace ordering.
+
 -g::
 --call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>::
         Display call chains using type, min percent threshold, print limit,
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2a845d6cac09..0d65c98794a8 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -84,6 +84,7 @@ struct report {
 	bool			nonany_branch_mode;
 	bool			group_set;
 	bool			stitch_lbr;
+	bool			disable_order;
 	int			max_stack;
 	struct perf_read_values	show_threads_values;
 	struct annotation_options annotation_opts;
@@ -1296,6 +1297,8 @@ int cmd_report(int argc, const char **argv)
 	OPTS_EVSWITCH(&report.evswitch),
 	OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode,
 		    "Sort all blocks by 'Sampled Cycles%'"),
+	OPT_BOOLEAN(0, "disable-order", &report.disable_order,
+		    "Disable raw trace ordering"),
 	OPT_END()
 	};
 	struct perf_data data = {
@@ -1329,7 +1332,7 @@ int cmd_report(int argc, const char **argv)
 	if (report.mmaps_mode)
 		report.tasks_mode = true;
 
-	if (dump_trace)
+	if (dump_trace && report.disable_order)
 		report.tool.ordered_events = false;
 
 	if (quiet)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf report: Create option to disable raw event ordering
  2021-02-19  7:00 [PATCH] perf report: Create option to disable raw event ordering Jin Yao
@ 2021-02-22 21:32 ` Jiri Olsa
  2021-03-03 16:26   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2021-02-22 21:32 UTC (permalink / raw)
  To: Jin Yao
  Cc: acme, jolsa, peterz, mingo, alexander.shishkin, Linux-kernel, ak,
	kan.liang, yao.jin

On Fri, Feb 19, 2021 at 03:00:05PM +0800, Jin Yao wrote:
> Warning "dso not found" is reported when using "perf report -D".
> 
>  66702781413407 0x32c0 [0x30]: PERF_RECORD_SAMPLE(IP, 0x2): 28177/28177: 0x55e493e00563 period: 106578 addr: 0
>   ... thread: perf:28177
>   ...... dso: <not found>
> 
>  66702727832429 0x9dd8 [0x38]: PERF_RECORD_COMM exec: triad_loop:28177/28177
> 
> The PERF_RECORD_SAMPLE event (timestamp: 66702781413407) should be after the
> PERF_RECORD_COMM event (timestamp: 66702727832429), but it's early processed.
> 
> So for most of cases, it makes sense to keep the event ordered even for dump
> mode. But it would be also useful to disable ordered_events for reporting raw
> dump to see events as they are stored in the perf.data file.
> 
> So now, set ordered_events by default to true and add a new option
> 'disable-order' to disable it. For example,
> 
> perf report -D --disable-order
> 
> Fixes: 977f739b7126b ("perf report: Disable ordered_events for raw dump")
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka


> ---
>  tools/perf/Documentation/perf-report.txt | 3 +++
>  tools/perf/builtin-report.c              | 5 ++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
> index f546b5e9db05..87112e8d904e 100644
> --- a/tools/perf/Documentation/perf-report.txt
> +++ b/tools/perf/Documentation/perf-report.txt
> @@ -224,6 +224,9 @@ OPTIONS
>  --dump-raw-trace::
>          Dump raw trace in ASCII.
>  
> +--disable-order::
> +	Disable raw trace ordering.
> +
>  -g::
>  --call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>::
>          Display call chains using type, min percent threshold, print limit,
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 2a845d6cac09..0d65c98794a8 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -84,6 +84,7 @@ struct report {
>  	bool			nonany_branch_mode;
>  	bool			group_set;
>  	bool			stitch_lbr;
> +	bool			disable_order;
>  	int			max_stack;
>  	struct perf_read_values	show_threads_values;
>  	struct annotation_options annotation_opts;
> @@ -1296,6 +1297,8 @@ int cmd_report(int argc, const char **argv)
>  	OPTS_EVSWITCH(&report.evswitch),
>  	OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode,
>  		    "Sort all blocks by 'Sampled Cycles%'"),
> +	OPT_BOOLEAN(0, "disable-order", &report.disable_order,
> +		    "Disable raw trace ordering"),
>  	OPT_END()
>  	};
>  	struct perf_data data = {
> @@ -1329,7 +1332,7 @@ int cmd_report(int argc, const char **argv)
>  	if (report.mmaps_mode)
>  		report.tasks_mode = true;
>  
> -	if (dump_trace)
> +	if (dump_trace && report.disable_order)
>  		report.tool.ordered_events = false;
>  
>  	if (quiet)
> -- 
> 2.17.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf report: Create option to disable raw event ordering
  2021-02-22 21:32 ` Jiri Olsa
@ 2021-03-03 16:26   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-03-03 16:26 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jin Yao, jolsa, peterz, mingo, alexander.shishkin, Linux-kernel,
	ak, kan.liang, yao.jin

Em Mon, Feb 22, 2021 at 10:32:40PM +0100, Jiri Olsa escreveu:
> On Fri, Feb 19, 2021 at 03:00:05PM +0800, Jin Yao wrote:
> > Warning "dso not found" is reported when using "perf report -D".
> > 
> >  66702781413407 0x32c0 [0x30]: PERF_RECORD_SAMPLE(IP, 0x2): 28177/28177: 0x55e493e00563 period: 106578 addr: 0
> >   ... thread: perf:28177
> >   ...... dso: <not found>
> > 
> >  66702727832429 0x9dd8 [0x38]: PERF_RECORD_COMM exec: triad_loop:28177/28177
> > 
> > The PERF_RECORD_SAMPLE event (timestamp: 66702781413407) should be after the
> > PERF_RECORD_COMM event (timestamp: 66702727832429), but it's early processed.
> > 
> > So for most of cases, it makes sense to keep the event ordered even for dump
> > mode. But it would be also useful to disable ordered_events for reporting raw
> > dump to see events as they are stored in the perf.data file.
> > 
> > So now, set ordered_events by default to true and add a new option
> > 'disable-order' to disable it. For example,
> > 
> > perf report -D --disable-order
> > 
> > Fixes: 977f739b7126b ("perf report: Disable ordered_events for raw dump")
> > Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>

Thanks, applied to perf/core.

- Arnaldo

 
> thanks,
> jirka
> 
> 
> > ---
> >  tools/perf/Documentation/perf-report.txt | 3 +++
> >  tools/perf/builtin-report.c              | 5 ++++-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
> > index f546b5e9db05..87112e8d904e 100644
> > --- a/tools/perf/Documentation/perf-report.txt
> > +++ b/tools/perf/Documentation/perf-report.txt
> > @@ -224,6 +224,9 @@ OPTIONS
> >  --dump-raw-trace::
> >          Dump raw trace in ASCII.
> >  
> > +--disable-order::
> > +	Disable raw trace ordering.
> > +
> >  -g::
> >  --call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>::
> >          Display call chains using type, min percent threshold, print limit,
> > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> > index 2a845d6cac09..0d65c98794a8 100644
> > --- a/tools/perf/builtin-report.c
> > +++ b/tools/perf/builtin-report.c
> > @@ -84,6 +84,7 @@ struct report {
> >  	bool			nonany_branch_mode;
> >  	bool			group_set;
> >  	bool			stitch_lbr;
> > +	bool			disable_order;
> >  	int			max_stack;
> >  	struct perf_read_values	show_threads_values;
> >  	struct annotation_options annotation_opts;
> > @@ -1296,6 +1297,8 @@ int cmd_report(int argc, const char **argv)
> >  	OPTS_EVSWITCH(&report.evswitch),
> >  	OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode,
> >  		    "Sort all blocks by 'Sampled Cycles%'"),
> > +	OPT_BOOLEAN(0, "disable-order", &report.disable_order,
> > +		    "Disable raw trace ordering"),
> >  	OPT_END()
> >  	};
> >  	struct perf_data data = {
> > @@ -1329,7 +1332,7 @@ int cmd_report(int argc, const char **argv)
> >  	if (report.mmaps_mode)
> >  		report.tasks_mode = true;
> >  
> > -	if (dump_trace)
> > +	if (dump_trace && report.disable_order)
> >  		report.tool.ordered_events = false;
> >  
> >  	if (quiet)
> > -- 
> > 2.17.1
> > 
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-03 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19  7:00 [PATCH] perf report: Create option to disable raw event ordering Jin Yao
2021-02-22 21:32 ` Jiri Olsa
2021-03-03 16:26   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).