Skip to contentSkip to conversation

perf docs: Add perf-iostat link to manpages

PATCH Applied Michael Petlan 3 participants 6 messages Apr 4, 2022 – Apr 9, 2022 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 perf docs: Add perf-iostat link to manpages

---
 tools/perf/Documentation/perf.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf.txt +1 -1
index 9c330cdfa973..71ebdf8125de 100644
@@ -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],
Signature · 1 line
2.18.4
#1 lore raw

PATCH 2/2 perf: Add external commands to list-cmds

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.

---
 tools/perf/perf.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/perf.c +4 -0
index 2f6b67189b42..91eb36ec6f1c 100644
@@ -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));
Signature · 1 line
2.18.4
reviewer Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] perf: Add external commands to list-cmds

Quoted 9 lines · Michael Petlan

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.

Thanks,
Ian

Quoted 36 lines
---
 tools/perf/perf.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/perf.c +4 -1
index 2f6b67189b42..91eb36ec6f1c 100644
@@ -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

maintainer Applied
#3 lore raw

Re: [PATCH 2/2] perf: Add external commands to list-cmds

Em Tue, Apr 05, 2022 at 01:54:21PM -0700, Ian Rogers escreveu:

Quoted 5 lines · Michael Petlan
Quoted 4 lines

The perf --list-cmds output prints only internal commands, although there is no reason for that from users' perspective.

Quoted 7 lines
Quoted 5 lines

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.

Thanks, applied.

- Arnaldo

Quoted 39 lines

Thanks,
Ian

Quoted 36 lines
---
 tools/perf/perf.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/perf.c +4 -1
index 2f6b67189b42..91eb36ec6f1c 100644
@@ -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

Signature · 1 line
- Arnaldo
reviewer Acked-by on v1 1/2
#4 lore raw
In reply to Michael Petlan
Quoted 2 lines · Michael Petlan

Thanks,
Ian

Quoted 20 lines
---
 tools/perf/Documentation/perf.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf.txt +1 -2
index 9c330cdfa973..71ebdf8125de 100644
@@ -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

maintainer Applied
#5 lore raw

Em Tue, Apr 05, 2022 at 01:53:59PM -0700, Ian Rogers escreveu:

Quoted 5 lines · Michael Petlan
Quoted 2 lines

Thanks, applied.

- Arnaldo

Quoted 23 lines

Thanks,
Ian

Quoted 20 lines
---
 tools/perf/Documentation/perf.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf.txt +1 -2
index 9c330cdfa973..71ebdf8125de 100644
@@ -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

Signature · 1 line
- Arnaldo