perf data: don't mention --to-ctf if it's not supported
PATCH 1/1 perf data: don't mention --to-ctf if it's not supported
From: Mahmoud Mandour <[email protected]>
The option --to-ctf is only available when perf has libbabeltrace support. Hence, on error, we shouldn't state that user must include --to-ctf unless it's supported.
The only user-visible change for this commit is that when perf is not configured to support libbabeltrace, the user is only prompted to provide the --to-json option instead of bothe --to-json and --to-ctf.
--- tools/perf/builtin-data.c | 7 +++++++ 1 file changed, 7 insertions(+)
tools/perf/builtin-data.c +7 -0
@@ -62,10 +62,17 @@ static int cmd_data_convert(int argc, const char **argv)pr_err ("You cannot specify both --to-ctf and --to-json.\n" );return -1 ; } +#ifdef HAVE_LIBBABELTRACE_SUPPORT if (!to_json && !to_ctf) {pr_err ("You must specify one of --to-ctf or --to-json.\n" );return -1 ; } +#else +if (!to_json) { +pr_err ("You must specify --to-json.\n" ); +return -1 ; +} +#endif if (to_json)return bt_convert__perf2json (input_name, to_json, &opts);
Signature · 1 line
2.30.2
Quoted 6 lines · Mahmoud Abumandour
From: Mahmoud Mandour <[email protected]>
The option
--to-ctfis only available when perf has libbabeltrace support. Hence, on error, we shouldn't state that user must include--to-ctfunless it's supported.
Quoted 6 lines
The only user-visible change for this commit is that when
perfis not configured to support libbabeltrace, the user is only prompted to provide the--to-jsonoption instead of bothe--to-jsonand--to-ctf.Signed-off-by Mahmoud Mandour <[email protected]>
thanks,
jirka
Quoted 29 lines
--- tools/perf/builtin-data.c | 7 +++++++ 1 file changed, 7 insertions(+)tools/perf/builtin-data.c +7
-0@@ -62,10 +62,17 @@ static int cmd_data_convert(int argc, const char **argv)pr_err ("You cannot specify both --to-ctf and --to-json.\n" );return -1 ; } +#ifdef HAVE_LIBBABELTRACE_SUPPORT if (!to_json && !to_ctf) {pr_err ("You must specify one of --to-ctf or --to-json.\n" );return -1 ; } +#else +if (!to_json) { +pr_err ("You must specify --to-json.\n" ); +return -1 ; +} +#endif if (to_json)return bt_convert__perf2json (input_name, to_json, &opts);Signature · 1 line
2.30.2
Em Mon, Feb 21, 2022 at 10:14:31PM +0100, Jiri Olsa escreveu:
Quoted 7 lines · Mahmoud Abumandour
Quoted 6 lines
From: Mahmoud Mandour <[email protected]>
The option
--to-ctfis only available when perf has libbabeltrace support. Hence, on error, we shouldn't state that user must include--to-ctfunless it's supported.
Quoted 8 lines
Quoted 6 lines
The only user-visible change for this commit is that when
perfis not configured to support libbabeltrace, the user is only prompted to provide the--to-jsonoption instead of bothe--to-jsonand--to-ctf.Signed-off-by Mahmoud Mandour <[email protected]>Acked-by Jiri Olsa <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 32 lines
thanks,
jirkaQuoted 29 lines
--- tools/perf/builtin-data.c | 7 +++++++ 1 file changed, 7 insertions(+)tools/perf/builtin-data.c +7
-0@@ -62,10 +62,17 @@ static int cmd_data_convert(int argc, const char **argv)pr_err ("You cannot specify both --to-ctf and --to-json.\n" );return -1 ; } +#ifdef HAVE_LIBBABELTRACE_SUPPORT if (!to_json && !to_ctf) {pr_err ("You must specify one of --to-ctf or --to-json.\n" );return -1 ; } +#else +if (!to_json) { +pr_err ("You must specify --to-json.\n" ); +return -1 ; +} +#endif if (to_json)return bt_convert__perf2json (input_name, to_json, &opts);Signature · 1 line
2.30.2
Signature · 1 line
- Arnaldo