* [PATCH] perf data: don't mention --to-ctf if it's not supported
@ 2022-02-20 11:39 Mahmoud Abumandour
2022-02-21 21:14 ` Jiri Olsa
0 siblings, 1 reply; 3+ messages in thread
From: Mahmoud Abumandour @ 2022-02-20 11:39 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim
Cc: linux-perf-users, linux-kernel, Mahmoud Mandour
From: Mahmoud Mandour <ma.mandourr@gmail.com>
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>
---
tools/perf/builtin-data.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
index b7f9dc85a407..c22d82d2a73c 100644
--- a/tools/perf/builtin-data.c
+++ b/tools/perf/builtin-data.c
@@ -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);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf data: don't mention --to-ctf if it's not supported
2022-02-20 11:39 [PATCH] perf data: don't mention --to-ctf if it's not supported Mahmoud Abumandour
@ 2022-02-21 21:14 ` Jiri Olsa
2022-02-23 0:23 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2022-02-21 21:14 UTC (permalink / raw)
To: Mahmoud Abumandour
Cc: Ingo Molnar, Peter Zijlstra, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
linux-perf-users, linux-kernel
On Sun, Feb 20, 2022 at 01:39:52PM +0200, Mahmoud Abumandour wrote:
> From: Mahmoud Mandour <ma.mandourr@gmail.com>
>
> 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>
thanks,
jirka
> ---
> tools/perf/builtin-data.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
> index b7f9dc85a407..c22d82d2a73c 100644
> --- a/tools/perf/builtin-data.c
> +++ b/tools/perf/builtin-data.c
> @@ -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);
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf data: don't mention --to-ctf if it's not supported
2022-02-21 21:14 ` Jiri Olsa
@ 2022-02-23 0:23 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-02-23 0:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Mahmoud Abumandour, Ingo Molnar, Peter Zijlstra, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, linux-perf-users,
linux-kernel
Em Mon, Feb 21, 2022 at 10:14:31PM +0100, Jiri Olsa escreveu:
> On Sun, Feb 20, 2022 at 01:39:52PM +0200, Mahmoud Abumandour wrote:
> > From: Mahmoud Mandour <ma.mandourr@gmail.com>
> >
> > 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>
Thanks, applied.
- Arnaldo
> thanks,
> jirka
>
> > ---
> > tools/perf/builtin-data.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
> > index b7f9dc85a407..c22d82d2a73c 100644
> > --- a/tools/perf/builtin-data.c
> > +++ b/tools/perf/builtin-data.c
> > @@ -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);
> > --
> > 2.30.2
> >
--
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-23 0:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-20 11:39 [PATCH] perf data: don't mention --to-ctf if it's not supported Mahmoud Abumandour
2022-02-21 21:14 ` Jiri Olsa
2022-02-23 0:23 ` 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).