Skip to contentSkip to conversation

perf script: Allow --time with --reltime

PATCH Applied Andi Kleen 4 participants 4 messages Oct 2, 2019 – Oct 15, 2019 perf events

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 perf script: Allow --time with --reltime

From: Andi Kleen <[email protected]>

The original --reltime patch forbid --time with --reltime.

But it turns out --time doesn't really care about --reltime, because the relative time is only used at final output, while
the time filtering always works earlier on absolute time.

So just remove the check and allow combining the two options.

Fixes 90b10f47c0ee ("perf script: Support relative time")
---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/builtin-script.c +0 -5
index 32b17d51c982..7481003b2761 100644
@@ -3601,11 +3601,6 @@ int cmd_script(int argc, const char **argv)
 		}
 	}
 
-	if (script.time_str && reltime) {
-		fprintf(stderr, "Don't combine --reltime with --time\n");
-		return -1;
-	}
-
 	if (itrace_synth_opts.callchain &&
 	    itrace_synth_opts.callchain_sz > scripting_max_stack)
 		scripting_max_stack = itrace_synth_opts.callchain_sz;
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andi Kleen

From: Andi Kleen <[email protected]>

The original --reltime patch forbid --time with --reltime.

Quoted 8 lines

But it turns out --time doesn't really care about --reltime, because the relative time is only used at final output, while
the time filtering always works earlier on absolute time.

So just remove the check and allow combining the two options.

Fixes 90b10f47c0ee ("perf script: Support relative time")

thanks,
jirka

Quoted 23 lines
---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/builtin-script.c +0 -5
index 32b17d51c982..7481003b2761 100644
@@ -3601,11 +3601,6 @@ int cmd_script(int argc, const char **argv)
 		}
 	}
 
-	if (script.time_str && reltime) {
-		fprintf(stderr, "Don't combine --reltime with --time\n");
-		return -1;
-	}
-
 	if (itrace_synth_opts.callchain &&
 	    itrace_synth_opts.callchain_sz > scripting_max_stack)
 		scripting_max_stack = itrace_synth_opts.callchain_sz;
Signature · 1 line
2.21.0
#2 lore raw

Em Thu, Oct 03, 2019 at 12:18:27PM +0200, Jiri Olsa escreveu:

Quoted 9 lines · Andi Kleen
Quoted 8 lines

From: Andi Kleen <[email protected]>

The original --reltime patch forbid --time with --reltime.

But it turns out --time doesn't really care about --reltime, because the relative time is only used at final output, while
the time filtering always works earlier on absolute time.

Quoted 6 lines
Quoted 4 lines

So just remove the check and allow combining the two options.

Fixes 90b10f47c0ee ("perf script: Support relative time")

Thanks, applied.

- Arnaldo

merge bot Applied
#3 lore raw
In reply to Andi Kleen
The following commit has been merged into the perf/core branch of tip:

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     3714437d3fcc7956cabcb0077f2a506b61160a56
Gitweb:        https://git.kernel.org/tip/3714437d3fcc7956cabcb0077f2a506b61160a56
Author:        Andi Kleen <[email protected]>
AuthorDate:    Wed, 02 Oct 2019 09:46:42 -07:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Mon, 07 Oct 2019 12:22:18 -03:00

perf script: Allow --time with --reltime

The original --reltime patch forbid --time with --reltime.

But it turns out --time doesn't really care about --reltime, because the relative time is only used at final output, while the time filtering always works earlier on absolute time.

So just remove the check and allow combining the two options.

---
 tools/perf/builtin-script.c | 5 -----
 1 file changed, 5 deletions(-)
tools/perf/builtin-script.c +0 -5
index 67be8d3..1c797a9 100644
@@ -3605,11 +3605,6 @@ int cmd_script(int argc, const char **argv)
 		}
 	}
 
-	if (script.time_str && reltime) {
-		fprintf(stderr, "Don't combine --reltime with --time\n");
-		return -1;
-	}
-
 	if (itrace_synth_opts.callchain &&
 	    itrace_synth_opts.callchain_sz > scripting_max_stack)
 		scripting_max_stack = itrace_synth_opts.callchain_sz;