Skip to contentSkip to conversation

perf help: Document missing options

PATCH Applied Sihyeon Jang 5 participants 14 messages Nov 12, 2017 – Nov 29, 2017 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 perf help: Document missing options

Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-help.txt +13 -1
index 5143918..bb605af 100644
@@ -7,7 +7,7 @@ perf-help - display help information about perf
 
 SYNOPSIS
 --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]
 
 DESCRIPTION
 -----------
@@ -33,6 +33,18 @@ OPTIONS
 	Prints all the available commands on the standard output. This
 	option supersedes any other option.
 
+-i::
+--info::
+	Shows info page.
+
+-m::
+--man::
+	Shows man page.
+
+-w::
+--web::
+	Shows manual in web browser.
+
 PERF
 ----
 Part of the linkperf:perf[1] suite
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 perf top: Document missing options

Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/Documentation/perf-top.txt | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/Documentation/perf-top.txt +6 -0
index 4353262..8a32cc7 100644
@@ -268,6 +268,12 @@ INTERACTIVE PROMPTING KEYS
 [S]::
 	Stop annotation, return to full profile display.
 
+[K]::
+	Hide kernel symbols.
+
+[U]::
+	Hide user symbols.
+
 [z]::
 	Toggle event count zeroing across display updates.
 
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw

Re: [PATCH 2/3] perf top: Document missing options

Em Sun, Nov 12, 2017 at 10:10:46AM +0900, Sihyeon Jang escreveu:

Quoted 3 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>

applied

Quoted 23 lines
---
 tools/perf/Documentation/perf-top.txt | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/Documentation/perf-top.txt +6 -0
index 4353262..8a32cc7 100644
@@ -268,6 +268,12 @@ INTERACTIVE PROMPTING KEYS
 [S]::
 	Stop annotation, return to full profile display.
 
+[K]::
+	Hide kernel symbols.
+
+[U]::
+	Hide user symbols.
+
 [z]::
 	Toggle event count zeroing across display updates.
 
Signature · 1 line
2.7.4
#3 lore raw

[tip:perf/core] perf top: Document missing options

In reply to Sihyeon Jang
perf top: Document missing options
Commit-ID:  958964f803b27baffd238708842b527a1d30e110
Gitweb:     https://git.kernel.org/tip/958964f803b27baffd238708842b527a1d30e110
Author:     Sihyeon Jang <[email protected]>
AuthorDate: Sun, 12 Nov 2017 10:10:46 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 16 Nov 2017 14:49:56 -0300

perf top: Document missing options

---
 tools/perf/Documentation/perf-top.txt | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/Documentation/perf-top.txt +6 -0
index 4353262..8a32cc7 100644
@@ -268,6 +268,12 @@ INTERACTIVE PROMPTING KEYS
 [S]::
 	Stop annotation, return to full profile display.
 
+[K]::
+	Hide kernel symbols.
+
+[U]::
+	Hide user symbols.
+
 [z]::
 	Toggle event count zeroing across display updates.
 
#4 lore raw

PATCH 3/3 perf top: Remove a duplicate word

In reply to Sihyeon Jang
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/builtin-top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-top.c +1 -1
index adfeeb4..6fe5001 100644
@@ -409,7 +409,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
 	fprintf(stdout, "\t[S]     stop annotation.\n");
 
 	fprintf(stdout,
-		"\t[K]     hide kernel_symbols symbols.     \t(%s)\n",
+		"\t[K]     hide kernel symbols.             \t(%s)\n",
 		top->hide_kernel_symbols ? "yes" : "no");
 	fprintf(stdout,
 		"\t[U]     hide user symbols.               \t(%s)\n",
Signature · 1 line
2.7.4
maintainer Applied
#5 lore raw

Re: [PATCH 3/3] perf top: Remove a duplicate word

Em Sun, Nov 12, 2017 at 10:10:47AM +0900, Sihyeon Jang escreveu:

Quoted 3 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>

Thanks, applied.

- Arnaldo

Quoted 19 lines
---
 tools/perf/builtin-top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-top.c +1 -1
index adfeeb4..6fe5001 100644
@@ -409,7 +409,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
 	fprintf(stdout, "\t[S]     stop annotation.\n");
 
 	fprintf(stdout,
-		"\t[K]     hide kernel_symbols symbols.     \t(%s)\n",
+		"\t[K]     hide kernel symbols.             \t(%s)\n",
 		top->hide_kernel_symbols ? "yes" : "no");
 	fprintf(stdout,
 		"\t[U]     hide user symbols.               \t(%s)\n",
Signature · 1 line
2.7.4
#6 lore raw

[tip:perf/core] perf top: Remove a duplicate word

In reply to Sihyeon Jang
perf top: Remove a duplicate word
Commit-ID:  8fce3743cea47db86dd13ab4c479158a872271e8
Gitweb:     https://git.kernel.org/tip/8fce3743cea47db86dd13ab4c479158a872271e8
Author:     Sihyeon Jang <[email protected]>
AuthorDate: Sun, 12 Nov 2017 10:10:47 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 16 Nov 2017 14:49:56 -0300

perf top: Remove a duplicate word

---
 tools/perf/builtin-top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-top.c +1 -1
index 0789f95..68320ac 100644
@@ -412,7 +412,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
 	fprintf(stdout, "\t[S]     stop annotation.\n");
 
 	fprintf(stdout,
-		"\t[K]     hide kernel_symbols symbols.     \t(%s)\n",
+		"\t[K]     hide kernel symbols.             \t(%s)\n",
 		top->hide_kernel_symbols ? "yes" : "no");
 	fprintf(stdout,
 		"\t[U]     hide user symbols.               \t(%s)\n",
#7 lore raw
In reply to Sihyeon Jang

Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:

Quoted 12 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-help.txt +0 -0
index 5143918..bb605af 100644

tools/perf/Documentation/perf-help.txt perf-help - display help information about perf · line 10

Quoted 5 lines
tools/perf/Documentation/perf-help.txt +1 -1
@@ -7,7 +7,7 @@ perf-help - display help information about perf
 
 SYNOPSIS
 --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]

Can you try figuring out if this actually works? I tried here and it doesn't, its an area we took "for free" when we copied the initial codebase from git.git, but I never looked at this area that much, now that I try:

[acme@jouet linux]$ perf help
Config with no key for man viewer: childrenError: wrong config key-value pair top.children=true [acme@jouet linux]$

Unsure if this is something that got broken by the 'perf config' patches, Taeung?

- Arnaldo

Quoted 23 lines
tools/perf/Documentation/perf-help.txt +12 -0
 DESCRIPTION
 -----------
@@ -33,6 +33,18 @@ OPTIONS
 	Prints all the available commands on the standard output. This
 	option supersedes any other option.
 
+-i::
+--info::
+	Shows info page.
+
+-m::
+--man::
+	Shows man page.
+
+-w::
+--web::
+	Shows manual in web browser.
+
 PERF
 ----
 Part of the linkperf:perf[1] suite
Signature · 1 line
2.7.4
maintainer
#8 lore raw

Hi Arnaldo,

Quoted 14 lines · Arnaldo Carvalho de Melo

Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:

Quoted 13 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-help.txt +0 -0
index 5143918..bb605af 100644
@@ -7,7 +7,7 @@ perf-help - display help information about perf
 
Quoted 9 lines

tools/perf/Documentation/perf-help.txt perf-help - display help information about perf · line 10

Quoted 4 lines
tools/perf/Documentation/perf-help.txt +1 -1
 SYNOPSIS
 --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]

Can you try figuring out if this actually works? I tried here and it doesn't, its an area we took "for free" when we copied the initial codebase from git.git, but I never looked at this area that much, now that I try:

Yeah, I'm not sure we need to keep it.

Quoted 7 lines

[acme@jouet linux]$ perf help
Config with no key for man viewer: childrenError: wrong config key-value pair top.children=true [acme@jouet linux]$

Unsure if this is something that got broken by the 'perf config' patches, Taeung?

Looks like a bug in 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel").

Following patch should fix it:

Thanks,
Namhyung

Quoted 1 line

From 096b78b437b5758acc025498e88d73d9d471b3c0 Mon Sep 17 00:00:00 2001

From: Namhyung Kim <[email protected]>
Date: Tue, 14 Nov 2017 09:10:43 +0900
Subject: [PATCH] perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

  $ perf help
  '.root': unsupported man viewer sub key.
  ...
Fixes 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel")
Cc Taeung Song <[email protected]>
---
 tools/perf/builtin-help.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index dbe4e4153bcf..ff51e5fc0daf 100644
@@ -283,7 +283,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
 		add_man_viewer(value);
 		return 0;
 	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
 		return add_man_viewer_info(var, value);
 
 	return 0;
@@ -313,7 +313,7 @@ static const char *cmd_to_page(const char *perf_cmd)
 
 	if (!perf_cmd)
 		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
 		return perf_cmd;
 
 	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
Signature · 1 line
2.15.0
#9 lore raw

Hi Arnaldo and Namhyung :)

Quoted 38 lines · Namhyung Kim

Hi Arnaldo,

Quoted 14 lines · Arnaldo Carvalho de Melo

Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:

Quoted 13 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
  tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-help.txt +0 -0
index 5143918..bb605af 100644
@@ -7,7 +7,7 @@ perf-help - display help information about perf
 
Quoted 9 lines

tools/perf/Documentation/perf-help.txt perf-help - display help information about perf · line 10

Quoted 4 lines
tools/perf/Documentation/perf-help.txt +1 -1
  SYNOPSIS
  --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]

Can you try figuring out if this actually works? I tried here and it doesn't, its an area we took "for free" when we copied the initial codebase from git.git, but I never looked at this area that much, now that I try:

Yeah, I'm not sure we need to keep it.

Quoted 7 lines

[acme@jouet linux]$ perf help
Config with no key for man viewer: childrenError: wrong config key-value pair top.children=true [acme@jouet linux]$

Unsure if this is something that got broken by the 'perf config' patches, Taeung?

Quoted 7 lines

Looks like a bug in 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel").

Following patch should fix it:

Thanks,
Namhyung

I also checked this error and test the below patch. It seems that Namhyung already fixes it !!

Thanks,
Taeung

Quoted 45 lines

From 096b78b437b5758acc025498e88d73d9d471b3c0 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <[email protected]>
Date: Tue, 14 Nov 2017 09:10:43 +0900
Subject: [PATCH] perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

   $ perf help
   '.root': unsupported man viewer sub key.
   ...
Fixes 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel")
Cc Taeung Song <[email protected]>
---
  tools/perf/builtin-help.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index dbe4e4153bcf..ff51e5fc0daf 100644
@@ -283,7 +283,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
  		add_man_viewer(value);
  		return 0;
  	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
  		return add_man_viewer_info(var, value);
 
  	return 0;
@@ -313,7 +313,7 @@ static const char *cmd_to_page(const char *perf_cmd)
 
  	if (!perf_cmd)
  		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
  		return perf_cmd;
 
  	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
#10 lore raw

Em Tue, Nov 14, 2017 at 11:18:10AM +0900, Taeung Song escreveu:

Quoted 43 lines

Hi Arnaldo and Namhyung :)

Quoted 40 lines · Namhyung Kim

Hi Arnaldo,

Quoted 8 lines · Arnaldo Carvalho de Melo

Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:

Quoted 7 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
  tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
Quoted 14 lines

tools/perf/Documentation/perf-help.txt perf-help - display help information about perf · line 9

Quoted 9 lines
tools/perf/Documentation/perf-help.txt +1 -1
index 5143918..bb605af 100644
@@ -7,7 +7,7 @@ perf-help - display help information about perf
  SYNOPSIS
  --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]

Can you try figuring out if this actually works? I tried here and it doesn't, its an area we took "for free" when we copied the initial codebase from git.git, but I never looked at this area that much, now that I try:

Yeah, I'm not sure we need to keep it.

Quoted 7 lines

[acme@jouet linux]$ perf help
Config with no key for man viewer: childrenError: wrong config key-value pair top.children=true [acme@jouet linux]$

Unsure if this is something that got broken by the 'perf config' patches, Taeung?

Looks like a bug in 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel").

Quoted 7 lines
Quoted 4 lines

Following patch should fix it:

Thanks,
Namhyung

I also checked this error and test the below patch. It seems that Namhyung already fixes it !!

Thanks for checking, added a Tested-by: Taeung,

- Arnaldo

Quoted 45 lines

Thanks,
Taeung

Quoted 42 lines

From 096b78b437b5758acc025498e88d73d9d471b3c0 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <[email protected]>
Date: Tue, 14 Nov 2017 09:10:43 +0900
Subject: [PATCH] perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

   $ perf help
   '.root': unsupported man viewer sub key.
   ...
Fixes 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel")
Cc Taeung Song <[email protected]>
---
  tools/perf/builtin-help.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index dbe4e4153bcf..ff51e5fc0daf 100644
@@ -283,7 +283,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
  		add_man_viewer(value);
  		return 0;
  	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
  		return add_man_viewer_info(var, value);
  	return 0;
@@ -313,7 +313,7 @@ static const char *cmd_to_page(const char *perf_cmd)
  	if (!perf_cmd)
  		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
  		return perf_cmd;
  	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
 
#11 lore raw
In reply to Namhyung Kim

Em Tue, Nov 14, 2017 at 09:15:42AM +0900, Namhyung Kim escreveu:

Quoted 35 lines

Hi Arnaldo,

Quoted 14 lines · Arnaldo Carvalho de Melo

Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:

Quoted 13 lines
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-help.txt +0 -0
index 5143918..bb605af 100644
@@ -7,7 +7,7 @@ perf-help - display help information about perf
 
Quoted 9 lines

tools/perf/Documentation/perf-help.txt perf-help - display help information about perf · line 10

Quoted 4 lines
tools/perf/Documentation/perf-help.txt +1 -1
 SYNOPSIS
 --------
-'perf help' [-a|--all] [COMMAND]
+'perf help' [--all] [--man|--web|--info] [COMMAND]

Can you try figuring out if this actually works? I tried here and it doesn't, its an area we took "for free" when we copied the initial codebase from git.git, but I never looked at this area that much, now that I try:

Yeah, I'm not sure we need to keep it.

Quoted 5 lines

[acme@jouet linux]$ perf help
Config with no key for man viewer: childrenError: wrong config key-value pair top.children=true [acme@jouet linux]$

Quoted 5 lines
Quoted 2 lines

Unsure if this is something that got broken by the 'perf config' patches, Taeung?

Looks like a bug in 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel").

Wow, who did this?! ;-P

Quoted 1 line

Following patch should fix it:

Thanks!

Quoted 48 lines

Thanks,
Namhyung

Quoted 1 line

From 096b78b437b5758acc025498e88d73d9d471b3c0 Mon Sep 17 00:00:00 2001

From: Namhyung Kim <[email protected]>
Date: Tue, 14 Nov 2017 09:10:43 +0900
Subject: [PATCH] perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

  $ perf help
  '.root': unsupported man viewer sub key.
  ...
Fixes 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel")
Cc Taeung Song <[email protected]>
---
 tools/perf/builtin-help.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index dbe4e4153bcf..ff51e5fc0daf 100644
@@ -283,7 +283,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
 		add_man_viewer(value);
 		return 0;
 	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
 		return add_man_viewer_info(var, value);
 
 	return 0;
@@ -313,7 +313,7 @@ static const char *cmd_to_page(const char *perf_cmd)
 
 	if (!perf_cmd)
 		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
 		return perf_cmd;
 
 	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
Signature · 1 line
2.15.0
#12 lore raw

[tip:perf/core] perf help: Fix a bug during strstart() conversion

In reply to Namhyung Kim
perf help: Fix a bug during strstart() conversion
Commit-ID:  2f0af8600e82e9f950fc32908386b9c639f88d48
Gitweb:     https://git.kernel.org/tip/2f0af8600e82e9f950fc32908386b9c639f88d48
Author:     Namhyung Kim <[email protected]>
AuthorDate: Tue, 14 Nov 2017 09:15:42 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 16 Nov 2017 14:49:59 -0300

perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

  $ perf help
  '.root': unsupported man viewer sub key.
  ...
---
 tools/perf/builtin-help.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index bd1fede..a0f7ed2 100644
@@ -284,7 +284,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
 		add_man_viewer(value);
 		return 0;
 	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
 		return add_man_viewer_info(var, value);
 
 	return 0;
@@ -314,7 +314,7 @@ static const char *cmd_to_page(const char *perf_cmd)
 
 	if (!perf_cmd)
 		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
 		return perf_cmd;
 
 	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
#13 lore raw

[tip:perf/core] perf help: Fix a bug during strstart() conversion

In reply to Namhyung Kim
perf help: Fix a bug during strstart() conversion
Commit-ID:  af98f2273fd0af31ce327cd1406b67c7be0b6734
Gitweb:     https://git.kernel.org/tip/af98f2273fd0af31ce327cd1406b67c7be0b6734
Author:     Namhyung Kim <[email protected]>
AuthorDate: Tue, 14 Nov 2017 09:15:42 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 28 Nov 2017 14:21:18 -0300

perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to change the return value in some place. It makes perf help print annoying output even for sane config items like below:

  $ perf help
  '.root': unsupported man viewer sub key.
  ...
---
 tools/perf/builtin-help.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-help.c +2 -2
index bd1fede..a0f7ed2 100644
@@ -284,7 +284,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
 		add_man_viewer(value);
 		return 0;
 	}
-	if (!strstarts(var, "man."))
+	if (strstarts(var, "man."))
 		return add_man_viewer_info(var, value);
 
 	return 0;
@@ -314,7 +314,7 @@ static const char *cmd_to_page(const char *perf_cmd)
 
 	if (!perf_cmd)
 		return "perf";
-	else if (!strstarts(perf_cmd, "perf"))
+	else if (strstarts(perf_cmd, "perf"))
 		return perf_cmd;
 
 	return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;