LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Sihyeon Jang <uneedsihyeon@gmail.com>,
	Taeung Song <treeze.taeung@gmail.com>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	kernel-team@lge.com
Subject: Re: [PATCH 1/3] perf help: Document missing options
Date: Tue, 14 Nov 2017 09:15:42 +0900
Message-ID: <20171114001542.GA16464@sejong> (raw)
In-Reply-To: <20171113182956.GA8836@kernel.org>

Hi Arnaldo,

On Mon, Nov 13, 2017 at 03:29:56PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Sun, Nov 12, 2017 at 10:10:45AM +0900, Sihyeon Jang escreveu:
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Signed-off-by: Sihyeon Jang <uneedsihyeon@gmail.com>
> > ---
> >  tools/perf/Documentation/perf-help.txt | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/Documentation/perf-help.txt b/tools/perf/Documentation/perf-help.txt
> > index 5143918..bb605af 100644
> > --- a/tools/perf/Documentation/perf-help.txt
> > +++ b/tools/perf/Documentation/perf-help.txt
> > @@ -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.


> 
> [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


>From 096b78b437b5758acc025498e88d73d9d471b3c0 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@kernel.org>
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 <treeze.taeung@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-help.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index dbe4e4153bcf..ff51e5fc0daf 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -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;
-- 
2.15.0

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12  1:10 Sihyeon Jang
2017-11-12  1:10 ` [PATCH 2/3] perf top: " Sihyeon Jang
2017-11-13 18:25   ` Arnaldo Carvalho de Melo
2017-11-18  8:29   ` [tip:perf/core] " tip-bot for Sihyeon Jang
2017-11-12  1:10 ` [PATCH 3/3] perf top: Remove a duplicate word Sihyeon Jang
2017-11-13 18:27   ` Arnaldo Carvalho de Melo
2017-11-18  8:29   ` [tip:perf/core] " tip-bot for Sihyeon Jang
2017-11-13 18:29 ` [PATCH 1/3] perf help: Document missing options Arnaldo Carvalho de Melo
2017-11-14  0:15   ` Namhyung Kim [this message]
2017-11-14  2:18     ` Taeung Song
2017-11-14 13:03       ` Arnaldo Carvalho de Melo
2017-11-14 13:00     ` Arnaldo Carvalho de Melo
2017-11-18  8:32     ` [tip:perf/core] perf help: Fix a bug during strstart() conversion tip-bot for Namhyung Kim
2017-11-29  6:30     ` tip-bot for Namhyung Kim

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171114001542.GA16464@sejong \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=treeze.taeung@gmail.com \
    --cc=uneedsihyeon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox