perf kmem: Show usage if no option is specified
PATCH 1/2 perf kmem: Show usage if no option is specified
As Ingo suggested, make "perf kmem" show help information. "perf kmem stat [--caller] [--alloc] .." will show memory statistics.
--- tools/perf/Documentation/perf-kmem.txt | 13 +++++--- tools/perf/builtin-kmem.c | 52 ++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 28 deletions(-)
tools/perf/Documentation/perf-kmem.txt +8 -5
@@ -8,16 +8,16 @@ perf-kmem - Tool to trace/measure kernel memory(slab) properties SYNOPSIS -------- [verse] -'perf kmem' {record} [<options>] +'perf kmem' {record|stat} [<options>] DESCRIPTION ----------- -There's two variants of perf kmem: +There are two variants of perf kmem: 'perf kmem record <command>' to record the kmem events of an arbitrary workload. - 'perf kmem' to report kernel memory statistics. + 'perf kmem stat' to report kernel memory statistics. OPTIONS -------
@@ -25,8 +25,11 @@ OPTIONS --input=<file>:: Select the input file (default: perf.data) ---stat=<caller|alloc>:: - Select per callsite or per allocation statistics +--caller:: + Show per-callsite statistics + +--alloc:: + Show per-allocation statistics -s <key[,key2...]>:: --sort=<key[,key2...]>::
tools/perf/builtin-kmem.c +29 -23
86 lines not on this page · raw message
Signature · 1 line
1.6.3
PATCH 2/2 perf tools: Align long options which have no short forms
Before:
$ ./perf kmem
...
-l, --line <num> show n lines
--raw-ip show raw ip instead of symbolAfter:
$ ./perf kmem
...
-l, --line <num> show n lines
--raw-ip show raw ip instead of symbol--- tools/perf/util/parse-options.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/util/parse-options.c +3 -0
@@ -430,6 +430,9 @@ int usage_with_options_internal(const char * const *usagestr, pos =fprintf (stderr," " );if (opts->short_name) pos +=fprintf (stderr,"-%c" , opts->short_name); +else + pos +=fprintf (stderr," " ); +if (opts->long_name && opts->short_name) pos +=fprintf (stderr,", " );if (opts->long_name)
Signature · 1 line
1.6.3
[tip:perf/urgent] perf tools: Align long options which have no short forms
Commit-ID: bc3abfb1b50964ffbbd0fc4e1ffe598b1b63a8c7 Gitweb: http://git.kernel.org/tip/bc3abfb1b50964ffbbd0fc4e1ffe598b1b63a8c7 Author: Li Zefan <[email protected]> AuthorDate: Thu, 10 Dec 2009 15:22:17 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 10 Dec 2009 08:30:28 +0100
perf tools: Align long options which have no short forms
Before:
$ ./perf kmem
...
-l, --line <num> show n lines
--raw-ip show raw ip instead of symbolAfter:
$ ./perf kmem
...
-l, --line <num> show n lines
--raw-ip show raw ip instead of symbolLKML-Reference: <[email protected]>
--- tools/perf/util/parse-options.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/util/parse-options.c +3 -0
@@ -430,6 +430,9 @@ int usage_with_options_internal(const char * const *usagestr, pos =fprintf (stderr," " );if (opts->short_name) pos +=fprintf (stderr,"-%c" , opts->short_name); +else + pos +=fprintf (stderr," " ); +if (opts->long_name && opts->short_name) pos +=fprintf (stderr,", " );if (opts->long_name)
Li Zefan kirjoitti:
Quoted 5 lines
As Ingo suggested, make "perf kmem" show help information. "perf kmem stat [--caller] [--alloc] .." will show memory statistics.
Signed-off-by Li Zefan <[email protected]>
Ingo Molnar
AppliedQuoted 8 lines · Pekka Enberg
Li Zefan kirjoitti:
Quoted 5 lines
As Ingo suggested, make "perf kmem" show help information. "perf kmem stat [--caller] [--alloc] .." will show memory statistics.
Signed-off-by Li Zefan <[email protected]>Acked-by Pekka Enberg <[email protected]>
Applied, thanks!
Ingo
Commit-ID: 90b86a9f7dc22e7ff8e8c79ed553860454ff8dd9 Gitweb: http://git.kernel.org/tip/90b86a9f7dc22e7ff8e8c79ed553860454ff8dd9 Author: Li Zefan <[email protected]> AuthorDate: Thu, 10 Dec 2009 15:21:57 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 10 Dec 2009 08:30:27 +0100
perf kmem: Show usage if no option is specified
As Ingo suggested, make "perf kmem" show help information. "perf kmem stat [--caller] [--alloc] .." will show memory statistics.
LKML-Reference: <[email protected]>
--- tools/perf/Documentation/perf-kmem.txt | 13 +++++--- tools/perf/builtin-kmem.c | 52 ++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 28 deletions(-)
tools/perf/Documentation/perf-kmem.txt +8 -5
@@ -8,16 +8,16 @@ perf-kmem - Tool to trace/measure kernel memory(slab) properties SYNOPSIS -------- [verse] -'perf kmem' {record} [<options>] +'perf kmem' {record|stat} [<options>] DESCRIPTION ----------- -There's two variants of perf kmem: +There are two variants of perf kmem: 'perf kmem record <command>' to record the kmem events of an arbitrary workload. - 'perf kmem' to report kernel memory statistics. + 'perf kmem stat' to report kernel memory statistics. OPTIONS -------
@@ -25,8 +25,11 @@ OPTIONS --input=<file>:: Select the input file (default: perf.data) ---stat=<caller|alloc>:: - Select per callsite or per allocation statistics +--caller:: + Show per-callsite statistics + +--alloc:: + Show per-allocation statistics -s <key[,key2...]>:: --sort=<key[,key2...]>::
tools/perf/builtin-kmem.c +29 -23
86 lines not on this page · raw message
[tip:perf/urgent] perf kmem: Fix unused argument build warning
In reply to Li ZefanCommit-ID: 7931241694b25589658b1ceb02218d2750540ae0 Gitweb: http://git.kernel.org/tip/7931241694b25589658b1ceb02218d2750540ae0 Author: Ingo Molnar <[email protected]> AuthorDate: Thu, 10 Dec 2009 08:43:34 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 10 Dec 2009 08:44:39 +0100
perf kmem: Fix unused argument build warning
Fix:
builtin-kmem.c: In function 'parse_caller_opt':
builtin-kmem.c:690: error: unused parameter 'arg' builtin-kmem.c: In function 'parse_alloc_opt':
builtin-kmem.c:697: error: unused parameter 'arg'
Cc: Li Zefan <[email protected]>
Cc: Pekka Enberg <[email protected]>
LKML-Reference: <[email protected]>
--- tools/perf/builtin-kmem.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-kmem.c +2 -2
@@ -687,14 +687,14 @@ static int parse_sort_opt(const struct option *opt __used, }static int parse_caller_opt (const struct option *opt__used , -const char *arg,int unset__used ) +const char *arg__used ,int unset__used ) { caller_flag = (alloc_flag +1 );return 0 ; }static int parse_alloc_opt (const struct option *opt__used , -const char *arg,int unset__used ) +const char *arg__used ,int unset__used ) { alloc_flag = (caller_flag +1 );return 0 ;