mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] perf list: --help option not implemented
@ 2012-10-19  8:27 Stephane Eranian
  2012-10-19  8:46 ` Jiri Olsa
  0 siblings, 1 reply; 6+ messages in thread
From: Stephane Eranian @ 2012-10-19  8:27 UTC (permalink / raw)
  To: LKML
  Cc: Jiri Olsa, Peter Zijlstra, Arnaldo Carvalho de Melo, mingo, David Ahern

Jiri,

When I run perf list, I see:

$ perf list
  ..
  rNNN                                               [Raw hardware
event descriptor]
  cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware
event descriptor]
   (see 'perf list --help' on how to encode it)

But:
$ perf list --help
$

Shows nothing. Looked at the code and I don't see where you handle the --help
option. You need some help to figure out what the modifiers are.

Am I missing something here?

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

* Re: [BUG] perf list: --help option not implemented
  2012-10-19  8:27 [BUG] perf list: --help option not implemented Stephane Eranian
@ 2012-10-19  8:46 ` Jiri Olsa
  2012-10-22  7:12   ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Olsa @ 2012-10-19  8:46 UTC (permalink / raw)
  To: Stephane Eranian
  Cc: LKML, Peter Zijlstra, Arnaldo Carvalho de Melo, mingo, David Ahern

On Fri, Oct 19, 2012 at 10:27:35AM +0200, Stephane Eranian wrote:
> Jiri,
> 
> When I run perf list, I see:
> 
> $ perf list
>   ..
>   rNNN                                               [Raw hardware
> event descriptor]
>   cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware
> event descriptor]
>    (see 'perf list --help' on how to encode it)
> 
> But:
> $ perf list --help
> $
> 
> Shows nothing. Looked at the code and I don't see where you handle the --help
> option. You need some help to figure out what the modifiers are.
> 
> Am I missing something here?

nope, it's not working.. added on my todo list ;-)

thanks,
jirka

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

* Re: [BUG] perf list: --help option not implemented
  2012-10-19  8:46 ` Jiri Olsa
@ 2012-10-22  7:12   ` Namhyung Kim
  2012-10-22  8:32     ` Jiri Olsa
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Namhyung Kim @ 2012-10-22  7:12 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Stephane Eranian, LKML, Peter Zijlstra, Arnaldo Carvalho de Melo,
	mingo, David Ahern

Hi,

On Fri, 19 Oct 2012 10:46:36 +0200, Jiri Olsa wrote:
> On Fri, Oct 19, 2012 at 10:27:35AM +0200, Stephane Eranian wrote:
>> Jiri,
>> 
>> When I run perf list, I see:
>> 
>> $ perf list
>>   ..
>>   rNNN                                               [Raw hardware
>> event descriptor]
>>   cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware
>> event descriptor]
>>    (see 'perf list --help' on how to encode it)
>> 
>> But:
>> $ perf list --help
>> $
>> 
>> Shows nothing. Looked at the code and I don't see where you handle the --help
>> option. You need some help to figure out what the modifiers are.
>> 
>> Am I missing something here?
>
> nope, it's not working.. added on my todo list ;-)

I think it worked.

It seems that commit cc5848213329 ("perf help: Remove use of die and
handle errors") caused the problem - it changed the initial value of
'help_format' from HELP_FORMAT_MAN to HELP_FORMAT_NONE.

The following patch works well for me:

diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 411ee5664e98..178b88ae3d2f 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -414,7 +414,7 @@ static int show_html_page(const char *perf_cmd)
 int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
 {
 	bool show_all = false;
-	enum help_format help_format = HELP_FORMAT_NONE;
+	enum help_format help_format = HELP_FORMAT_MAN;
 	struct option builtin_help_options[] = {
 	OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
 	OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),

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

* Re: [BUG] perf list: --help option not implemented
  2012-10-22  7:12   ` Namhyung Kim
@ 2012-10-22  8:32     ` Jiri Olsa
  2012-10-22 13:26     ` David Ahern
  2012-10-24  6:03     ` [tip:perf/urgent] perf help: Fix --help for builtins tip-bot for Namhyung Kim
  2 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2012-10-22  8:32 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Stephane Eranian, LKML, Peter Zijlstra, Arnaldo Carvalho de Melo,
	mingo, David Ahern

On Mon, Oct 22, 2012 at 04:12:23PM +0900, Namhyung Kim wrote:
> Hi,
> 
> On Fri, 19 Oct 2012 10:46:36 +0200, Jiri Olsa wrote:
> > On Fri, Oct 19, 2012 at 10:27:35AM +0200, Stephane Eranian wrote:
> >> Jiri,
> >> 
> >> When I run perf list, I see:
> >> 
> >> $ perf list
> >>   ..
> >>   rNNN                                               [Raw hardware
> >> event descriptor]
> >>   cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware
> >> event descriptor]
> >>    (see 'perf list --help' on how to encode it)
> >> 
> >> But:
> >> $ perf list --help
> >> $
> >> 
> >> Shows nothing. Looked at the code and I don't see where you handle the --help
> >> option. You need some help to figure out what the modifiers are.
> >> 
> >> Am I missing something here?
> >
> > nope, it's not working.. added on my todo list ;-)
> 
> I think it worked.

removed from my todo list ;)

seems like your patch adds man page as default for 'perf <command> --help'
sooo git-like ;) I dont mind..

jirka

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

* Re: [BUG] perf list: --help option not implemented
  2012-10-22  7:12   ` Namhyung Kim
  2012-10-22  8:32     ` Jiri Olsa
@ 2012-10-22 13:26     ` David Ahern
  2012-10-24  6:03     ` [tip:perf/urgent] perf help: Fix --help for builtins tip-bot for Namhyung Kim
  2 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2012-10-22 13:26 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jiri Olsa, Stephane Eranian, LKML, Peter Zijlstra,
	Arnaldo Carvalho de Melo, mingo

On 10/22/12 1:12 AM, Namhyung Kim wrote:
> It seems that commit cc5848213329 ("perf help: Remove use of die and
> handle errors") caused the problem - it changed the initial value of
> 'help_format' from HELP_FORMAT_MAN to HELP_FORMAT_NONE.
>
> The following patch works well for me:
>
> diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
> index 411ee5664e98..178b88ae3d2f 100644
> --- a/tools/perf/builtin-help.c
> +++ b/tools/perf/builtin-help.c
> @@ -414,7 +414,7 @@ static int show_html_page(const char *perf_cmd)
>   int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
>   {
>   	bool show_all = false;
> -	enum help_format help_format = HELP_FORMAT_NONE;
> +	enum help_format help_format = HELP_FORMAT_MAN;
>   	struct option builtin_help_options[] = {
>   	OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
>   	OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
>

D'oh. Thanks for debugging, Namhyung.

Acked-by/Tested-by: David Ahern <dsahern@gmail.com>

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

* [tip:perf/urgent] perf help: Fix --help for builtins
  2012-10-22  7:12   ` Namhyung Kim
  2012-10-22  8:32     ` Jiri Olsa
  2012-10-22 13:26     ` David Ahern
@ 2012-10-24  6:03     ` tip-bot for Namhyung Kim
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Namhyung Kim @ 2012-10-24  6:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, eranian, hpa, mingo, peterz, namhyung, jolsa,
	dsahern, tglx

Commit-ID:  670ab5d21c7e168c89a36fdd2c69fb7af63d35a1
Gitweb:     http://git.kernel.org/tip/670ab5d21c7e168c89a36fdd2c69fb7af63d35a1
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Mon, 22 Oct 2012 16:12:23 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 22 Oct 2012 12:35:49 -0200

perf help: Fix --help for builtins

It seems that commit cc5848213329 ("perf help: Remove use of die and
handle errors") caused the problem - it changed the initial value of
'help_format' from HELP_FORMAT_MAN to HELP_FORMAT_NONE.

This broke the --help option for all builtins, that would produce no
output, while 'man perf-top' would work it MANPATH is properly setup.

Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/87r4orj7zc.fsf@sejong.aot.lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-help.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 411ee56..178b88a 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -414,7 +414,7 @@ static int show_html_page(const char *perf_cmd)
 int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
 {
 	bool show_all = false;
-	enum help_format help_format = HELP_FORMAT_NONE;
+	enum help_format help_format = HELP_FORMAT_MAN;
 	struct option builtin_help_options[] = {
 	OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
 	OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),

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

end of thread, other threads:[~2012-10-24  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19  8:27 [BUG] perf list: --help option not implemented Stephane Eranian
2012-10-19  8:46 ` Jiri Olsa
2012-10-22  7:12   ` Namhyung Kim
2012-10-22  8:32     ` Jiri Olsa
2012-10-22 13:26     ` David Ahern
2012-10-24  6:03     ` [tip:perf/urgent] perf help: Fix --help for builtins tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome