Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf data: Don't mention --to-ctf if it's not supported

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`.

Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220220113952.138280-1-ma.mandourr@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Mahmoud Mandour and committed by
Arnaldo Carvalho de Melo
8c4c7016 65e7c963

+7
+7
tools/perf/builtin-data.c
··· 62 62 pr_err("You cannot specify both --to-ctf and --to-json.\n"); 63 63 return -1; 64 64 } 65 + #ifdef HAVE_LIBBABELTRACE_SUPPORT 65 66 if (!to_json && !to_ctf) { 66 67 pr_err("You must specify one of --to-ctf or --to-json.\n"); 67 68 return -1; 68 69 } 70 + #else 71 + if (!to_json) { 72 + pr_err("You must specify --to-json.\n"); 73 + return -1; 74 + } 75 + #endif 69 76 70 77 if (to_json) 71 78 return bt_convert__perf2json(input_name, to_json, &opts);