* [PATCH 1/2] perf docs: Add perf-iostat link to manpages @ 2022-04-04 22:15 Michael Petlan 2022-04-04 22:15 ` [PATCH 2/2] perf: Add external commands to list-cmds Michael Petlan 2022-04-05 20:53 ` [PATCH 1/2] perf docs: Add perf-iostat link to manpages Ian Rogers 0 siblings, 2 replies; 6+ messages in thread From: Michael Petlan @ 2022-04-04 22:15 UTC (permalink / raw) To: linux-perf-users, acme; +Cc: jolsa Signed-off-by: Michael Petlan <mpetlan@redhat.com> --- tools/perf/Documentation/perf.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf.txt b/tools/perf/Documentation/perf.txt index 9c330cdfa973..71ebdf8125de 100644 --- a/tools/perf/Documentation/perf.txt +++ b/tools/perf/Documentation/perf.txt @@ -83,7 +83,7 @@ linkperf:perf-buildid-list[1], linkperf:perf-c2c[1], linkperf:perf-config[1], linkperf:perf-data[1], linkperf:perf-diff[1], linkperf:perf-evlist[1], linkperf:perf-ftrace[1], linkperf:perf-help[1], linkperf:perf-inject[1], -linkperf:perf-intel-pt[1], linkperf:perf-kallsyms[1], +linkperf:perf-intel-pt[1], linkperf:perf-iostat[1], linkperf:perf-kallsyms[1], linkperf:perf-kmem[1], linkperf:perf-kvm[1], linkperf:perf-lock[1], linkperf:perf-mem[1], linkperf:perf-probe[1], linkperf:perf-sched[1], linkperf:perf-script[1], linkperf:perf-test[1], -- 2.18.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] perf: Add external commands to list-cmds 2022-04-04 22:15 [PATCH 1/2] perf docs: Add perf-iostat link to manpages Michael Petlan @ 2022-04-04 22:15 ` Michael Petlan 2022-04-05 20:54 ` Ian Rogers 2022-04-05 20:53 ` [PATCH 1/2] perf docs: Add perf-iostat link to manpages Ian Rogers 1 sibling, 1 reply; 6+ messages in thread From: Michael Petlan @ 2022-04-04 22:15 UTC (permalink / raw) To: linux-perf-users, acme; +Cc: jolsa The `perf --list-cmds` output prints only internal commands, although there is no reason for that from users' perspective. Adding the external commands to commands array with NULL function pointer allows printing all perf commands while not changing the logic of command handler selection. Signed-off-by: Michael Petlan <mpetlan@redhat.com> --- tools/perf/perf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 2f6b67189b42..91eb36ec6f1c 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -55,6 +55,7 @@ struct cmd_struct { }; static struct cmd_struct commands[] = { + { "archive", NULL, 0 }, { "buildid-cache", cmd_buildid_cache, 0 }, { "buildid-list", cmd_buildid_list, 0 }, { "config", cmd_config, 0 }, @@ -62,6 +63,7 @@ static struct cmd_struct commands[] = { { "diff", cmd_diff, 0 }, { "evlist", cmd_evlist, 0 }, { "help", cmd_help, 0 }, + { "iostat", NULL, 0 }, { "kallsyms", cmd_kallsyms, 0 }, { "list", cmd_list, 0 }, { "record", cmd_record, 0 }, @@ -360,6 +362,8 @@ static void handle_internal_command(int argc, const char **argv) for (i = 0; i < ARRAY_SIZE(commands); i++) { struct cmd_struct *p = commands+i; + if (p->fn == NULL) + continue; if (strcmp(p->cmd, cmd)) continue; exit(run_builtin(p, argc, argv)); -- 2.18.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] perf: Add external commands to list-cmds 2022-04-04 22:15 ` [PATCH 2/2] perf: Add external commands to list-cmds Michael Petlan @ 2022-04-05 20:54 ` Ian Rogers 2022-04-09 15:38 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 6+ messages in thread From: Ian Rogers @ 2022-04-05 20:54 UTC (permalink / raw) To: Michael Petlan; +Cc: linux-perf-users, acme, jolsa On Mon, Apr 4, 2022 at 3:59 PM Michael Petlan <mpetlan@redhat.com> wrote: > > The `perf --list-cmds` output prints only internal commands, although > there is no reason for that from users' perspective. > > Adding the external commands to commands array with NULL function > pointer allows printing all perf commands while not changing the logic > of command handler selection. > > Signed-off-by: Michael Petlan <mpetlan@redhat.com> Acked-by: Ian Rogers <irogers@google.com> Thanks, Ian > --- > tools/perf/perf.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/perf/perf.c b/tools/perf/perf.c > index 2f6b67189b42..91eb36ec6f1c 100644 > --- a/tools/perf/perf.c > +++ b/tools/perf/perf.c > @@ -55,6 +55,7 @@ struct cmd_struct { > }; > > static struct cmd_struct commands[] = { > + { "archive", NULL, 0 }, > { "buildid-cache", cmd_buildid_cache, 0 }, > { "buildid-list", cmd_buildid_list, 0 }, > { "config", cmd_config, 0 }, > @@ -62,6 +63,7 @@ static struct cmd_struct commands[] = { > { "diff", cmd_diff, 0 }, > { "evlist", cmd_evlist, 0 }, > { "help", cmd_help, 0 }, > + { "iostat", NULL, 0 }, > { "kallsyms", cmd_kallsyms, 0 }, > { "list", cmd_list, 0 }, > { "record", cmd_record, 0 }, > @@ -360,6 +362,8 @@ static void handle_internal_command(int argc, const char **argv) > > for (i = 0; i < ARRAY_SIZE(commands); i++) { > struct cmd_struct *p = commands+i; > + if (p->fn == NULL) > + continue; > if (strcmp(p->cmd, cmd)) > continue; > exit(run_builtin(p, argc, argv)); > -- > 2.18.4 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] perf: Add external commands to list-cmds 2022-04-05 20:54 ` Ian Rogers @ 2022-04-09 15:38 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 6+ messages in thread From: Arnaldo Carvalho de Melo @ 2022-04-09 15:38 UTC (permalink / raw) To: Ian Rogers; +Cc: Michael Petlan, linux-perf-users, acme, jolsa Em Tue, Apr 05, 2022 at 01:54:21PM -0700, Ian Rogers escreveu: > On Mon, Apr 4, 2022 at 3:59 PM Michael Petlan <mpetlan@redhat.com> wrote: > > > > The `perf --list-cmds` output prints only internal commands, although > > there is no reason for that from users' perspective. > > > > Adding the external commands to commands array with NULL function > > pointer allows printing all perf commands while not changing the logic > > of command handler selection. > > > > Signed-off-by: Michael Petlan <mpetlan@redhat.com> > > Acked-by: Ian Rogers <irogers@google.com> Thanks, applied. - Arnaldo > Thanks, > Ian > > > --- > > tools/perf/perf.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/tools/perf/perf.c b/tools/perf/perf.c > > index 2f6b67189b42..91eb36ec6f1c 100644 > > --- a/tools/perf/perf.c > > +++ b/tools/perf/perf.c > > @@ -55,6 +55,7 @@ struct cmd_struct { > > }; > > > > static struct cmd_struct commands[] = { > > + { "archive", NULL, 0 }, > > { "buildid-cache", cmd_buildid_cache, 0 }, > > { "buildid-list", cmd_buildid_list, 0 }, > > { "config", cmd_config, 0 }, > > @@ -62,6 +63,7 @@ static struct cmd_struct commands[] = { > > { "diff", cmd_diff, 0 }, > > { "evlist", cmd_evlist, 0 }, > > { "help", cmd_help, 0 }, > > + { "iostat", NULL, 0 }, > > { "kallsyms", cmd_kallsyms, 0 }, > > { "list", cmd_list, 0 }, > > { "record", cmd_record, 0 }, > > @@ -360,6 +362,8 @@ static void handle_internal_command(int argc, const char **argv) > > > > for (i = 0; i < ARRAY_SIZE(commands); i++) { > > struct cmd_struct *p = commands+i; > > + if (p->fn == NULL) > > + continue; > > if (strcmp(p->cmd, cmd)) > > continue; > > exit(run_builtin(p, argc, argv)); > > -- > > 2.18.4 > > -- - Arnaldo ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] perf docs: Add perf-iostat link to manpages 2022-04-04 22:15 [PATCH 1/2] perf docs: Add perf-iostat link to manpages Michael Petlan 2022-04-04 22:15 ` [PATCH 2/2] perf: Add external commands to list-cmds Michael Petlan @ 2022-04-05 20:53 ` Ian Rogers 2022-04-09 15:39 ` Arnaldo Carvalho de Melo 1 sibling, 1 reply; 6+ messages in thread From: Ian Rogers @ 2022-04-05 20:53 UTC (permalink / raw) To: Michael Petlan; +Cc: linux-perf-users, acme, jolsa On Mon, Apr 4, 2022 at 3:59 PM Michael Petlan <mpetlan@redhat.com> wrote: > > Signed-off-by: Michael Petlan <mpetlan@redhat.com> Acked-by: Ian Rogers <irogers@google.com> Thanks, Ian > --- > tools/perf/Documentation/perf.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/Documentation/perf.txt b/tools/perf/Documentation/perf.txt > index 9c330cdfa973..71ebdf8125de 100644 > --- a/tools/perf/Documentation/perf.txt > +++ b/tools/perf/Documentation/perf.txt > @@ -83,7 +83,7 @@ linkperf:perf-buildid-list[1], linkperf:perf-c2c[1], > linkperf:perf-config[1], linkperf:perf-data[1], linkperf:perf-diff[1], > linkperf:perf-evlist[1], linkperf:perf-ftrace[1], > linkperf:perf-help[1], linkperf:perf-inject[1], > -linkperf:perf-intel-pt[1], linkperf:perf-kallsyms[1], > +linkperf:perf-intel-pt[1], linkperf:perf-iostat[1], linkperf:perf-kallsyms[1], > linkperf:perf-kmem[1], linkperf:perf-kvm[1], linkperf:perf-lock[1], > linkperf:perf-mem[1], linkperf:perf-probe[1], linkperf:perf-sched[1], > linkperf:perf-script[1], linkperf:perf-test[1], > -- > 2.18.4 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] perf docs: Add perf-iostat link to manpages 2022-04-05 20:53 ` [PATCH 1/2] perf docs: Add perf-iostat link to manpages Ian Rogers @ 2022-04-09 15:39 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 6+ messages in thread From: Arnaldo Carvalho de Melo @ 2022-04-09 15:39 UTC (permalink / raw) To: Ian Rogers; +Cc: Michael Petlan, linux-perf-users, acme, jolsa Em Tue, Apr 05, 2022 at 01:53:59PM -0700, Ian Rogers escreveu: > On Mon, Apr 4, 2022 at 3:59 PM Michael Petlan <mpetlan@redhat.com> wrote: > > > > Signed-off-by: Michael Petlan <mpetlan@redhat.com> > > Acked-by: Ian Rogers <irogers@google.com> Thanks, applied. - Arnaldo > Thanks, > Ian > > > --- > > tools/perf/Documentation/perf.txt | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/Documentation/perf.txt b/tools/perf/Documentation/perf.txt > > index 9c330cdfa973..71ebdf8125de 100644 > > --- a/tools/perf/Documentation/perf.txt > > +++ b/tools/perf/Documentation/perf.txt > > @@ -83,7 +83,7 @@ linkperf:perf-buildid-list[1], linkperf:perf-c2c[1], > > linkperf:perf-config[1], linkperf:perf-data[1], linkperf:perf-diff[1], > > linkperf:perf-evlist[1], linkperf:perf-ftrace[1], > > linkperf:perf-help[1], linkperf:perf-inject[1], > > -linkperf:perf-intel-pt[1], linkperf:perf-kallsyms[1], > > +linkperf:perf-intel-pt[1], linkperf:perf-iostat[1], linkperf:perf-kallsyms[1], > > linkperf:perf-kmem[1], linkperf:perf-kvm[1], linkperf:perf-lock[1], > > linkperf:perf-mem[1], linkperf:perf-probe[1], linkperf:perf-sched[1], > > linkperf:perf-script[1], linkperf:perf-test[1], > > -- > > 2.18.4 > > -- - Arnaldo ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-09 15:39 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-04-04 22:15 [PATCH 1/2] perf docs: Add perf-iostat link to manpages Michael Petlan 2022-04-04 22:15 ` [PATCH 2/2] perf: Add external commands to list-cmds Michael Petlan 2022-04-05 20:54 ` Ian Rogers 2022-04-09 15:38 ` Arnaldo Carvalho de Melo 2022-04-05 20:53 ` [PATCH 1/2] perf docs: Add perf-iostat link to manpages Ian Rogers 2022-04-09 15:39 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.