All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
@ 2023-12-08  0:05 Ian Rogers
  2023-12-08  0:05 ` [PATCH v1 2/3] perf: Suggest inbuilt commands for unknown command Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ian Rogers @ 2023-12-08  0:05 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Chenyuan Mi, linux-kernel,
	linux-perf-users

uniq will write one command name over another causing the overwritten
string to be leaked. Fix by doing a pass that removes duplicates and a
second that removes the holes.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/lib/subcmd/help.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
index adfbae27dc36..8561b0f01a24 100644
--- a/tools/lib/subcmd/help.c
+++ b/tools/lib/subcmd/help.c
@@ -52,11 +52,21 @@ void uniq(struct cmdnames *cmds)
 	if (!cmds->cnt)
 		return;
 
-	for (i = j = 1; i < cmds->cnt; i++)
-		if (strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
-			cmds->names[j++] = cmds->names[i];
-
+	for (i = 1; i < cmds->cnt; i++) {
+		if (!strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
+			zfree(&cmds->names[i - 1]);
+	}
+	for (i = 0, j = 0; i < cmds->cnt; i++) {
+		if (cmds->names[i]) {
+			if (i == j)
+				j++;
+			else
+				cmds->names[j++] = cmds->names[i];
+		}
+	}
 	cmds->cnt = j;
+	while (j < i)
+		cmds->names[j++] = NULL;
 }
 
 void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 2/3] perf: Suggest inbuilt commands for unknown command
  2023-12-08  0:05 [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
@ 2023-12-08  0:05 ` Ian Rogers
  2023-12-08  0:05 ` [PATCH v1 3/3] perf help: Lower levenshtein penality for deleting character Ian Rogers
  2024-01-02 19:30 ` [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
  2 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2023-12-08  0:05 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Chenyuan Mi, linux-kernel,
	linux-perf-users

The existing unknown command code looks for perf scripts like
perf-archive.sh and perf-iostat.sh, however, inbuilt commands aren't
suggested. Add the inbuilt commands so they may be suggested too.

Before:
```
$ perf reccord
perf: 'reccord' is not a perf-command. See 'perf --help'.
```

After:
```
$ perf reccord
perf: 'reccord' is not a perf-command. See 'perf --help'.

Did you mean this?
        record
```

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/builtin.h               |  4 ++-
 tools/perf/perf.c                  | 21 +++++++++++---
 tools/perf/util/help-unknown-cmd.c | 45 ++++++++++++++----------------
 3 files changed, 41 insertions(+), 29 deletions(-)

diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h
index f2ab5bae2150..f4375deabfa3 100644
--- a/tools/perf/builtin.h
+++ b/tools/perf/builtin.h
@@ -2,8 +2,10 @@
 #ifndef BUILTIN_H
 #define BUILTIN_H
 
+struct cmdnames;
+
 void list_common_cmds_help(void);
-const char *help_unknown_cmd(const char *cmd);
+const char *help_unknown_cmd(const char *cmd, struct cmdnames *main_cmds);
 
 int cmd_annotate(int argc, const char **argv);
 int cmd_bench(int argc, const char **argv);
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 921bee0a6437..c719e6ccd9e2 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -18,6 +18,7 @@
 #include <subcmd/run-command.h>
 #include "util/parse-events.h"
 #include <subcmd/parse-options.h>
+#include <subcmd/help.h>
 #include "util/debug.h"
 #include "util/event.h"
 #include "util/util.h" // usage()
@@ -557,7 +558,7 @@ int main(int argc, const char **argv)
 	pthread__block_sigwinch();
 
 	while (1) {
-		static int done_help;
+		int done_help;
 
 		run_argv(&argc, &argv);
 
@@ -565,14 +566,26 @@ int main(int argc, const char **argv)
 			break;
 
 		if (!done_help) {
-			cmd = argv[0] = help_unknown_cmd(cmd);
+			struct cmdnames main_cmds;
+
+			for (unsigned int i = 0; i < ARRAY_SIZE(commands); i++) {
+				add_cmdname(&main_cmds,
+					    commands[i].cmd,
+					    strlen(commands[i].cmd));
+			}
+			cmd = argv[0] = help_unknown_cmd(cmd, &main_cmds);
+			clean_cmdnames(&main_cmds);
 			done_help = 1;
+			if (!cmd)
+				break;
 		} else
 			break;
 	}
 
-	fprintf(stderr, "Failed to run command '%s': %s\n",
-		cmd, str_error_r(errno, sbuf, sizeof(sbuf)));
+	if (cmd) {
+		fprintf(stderr, "Failed to run command '%s': %s\n",
+			cmd, str_error_r(errno, sbuf, sizeof(sbuf)));
+	}
 out:
 	if (debug_fp)
 		fclose(debug_fp);
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c
index eab99ea6ac01..2ba3369f1620 100644
--- a/tools/perf/util/help-unknown-cmd.c
+++ b/tools/perf/util/help-unknown-cmd.c
@@ -52,46 +52,44 @@ static int add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
 	return 0;
 }
 
-const char *help_unknown_cmd(const char *cmd)
+const char *help_unknown_cmd(const char *cmd, struct cmdnames *main_cmds)
 {
 	unsigned int i, n = 0, best_similarity = 0;
-	struct cmdnames main_cmds, other_cmds;
+	struct cmdnames other_cmds;
 
-	memset(&main_cmds, 0, sizeof(main_cmds));
-	memset(&other_cmds, 0, sizeof(main_cmds));
+	memset(&other_cmds, 0, sizeof(other_cmds));
 
 	perf_config(perf_unknown_cmd_config, NULL);
 
-	load_command_list("perf-", &main_cmds, &other_cmds);
+	load_command_list("perf-", main_cmds, &other_cmds);
 
-	if (add_cmd_list(&main_cmds, &other_cmds) < 0) {
+	if (add_cmd_list(main_cmds, &other_cmds) < 0) {
 		fprintf(stderr, "ERROR: Failed to allocate command list for unknown command.\n");
 		goto end;
 	}
-	qsort(main_cmds.names, main_cmds.cnt,
-	      sizeof(main_cmds.names), cmdname_compare);
-	uniq(&main_cmds);
+	qsort(main_cmds->names, main_cmds->cnt,
+	      sizeof(main_cmds->names), cmdname_compare);
+	uniq(main_cmds);
 
-	if (main_cmds.cnt) {
+	if (main_cmds->cnt) {
 		/* This reuses cmdname->len for similarity index */
-		for (i = 0; i < main_cmds.cnt; ++i)
-			main_cmds.names[i]->len =
-				levenshtein(cmd, main_cmds.names[i]->name, 0, 2, 1, 4);
+		for (i = 0; i < main_cmds->cnt; ++i)
+			main_cmds->names[i]->len =
+				levenshtein(cmd, main_cmds->names[i]->name, 0, 2, 1, 4);
 
-		qsort(main_cmds.names, main_cmds.cnt,
-		      sizeof(*main_cmds.names), levenshtein_compare);
+		qsort(main_cmds->names, main_cmds->cnt,
+		      sizeof(*main_cmds->names), levenshtein_compare);
 
-		best_similarity = main_cmds.names[0]->len;
+		best_similarity = main_cmds->names[0]->len;
 		n = 1;
-		while (n < main_cmds.cnt && best_similarity == main_cmds.names[n]->len)
+		while (n < main_cmds->cnt && best_similarity == main_cmds->names[n]->len)
 			++n;
 	}
 
 	if (autocorrect && n == 1) {
-		const char *assumed = main_cmds.names[0]->name;
+		const char *assumed = main_cmds->names[0]->name;
 
-		main_cmds.names[0] = NULL;
-		clean_cmdnames(&main_cmds);
+		main_cmds->names[0] = NULL;
 		clean_cmdnames(&other_cmds);
 		fprintf(stderr, "WARNING: You called a perf program named '%s', "
 			"which does not exist.\n"
@@ -107,15 +105,14 @@ const char *help_unknown_cmd(const char *cmd)
 
 	fprintf(stderr, "perf: '%s' is not a perf-command. See 'perf --help'.\n", cmd);
 
-	if (main_cmds.cnt && best_similarity < 6) {
+	if (main_cmds->cnt && best_similarity < 6) {
 		fprintf(stderr, "\nDid you mean %s?\n",
 			n < 2 ? "this": "one of these");
 
 		for (i = 0; i < n; i++)
-			fprintf(stderr, "\t%s\n", main_cmds.names[i]->name);
+			fprintf(stderr, "\t%s\n", main_cmds->names[i]->name);
 	}
 end:
-	clean_cmdnames(&main_cmds);
 	clean_cmdnames(&other_cmds);
-	exit(1);
+	return NULL;
 }
-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 3/3] perf help: Lower levenshtein penality for deleting character
  2023-12-08  0:05 [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
  2023-12-08  0:05 ` [PATCH v1 2/3] perf: Suggest inbuilt commands for unknown command Ian Rogers
@ 2023-12-08  0:05 ` Ian Rogers
  2024-01-02 19:30 ` [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
  2 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2023-12-08  0:05 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Chenyuan Mi, linux-kernel,
	linux-perf-users

The levenshtein penalty for deleting a character was far higher than
subsituting or inserting a character. Lower the penalty to match that
of inserting a character.

Before:
```
$ perf recccord
perf: 'recccord' is not a perf-command. See 'perf --help'.
```

After:
```
$ perf recccord
perf: 'recccord' is not a perf-command. See 'perf --help'.

Did you mean this?
        record
```

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/help-unknown-cmd.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c
index 2ba3369f1620..a0a46e34f8d1 100644
--- a/tools/perf/util/help-unknown-cmd.c
+++ b/tools/perf/util/help-unknown-cmd.c
@@ -73,10 +73,14 @@ const char *help_unknown_cmd(const char *cmd, struct cmdnames *main_cmds)
 
 	if (main_cmds->cnt) {
 		/* This reuses cmdname->len for similarity index */
-		for (i = 0; i < main_cmds->cnt; ++i)
+		for (i = 0; i < main_cmds->cnt; ++i) {
 			main_cmds->names[i]->len =
-				levenshtein(cmd, main_cmds->names[i]->name, 0, 2, 1, 4);
-
+				levenshtein(cmd, main_cmds->names[i]->name,
+					/*swap_penalty=*/0,
+					/*substition_penality=*/2,
+					/*insertion_penality=*/1,
+					/*deletion_penalty=*/1);
+		}
 		qsort(main_cmds->names, main_cmds->cnt,
 		      sizeof(*main_cmds->names), levenshtein_compare);
 
-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2023-12-08  0:05 [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
  2023-12-08  0:05 ` [PATCH v1 2/3] perf: Suggest inbuilt commands for unknown command Ian Rogers
  2023-12-08  0:05 ` [PATCH v1 3/3] perf help: Lower levenshtein penality for deleting character Ian Rogers
@ 2024-01-02 19:30 ` Ian Rogers
  2024-01-04 17:56   ` Ian Rogers
  2024-01-04 21:03   ` Arnaldo Carvalho de Melo
  2 siblings, 2 replies; 9+ messages in thread
From: Ian Rogers @ 2024-01-02 19:30 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Chenyuan Mi, linux-kernel,
	linux-perf-users

On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
>
> uniq will write one command name over another causing the overwritten
> string to be leaked. Fix by doing a pass that removes duplicates and a
> second that removes the holes.
>
> Signed-off-by: Ian Rogers <irogers@google.com>

Ping for this series, no comments since sent.

Thanks,
Ian

> ---
>  tools/lib/subcmd/help.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
> index adfbae27dc36..8561b0f01a24 100644
> --- a/tools/lib/subcmd/help.c
> +++ b/tools/lib/subcmd/help.c
> @@ -52,11 +52,21 @@ void uniq(struct cmdnames *cmds)
>         if (!cmds->cnt)
>                 return;
>
> -       for (i = j = 1; i < cmds->cnt; i++)
> -               if (strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
> -                       cmds->names[j++] = cmds->names[i];
> -
> +       for (i = 1; i < cmds->cnt; i++) {
> +               if (!strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
> +                       zfree(&cmds->names[i - 1]);
> +       }
> +       for (i = 0, j = 0; i < cmds->cnt; i++) {
> +               if (cmds->names[i]) {
> +                       if (i == j)
> +                               j++;
> +                       else
> +                               cmds->names[j++] = cmds->names[i];
> +               }
> +       }
>         cmds->cnt = j;
> +       while (j < i)
> +               cmds->names[j++] = NULL;
>  }
>
>  void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
> --
> 2.43.0.472.g3155946c3a-goog
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2024-01-02 19:30 ` [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
@ 2024-01-04 17:56   ` Ian Rogers
  2024-01-04 21:03   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2024-01-04 17:56 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Chenyuan Mi, linux-kernel,
	linux-perf-users

On Tue, Jan 2, 2024 at 11:30 AM Ian Rogers <irogers@google.com> wrote:
>
> On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
> >
> > uniq will write one command name over another causing the overwritten
> > string to be leaked. Fix by doing a pass that removes duplicates and a
> > second that removes the holes.
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> Ping for this series, no comments since sent.

Would be nice to land this set, especially for giving suggestions for
inbuilt commands:
https://lore.kernel.org/lkml/20231208000515.1693746-2-irogers@google.com/

Thanks,
Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2024-01-02 19:30 ` [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
  2024-01-04 17:56   ` Ian Rogers
@ 2024-01-04 21:03   ` Arnaldo Carvalho de Melo
  2024-01-04 23:29     ` Ian Rogers
  1 sibling, 1 reply; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-01-04 21:03 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Adrian Hunter, Chenyuan Mi,
	linux-kernel, linux-perf-users

Em Tue, Jan 02, 2024 at 11:30:39AM -0800, Ian Rogers escreveu:
> On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
> >
> > uniq will write one command name over another causing the overwritten
> > string to be leaked. Fix by doing a pass that removes duplicates and a
> > second that removes the holes.
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
> 
> Ping for this series, no comments since sent.

I applied the first one, the fix for uniq(), but somehow the second
didn't work for me as in your examples, nor the third, the output is the
same as before.

- Arnaldo
 
> Thanks,
> Ian
> 
> > ---
> >  tools/lib/subcmd/help.c | 18 ++++++++++++++----
> >  1 file changed, 14 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
> > index adfbae27dc36..8561b0f01a24 100644
> > --- a/tools/lib/subcmd/help.c
> > +++ b/tools/lib/subcmd/help.c
> > @@ -52,11 +52,21 @@ void uniq(struct cmdnames *cmds)
> >         if (!cmds->cnt)
> >                 return;
> >
> > -       for (i = j = 1; i < cmds->cnt; i++)
> > -               if (strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
> > -                       cmds->names[j++] = cmds->names[i];
> > -
> > +       for (i = 1; i < cmds->cnt; i++) {
> > +               if (!strcmp(cmds->names[i]->name, cmds->names[i-1]->name))
> > +                       zfree(&cmds->names[i - 1]);
> > +       }
> > +       for (i = 0, j = 0; i < cmds->cnt; i++) {
> > +               if (cmds->names[i]) {
> > +                       if (i == j)
> > +                               j++;
> > +                       else
> > +                               cmds->names[j++] = cmds->names[i];
> > +               }
> > +       }
> >         cmds->cnt = j;
> > +       while (j < i)
> > +               cmds->names[j++] = NULL;
> >  }
> >
> >  void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
> > --
> > 2.43.0.472.g3155946c3a-goog
> >
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2024-01-04 21:03   ` Arnaldo Carvalho de Melo
@ 2024-01-04 23:29     ` Ian Rogers
  2024-01-05 14:53       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Rogers @ 2024-01-04 23:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Adrian Hunter, Chenyuan Mi,
	linux-kernel, linux-perf-users

On Thu, Jan 4, 2024 at 1:03 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> Em Tue, Jan 02, 2024 at 11:30:39AM -0800, Ian Rogers escreveu:
> > On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
> > >
> > > uniq will write one command name over another causing the overwritten
> > > string to be leaked. Fix by doing a pass that removes duplicates and a
> > > second that removes the holes.
> > >
> > > Signed-off-by: Ian Rogers <irogers@google.com>
> >
> > Ping for this series, no comments since sent.
>
> I applied the first one, the fix for uniq(), but somehow the second
> didn't work for me as in your examples, nor the third, the output is the
> same as before.

I tried to repro the failure with a rebase but couldn't. I suspected
libsubcmd wasn't being rebuilt or something like that. I suspect now
that you have ~/.perfconfig with help.autocorrect set, which means the
output will vary as it will automatically try to run the autocorrected
command. Could you check for me?

Thanks,
Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2024-01-04 23:29     ` Ian Rogers
@ 2024-01-05 14:53       ` Arnaldo Carvalho de Melo
  2024-01-06  5:44         ` Ian Rogers
  0 siblings, 1 reply; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-01-05 14:53 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Adrian Hunter, Chenyuan Mi,
	linux-kernel, linux-perf-users

Em Thu, Jan 04, 2024 at 03:29:34PM -0800, Ian Rogers escreveu:
> On Thu, Jan 4, 2024 at 1:03 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > Em Tue, Jan 02, 2024 at 11:30:39AM -0800, Ian Rogers escreveu:
> > > On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
> > > > uniq will write one command name over another causing the overwritten
> > > > string to be leaked. Fix by doing a pass that removes duplicates and a
> > > > second that removes the holes.

> > I applied the first one, the fix for uniq(), but somehow the second
> > didn't work for me as in your examples, nor the third, the output is the
> > same as before.
 
> I tried to repro the failure with a rebase but couldn't. I suspected
> libsubcmd wasn't being rebuilt or something like that. I suspect now
> that you have ~/.perfconfig with help.autocorrect set, which means the
> output will vary as it will automatically try to run the autocorrected
> command. Could you check for me?

[acme@quaco perf-tools-next]$ perf reccord
Failed to run command 'reccord': No such file or directory
[acme@quaco perf-tools-next]$ perf -v
perf version 6.7.rc6.gcd1e3ef8bfe8
[acme@quaco perf-tools-next]$ git log --oneline -5
cd1e3ef8bfe8f827 (HEAD -> perf-tools-next) perf help: Lower levenshtein penality for deleting character
c5c7365af812728e perf: Suggest inbuilt commands for unknown command
b6d8b858dbbbd832 (perf-tools-next.korg/tmp.perf-tools-next, perf-tools-next.korg/perf-tools-next, number/perf-tools-next, five/perf-tools-next, acme.korg/tmp.perf-tools-next, acme.korg/perf-tools-next) perf test: test case 'Setup struct perf_event_attr' fails on s390 on z/vm
1e24ce402c97dc3c (perf-tools-next/tmp.perf-tools-next, acme/tmp.perf-tools-next) perf db-export: Fix missing reference count get in call_path_from_sample()
bb177a85e82b37d3 perf tests: Add perf script test
[acme@quaco perf-tools-next]$ perf reccord
Failed to run command 'reccord': No such file or directory
[acme@quaco perf-tools-next]$ cat ~/.perfconfig
[acme@quaco perf-tools-next]$ sudo cat /etc/perfconfig
[sudo] password for acme:
cat: /etc/perfconfig: No such file or directory
[acme@quaco perf-tools-next]$
[acme@quaco perf-tools-next]$
[acme@quaco perf-tools-next]$ sudo su -
[root@quaco ~]# perf -v
perf version 6.7.rc6.gcd1e3ef8bfe8
[root@quaco ~]# perf reccord
Failed to run command 'reccord': No such file or directory
[root@quaco ~]# cat ~/.perfconfig
[root@quaco ~]# perf trace -e open*,access* perf reccord
     0.000 ( 0.006 ms): perf/10791 access(filename: "/etc/ld.so.preload", mode: R)                       = -1 ENOENT (No such file or directory)
     0.012 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/etc/ld.so.cache", flags: RDONLY|CLOEXEC) = 3
     0.035 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunwind-x86_64.so.8", flags: RDONLY|CLOEXEC) = 3
     0.084 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunwind.so.8", flags: RDONLY|CLOEXEC) = 3
     0.128 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/liblzma.so.5", flags: RDONLY|CLOEXEC) = 3
     0.170 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libm.so.6", flags: RDONLY|CLOEXEC) = 3
     0.221 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libopencsd_c_api.so.1", flags: RDONLY|CLOEXEC) = 3
     0.264 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libz.so.1", flags: RDONLY|CLOEXEC) = 3
     0.305 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libelf.so.1", flags: RDONLY|CLOEXEC) = 3
     0.348 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libdebuginfod.so.1", flags: RDONLY|CLOEXEC) = 3
     0.386 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libdw.so.1", flags: RDONLY|CLOEXEC) = 3
     0.428 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcrypto.so.3", flags: RDONLY|CLOEXEC) = 3
     0.480 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libslang.so.2", flags: RDONLY|CLOEXEC) = 3
     0.526 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libperl.so.5.36", flags: RDONLY|CLOEXEC) = 3
     0.575 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libc.so.6", flags: RDONLY|CLOEXEC) = 3
     0.628 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpython3.11.so.1.0", flags: RDONLY|CLOEXEC) = 3
     0.675 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libstdc++.so.6", flags: RDONLY|CLOEXEC) = 3
     0.729 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libzstd.so.1", flags: RDONLY|CLOEXEC) = 3
     0.772 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcap.so.2", flags: RDONLY|CLOEXEC) = 3
     0.811 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libnuma.so.1", flags: RDONLY|CLOEXEC) = 3
     0.849 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbabeltrace-ctf.so.1", flags: RDONLY|CLOEXEC) = 3
     0.895 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpfm.so.4", flags: RDONLY|CLOEXEC) = 3
     0.940 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libtraceevent.so.1", flags: RDONLY|CLOEXEC) = 3
     0.976 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgcc_s.so.1", flags: RDONLY|CLOEXEC) = 3
     1.023 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libopencsd.so.1", flags: RDONLY|CLOEXEC) = 3
     1.071 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcurl.so.4", flags: RDONLY|CLOEXEC) = 3
     1.116 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbz2.so.1", flags: RDONLY|CLOEXEC) = 3
     1.157 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcrypt.so.2", flags: RDONLY|CLOEXEC) = 3
     1.216 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbabeltrace.so.1", flags: RDONLY|CLOEXEC) = 3
     1.260 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpopt.so.0", flags: RDONLY|CLOEXEC) = 3
     1.299 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libuuid.so.1", flags: RDONLY|CLOEXEC) = 3
     1.341 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgmodule-2.0.so.0", flags: RDONLY|CLOEXEC) = 3
     1.382 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libglib-2.0.so.0", flags: RDONLY|CLOEXEC) = 3
     1.438 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libnghttp2.so.14", flags: RDONLY|CLOEXEC) = 3
     1.478 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libidn2.so.0", flags: RDONLY|CLOEXEC) = 3
     1.525 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libssh.so.4", flags: RDONLY|CLOEXEC) = 3
     1.576 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpsl.so.5", flags: RDONLY|CLOEXEC) = 3
     1.621 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libssl.so.3", flags: RDONLY|CLOEXEC) = 3
     1.663 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgssapi_krb5.so.2", flags: RDONLY|CLOEXEC) = 3
     1.707 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libldap.so.2", flags: RDONLY|CLOEXEC) = 3
     1.755 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/liblber.so.2", flags: RDONLY|CLOEXEC) = 3
     1.795 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbrotlidec.so.1", flags: RDONLY|CLOEXEC) = 3
     1.852 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpcre2-8.so.0", flags: RDONLY|CLOEXEC) = 3
     1.899 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunistring.so.2", flags: RDONLY|CLOEXEC) = 3
     1.948 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkrb5.so.3", flags: RDONLY|CLOEXEC) = 3
     1.997 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libk5crypto.so.3", flags: RDONLY|CLOEXEC) = 3
     2.040 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcom_err.so.2", flags: RDONLY|CLOEXEC) = 3
     2.089 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkrb5support.so.0", flags: RDONLY|CLOEXEC) = 3
     2.132 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkeyutils.so.1", flags: RDONLY|CLOEXEC) = 3
     2.175 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libresolv.so.2", flags: RDONLY|CLOEXEC) = 3
     2.237 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libevent-2.1.so.7", flags: RDONLY|CLOEXEC) = 3
     2.288 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libsasl2.so.3", flags: RDONLY|CLOEXEC) = 3
     2.337 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbrotlicommon.so.1", flags: RDONLY|CLOEXEC) = 3
     2.399 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libselinux.so.1", flags: RDONLY|CLOEXEC) = 3
     9.457 ( 0.006 ms): perf/10791 access(filename: "/etc/selinux/config")                               = 0
     9.719 ( 0.014 ms): perf/10791 openat(dfd: CWD, filename: "/proc/self/status")                       = 3
     9.759 ( 0.007 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/node", flags: RDONLY|CLOEXEC|DIRECTORY|NONBLOCK) = 3
     9.786 ( 0.006 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/node/node0/meminfo")  = 4
     9.825 ( 0.006 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/cpu/possible", flags: RDONLY|CLOEXEC) = 3
     9.837 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/proc/self/status")                       = 3
     9.962 ( 0.005 ms): perf/10791 access(filename: "/home/acme/etc/perfconfig", mode: R)                = -1 ENOENT (No such file or directory)
Failed to run command 'reccord': No such file or directory
[root@quaco ~]#
[root@quaco ~]# perf -vv
perf version 6.7.rc6.gcd1e3ef8bfe8
                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
            debuginfod: [ on  ]  # HAVE_DEBUGINFOD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ on  ]  # HAVE_LIBPFM
         libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
         bpf_skeletons: [ on  ]  # HAVE_BPF_SKEL
[root@quaco ~]#

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq
  2024-01-05 14:53       ` Arnaldo Carvalho de Melo
@ 2024-01-06  5:44         ` Ian Rogers
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2024-01-06  5:44 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Adrian Hunter, Chenyuan Mi,
	linux-kernel, linux-perf-users

On Fri, Jan 5, 2024 at 6:54 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> Em Thu, Jan 04, 2024 at 03:29:34PM -0800, Ian Rogers escreveu:
> > On Thu, Jan 4, 2024 at 1:03 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > Em Tue, Jan 02, 2024 at 11:30:39AM -0800, Ian Rogers escreveu:
> > > > On Thu, Dec 7, 2023 at 4:05 PM Ian Rogers <irogers@google.com> wrote:
> > > > > uniq will write one command name over another causing the overwritten
> > > > > string to be leaked. Fix by doing a pass that removes duplicates and a
> > > > > second that removes the holes.
>
> > > I applied the first one, the fix for uniq(), but somehow the second
> > > didn't work for me as in your examples, nor the third, the output is the
> > > same as before.
>
> > I tried to repro the failure with a rebase but couldn't. I suspected
> > libsubcmd wasn't being rebuilt or something like that. I suspect now
> > that you have ~/.perfconfig with help.autocorrect set, which means the
> > output will vary as it will automatically try to run the autocorrected
> > command. Could you check for me?
>
> [acme@quaco perf-tools-next]$ perf reccord
> Failed to run command 'reccord': No such file or directory
> [acme@quaco perf-tools-next]$ perf -v
> perf version 6.7.rc6.gcd1e3ef8bfe8
> [acme@quaco perf-tools-next]$ git log --oneline -5
> cd1e3ef8bfe8f827 (HEAD -> perf-tools-next) perf help: Lower levenshtein penality for deleting character
> c5c7365af812728e perf: Suggest inbuilt commands for unknown command
> b6d8b858dbbbd832 (perf-tools-next.korg/tmp.perf-tools-next, perf-tools-next.korg/perf-tools-next, number/perf-tools-next, five/perf-tools-next, acme.korg/tmp.perf-tools-next, acme.korg/perf-tools-next) perf test: test case 'Setup struct perf_event_attr' fails on s390 on z/vm
> 1e24ce402c97dc3c (perf-tools-next/tmp.perf-tools-next, acme/tmp.perf-tools-next) perf db-export: Fix missing reference count get in call_path_from_sample()
> bb177a85e82b37d3 perf tests: Add perf script test
> [acme@quaco perf-tools-next]$ perf reccord
> Failed to run command 'reccord': No such file or directory
> [acme@quaco perf-tools-next]$ cat ~/.perfconfig
> [acme@quaco perf-tools-next]$ sudo cat /etc/perfconfig
> [sudo] password for acme:
> cat: /etc/perfconfig: No such file or directory
> [acme@quaco perf-tools-next]$
> [acme@quaco perf-tools-next]$
> [acme@quaco perf-tools-next]$ sudo su -
> [root@quaco ~]# perf -v
> perf version 6.7.rc6.gcd1e3ef8bfe8
> [root@quaco ~]# perf reccord
> Failed to run command 'reccord': No such file or directory
> [root@quaco ~]# cat ~/.perfconfig
> [root@quaco ~]# perf trace -e open*,access* perf reccord
>      0.000 ( 0.006 ms): perf/10791 access(filename: "/etc/ld.so.preload", mode: R)                       = -1 ENOENT (No such file or directory)
>      0.012 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/etc/ld.so.cache", flags: RDONLY|CLOEXEC) = 3
>      0.035 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunwind-x86_64.so.8", flags: RDONLY|CLOEXEC) = 3
>      0.084 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunwind.so.8", flags: RDONLY|CLOEXEC) = 3
>      0.128 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/liblzma.so.5", flags: RDONLY|CLOEXEC) = 3
>      0.170 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libm.so.6", flags: RDONLY|CLOEXEC) = 3
>      0.221 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libopencsd_c_api.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.264 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libz.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.305 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libelf.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.348 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libdebuginfod.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.386 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libdw.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.428 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcrypto.so.3", flags: RDONLY|CLOEXEC) = 3
>      0.480 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libslang.so.2", flags: RDONLY|CLOEXEC) = 3
>      0.526 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libperl.so.5.36", flags: RDONLY|CLOEXEC) = 3
>      0.575 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libc.so.6", flags: RDONLY|CLOEXEC) = 3
>      0.628 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpython3.11.so.1.0", flags: RDONLY|CLOEXEC) = 3
>      0.675 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libstdc++.so.6", flags: RDONLY|CLOEXEC) = 3
>      0.729 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libzstd.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.772 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcap.so.2", flags: RDONLY|CLOEXEC) = 3
>      0.811 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libnuma.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.849 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbabeltrace-ctf.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.895 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpfm.so.4", flags: RDONLY|CLOEXEC) = 3
>      0.940 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libtraceevent.so.1", flags: RDONLY|CLOEXEC) = 3
>      0.976 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgcc_s.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.023 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libopencsd.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.071 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcurl.so.4", flags: RDONLY|CLOEXEC) = 3
>      1.116 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbz2.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.157 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcrypt.so.2", flags: RDONLY|CLOEXEC) = 3
>      1.216 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbabeltrace.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.260 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpopt.so.0", flags: RDONLY|CLOEXEC) = 3
>      1.299 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libuuid.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.341 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgmodule-2.0.so.0", flags: RDONLY|CLOEXEC) = 3
>      1.382 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libglib-2.0.so.0", flags: RDONLY|CLOEXEC) = 3
>      1.438 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libnghttp2.so.14", flags: RDONLY|CLOEXEC) = 3
>      1.478 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libidn2.so.0", flags: RDONLY|CLOEXEC) = 3
>      1.525 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libssh.so.4", flags: RDONLY|CLOEXEC) = 3
>      1.576 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpsl.so.5", flags: RDONLY|CLOEXEC) = 3
>      1.621 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libssl.so.3", flags: RDONLY|CLOEXEC) = 3
>      1.663 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libgssapi_krb5.so.2", flags: RDONLY|CLOEXEC) = 3
>      1.707 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libldap.so.2", flags: RDONLY|CLOEXEC) = 3
>      1.755 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/liblber.so.2", flags: RDONLY|CLOEXEC) = 3
>      1.795 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbrotlidec.so.1", flags: RDONLY|CLOEXEC) = 3
>      1.852 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libpcre2-8.so.0", flags: RDONLY|CLOEXEC) = 3
>      1.899 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libunistring.so.2", flags: RDONLY|CLOEXEC) = 3
>      1.948 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkrb5.so.3", flags: RDONLY|CLOEXEC) = 3
>      1.997 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libk5crypto.so.3", flags: RDONLY|CLOEXEC) = 3
>      2.040 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libcom_err.so.2", flags: RDONLY|CLOEXEC) = 3
>      2.089 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkrb5support.so.0", flags: RDONLY|CLOEXEC) = 3
>      2.132 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libkeyutils.so.1", flags: RDONLY|CLOEXEC) = 3
>      2.175 ( 0.004 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libresolv.so.2", flags: RDONLY|CLOEXEC) = 3
>      2.237 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libevent-2.1.so.7", flags: RDONLY|CLOEXEC) = 3
>      2.288 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libsasl2.so.3", flags: RDONLY|CLOEXEC) = 3
>      2.337 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libbrotlicommon.so.1", flags: RDONLY|CLOEXEC) = 3
>      2.399 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/lib64/libselinux.so.1", flags: RDONLY|CLOEXEC) = 3
>      9.457 ( 0.006 ms): perf/10791 access(filename: "/etc/selinux/config")                               = 0
>      9.719 ( 0.014 ms): perf/10791 openat(dfd: CWD, filename: "/proc/self/status")                       = 3
>      9.759 ( 0.007 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/node", flags: RDONLY|CLOEXEC|DIRECTORY|NONBLOCK) = 3
>      9.786 ( 0.006 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/node/node0/meminfo")  = 4
>      9.825 ( 0.006 ms): perf/10791 openat(dfd: CWD, filename: "/sys/devices/system/cpu/possible", flags: RDONLY|CLOEXEC) = 3
>      9.837 ( 0.005 ms): perf/10791 openat(dfd: CWD, filename: "/proc/self/status")                       = 3
>      9.962 ( 0.005 ms): perf/10791 access(filename: "/home/acme/etc/perfconfig", mode: R)                = -1 ENOENT (No such file or directory)
> Failed to run command 'reccord': No such file or directory
> [root@quaco ~]#
> [root@quaco ~]# perf -vv
> perf version 6.7.rc6.gcd1e3ef8bfe8
>                  dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
>     dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
>          syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
>                 libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
>             debuginfod: [ on  ]  # HAVE_DEBUGINFOD_SUPPORT
>                 libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
>                libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
>                libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
>              libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
>               libslang: [ on  ]  # HAVE_SLANG_SUPPORT
>              libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
>              libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
>     libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
>                   zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
>                   lzma: [ on  ]  # HAVE_LZMA_SUPPORT
>              get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
>                    bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
>                    aio: [ on  ]  # HAVE_AIO_SUPPORT
>                   zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
>                libpfm4: [ on  ]  # HAVE_LIBPFM
>          libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
>          bpf_skeletons: [ on  ]  # HAVE_BPF_SKEL
> [root@quaco ~]#

Thanks Arnaldo,

I tried b4 am-ing the patches and repro-ing in a clean tree. I'm still
not able to do it. Knowing what is going on in help_unknown_cmd in
tools/perf/util/help-unknown-cmd.c would shed some light on the
matter. I'll see if I can get other ideas.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-06  5:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08  0:05 [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
2023-12-08  0:05 ` [PATCH v1 2/3] perf: Suggest inbuilt commands for unknown command Ian Rogers
2023-12-08  0:05 ` [PATCH v1 3/3] perf help: Lower levenshtein penality for deleting character Ian Rogers
2024-01-02 19:30 ` [PATCH v1 1/3] lib subcmd: Fix memory leak in uniq Ian Rogers
2024-01-04 17:56   ` Ian Rogers
2024-01-04 21:03   ` Arnaldo Carvalho de Melo
2024-01-04 23:29     ` Ian Rogers
2024-01-05 14:53       ` Arnaldo Carvalho de Melo
2024-01-06  5:44         ` Ian Rogers

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.