perf tools: Fixes
Jiri Olsa
reviewercover perf tools: Fixes
hi,
sending assorted fixes and leftover from previous mem patchset.
Also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes
thanks,
jirka
---
Jiri Olsa (6):
perf mem: Add --ldlat option
perf mem: Add -U/-K (--all-user/--all-kernel) options perf tools: Make hists__collapse_insert_entry static perf tools: Introduce trim function
perf tools: Unify -f/--force option documentation perf tests: Add test to check for event times
tools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-diff.txt | 2 +- tools/perf/Documentation/perf-mem.txt | 11 +++++ tools/perf/Documentation/perf-report.txt | 2 +- tools/perf/Documentation/perf-script.txt | 4 ++ tools/perf/builtin-mem.c | 12 ++++- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 ++ tools/perf/tests/event-times.c | 236 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 3 +- tools/perf/ui/stdio/hist.c | 3 +- tools/perf/util/hist.c | 5 +- tools/perf/util/hist.h | 2 - tools/perf/util/mem-events.c | 17 ++++++- tools/perf/util/mem-events.h | 1 + tools/perf/util/util.h | 5 ++ 17 files changed, 298 insertions(+), 13 deletions(-) create mode 100644 tools/perf/tests/event-times.c
Jiri Olsa
reviewerPATCH 1/6 perf mem: Add --ldlat option
Adding --ldlat option to specify desired latency
for loads event.
Specify 50 as loads event latency:
$ perf mem record -e ldlat-loads -v --ldlat 50 true calling: record -W -d -e cpu/mem-loads,ldlat=50/P true
--- tools/perf/Documentation/perf-mem.txt | 3 +++ tools/perf/builtin-mem.c | 1 + tools/perf/util/mem-events.c | 17 ++++++++++++++++- tools/perf/util/mem-events.h | 1 + 4 files changed, 21 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-mem.txt +3 -0
@@ -48,6 +48,9 @@ OPTIONS option can be passed in record mode. It will be interpreted the same way as perf record. +--ldload:: + Specify desired latency for loads event. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1]
tools/perf/builtin-mem.c +1 -0
@@ -66,6 +66,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)OPT_CALLBACK ('e' ,"event" , &mem,"event" ,"event selector. use 'perf mem record -e list' to list available events" , parse_record_events), +OPT_UINTEGER (0 ,"ldlat" , &perf_mem_events__loads_ldlat,"mem-loads latency" ),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ),OPT_END ()
tools/perf/util/mem-events.c +16 -1
@@ -10,10 +10,12 @@#include "debug.h" #include "symbol.h" +unsigned int perf_mem_events__loads_ldlat =30 ; +#define E (t, n, s) { .tag = t, .name = n, .sysfs_name = s }struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX ] = { -E ("ldlat-loads" ,"cpu/mem-loads,ldlat=30/P" ,"mem-loads" ), +E ("ldlat-loads" ,"cpu/mem-loads,ldlat=%u/P" ,"mem-loads" ),E ("ldlat-stores" ,"cpu/mem-stores/P" ,"mem-stores" ),E ("stlb-miss-loads" ,"cpu/mem-stlb-miss-loads/P" ,"mem-stlb-miss-loads" ),E ("stlb-miss-stores" ,"cpu/mem-stlb-miss-stores/P" ,"mem-stlb-miss-stores" ),
@@ -39,8 +41,21 @@ struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {#undef E +static char mem_loads_name[100 ]; +static bool mem_loads_name__init; +char *perf_mem_events__name (int i) { +if (i ==PERF_MEM_EVENTS__LOAD ) { +if (!mem_loads_name__init) { + mem_loads_name__init = true; +scnprintf (mem_loads_name,sizeof (mem_loads_name), + perf_mem_events[i].name, + perf_mem_events__loads_ldlat); + } +return mem_loads_name; + } +return (char *)perf_mem_events[i].name; }
tools/perf/util/mem-events.h +1 -0
@@ -37,6 +37,7 @@ enum { };extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX ]; +extern unsigned int perf_mem_events__loads_ldlat;int perf_mem_events__parse (const char *str);int perf_mem_events__init (void );
Signature · 1 line
2.4.3
Arnaldo Carvalho de Melo
maintainerRe: [PATCH 1/6] perf mem: Add --ldlat option
Em Thu, Mar 24, 2016 at 01:52:15PM +0100, Jiri Olsa escreveu:
Quoted 7 lines
Adding --ldlat option to specify desired latency
for loads event.Specify 50 as loads event latency:
$ perf mem record -e ldlat-loads -v --ldlat 50 true calling: record -W -d -e cpu/mem-loads,ldlat=50/P true
We have all this infrastructure to set per-event settings, on the command line, and here we end up adding a separate command line option to do that? Why not something like:
perf mem record -e ldlat-loads/lat=50/ true
?
- Arnaldo
Quoted 89 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/Documentation/perf-mem.txt | 3 +++ tools/perf/builtin-mem.c | 1 + tools/perf/util/mem-events.c | 17 ++++++++++++++++- tools/perf/util/mem-events.h | 1 + 4 files changed, 21 insertions(+), 1 deletion(-)tools/perf/Documentation/perf-mem.txt +3
-0@@ -48,6 +48,9 @@ OPTIONS option can be passed in record mode. It will be interpreted the same way as perf record. +--ldload:: + Specify desired latency for loads event. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1]tools/perf/builtin-mem.c +1
-0@@ -66,6 +66,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)OPT_CALLBACK ('e' ,"event" , &mem,"event" ,"event selector. use 'perf mem record -e list' to list available events" , parse_record_events), +OPT_UINTEGER (0 ,"ldlat" , &perf_mem_events__loads_ldlat,"mem-loads latency" ),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ),OPT_END ()tools/perf/util/mem-events.c +16
-1@@ -10,10 +10,12 @@#include "debug.h" #include "symbol.h" +unsigned int perf_mem_events__loads_ldlat =30 ; +#define E (t, n, s) { .tag = t, .name = n, .sysfs_name = s }struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX ] = { -E ("ldlat-loads" ,"cpu/mem-loads,ldlat=30/P" ,"mem-loads" ), +E ("ldlat-loads" ,"cpu/mem-loads,ldlat=%u/P" ,"mem-loads" ),E ("ldlat-stores" ,"cpu/mem-stores/P" ,"mem-stores" ),E ("stlb-miss-loads" ,"cpu/mem-stlb-miss-loads/P" ,"mem-stlb-miss-loads" ),E ("stlb-miss-stores" ,"cpu/mem-stlb-miss-stores/P" ,"mem-stlb-miss-stores" ),@@ -39,8 +41,21 @@ struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {#undef E +static char mem_loads_name[100 ]; +static bool mem_loads_name__init; +char *perf_mem_events__name (int i) { +if (i ==PERF_MEM_EVENTS__LOAD ) { +if (!mem_loads_name__init) { + mem_loads_name__init = true; +scnprintf (mem_loads_name,sizeof (mem_loads_name), + perf_mem_events[i].name, + perf_mem_events__loads_ldlat); + } +return mem_loads_name; + } +return (char *)perf_mem_events[i].name; }tools/perf/util/mem-events.h +1
-0@@ -37,6 +37,7 @@ enum { };extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX ]; +extern unsigned int perf_mem_events__loads_ldlat;int perf_mem_events__parse (const char *str);int perf_mem_events__init (void );Signature · 1 line
2.4.3
Re: [PATCH 1/6] perf mem: Add --ldlat option
Quoted 6 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 24, 2016 at 01:52:15PM +0100, Jiri Olsa escreveu:
Quoted 5 lines
Adding --ldlat option to specify desired latency
for loads event.Specify 50 as loads event latency:
Quoted 8 lines
Quoted 2 lines
$ perf mem record -e ldlat-loads -v --ldlat 50 true calling: record -W -d -e cpu/mem-loads,ldlat=50/P trueWe have all this infrastructure to set per-event settings, on the command line, and here we end up adding a separate command line option to do that? Why not something like:
perf mem record -e ldlat-loads/lat=50/ true
will check ;-)
thanks,
jirka
Re: [PATCH 1/6] perf mem: Add --ldlat option
Quoted 10 lines · Jiri Olsa
Quoted 9 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 24, 2016 at 01:52:15PM +0100, Jiri Olsa escreveu:
Quoted 7 lines
Adding --ldlat option to specify desired latency
for loads event.Specify 50 as loads event latency:
$ perf mem record -e ldlat-loads -v --ldlat 50 true calling: record -W -d -e cpu/mem-loads,ldlat=50/P true
Quoted 7 lines
Quoted 5 lines
We have all this infrastructure to set per-event settings, on the command line, and here we end up adding a separate command line option to do that? Why not something like:
perf mem record -e ldlat-loads/lat=50/ true
will check ;-)
sry for delay..
the thing is, that we can already do that via record command:
perf record -e "cpu/mem-loads,ldlat=30/" ls
but this option is in perf mem command, which provides the way to use short config:
$ perf mem record --ldlat 50 ls
and adds also '-W -d' options for record command:
$ ./perf mem record -v --ldlat 50 ls calling: record -W -d -e cpu/mem-loads,ldlat=50/P ls
jirka
Jiri Olsa
reviewerPATCH 2/6 perf mem: Add -U/-K (--all-user/--all-kernel) options
In reply to Jiri OlsaAdd -U/-K (--all-user/--all-kernel) options to use the perf record --all-user/--all-kernel options.
--- tools/perf/Documentation/perf-mem.txt | 8 ++++++++ tools/perf/builtin-mem.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-mem.txt +8 -0
@@ -51,6 +51,14 @@ OPTIONS --ldload:: Specify desired latency for loads event. +-K:: +--all-kernel:: + Configure all used events to run in kernel space. + +-U:: +--all-user:: + Configure all used events to run in user space. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1]
tools/perf/builtin-mem.c +10 -1
@@ -62,6 +62,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)int rec_argc, i =0 , j;const char **rec_argv;int ret; +bool all_user = false, all_kernel = false;struct option options[] = { OPT_CALLBACK('e', "event", &mem, "event", "event selector. use 'perf mem record -e list' to list available events",
@@ -69,13 +70,15 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)OPT_UINTEGER (0 ,"ldlat" , &perf_mem_events__loads_ldlat,"mem-loads latency" ),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ), +OPT_BOOLEAN ('U' ,"--all-user" , &all_user,"collect only user level data" ), +OPT_BOOLEAN ('K' ,"--all-kernel" , &all_kernel,"collect only kernel level data" ), OPT_END() }; argc =parse_options (argc, argv, options, record_mem_usage,PARSE_OPT_STOP_AT_NON_OPTION ); - rec_argc = argc +7 ;/* max number of arguments */ + rec_argc = argc +9 ;/* max number of arguments */ rec_argv =calloc (rec_argc +1 ,sizeof (char *));if (!rec_argv)return -1 ;
@@ -104,6 +107,12 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) rec_argv[i++] =perf_mem_events__name (j); }; +if (all_user) + rec_argv[i++] ="--all-user" ; + +if (all_kernel) + rec_argv[i++] ="--all-kernel" ; +for (j =0 ; j < argc; j++, i++) rec_argv[i] = argv[j];
Signature · 1 line
2.4.3
Arnaldo Carvalho de Melo
maintainerRe: [PATCH 2/6] perf mem: Add -U/-K (--all-user/--all-kernel) options
Em Thu, Mar 24, 2016 at 01:52:16PM +0100, Jiri Olsa escreveu:
Quoted 2 lines
Add -U/-K (--all-user/--all-kernel) options to use the perf record --all-user/--all-kernel options.
Applying this after fixing up the clash due to the first patch not being merged so far.
Quoted 70 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/Documentation/perf-mem.txt | 8 ++++++++ tools/perf/builtin-mem.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)tools/perf/Documentation/perf-mem.txt +8
-0@@ -51,6 +51,14 @@ OPTIONS --ldload:: Specify desired latency for loads event. +-K:: +--all-kernel:: + Configure all used events to run in kernel space. + +-U:: +--all-user:: + Configure all used events to run in user space. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1]tools/perf/builtin-mem.c +10
-1@@ -62,6 +62,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)int rec_argc, i =0 , j;const char **rec_argv;int ret; +bool all_user = false, all_kernel = false;struct option options[] = { OPT_CALLBACK('e', "event", &mem, "event", "event selector. use 'perf mem record -e list' to list available events",@@ -69,13 +70,15 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)OPT_UINTEGER (0 ,"ldlat" , &perf_mem_events__loads_ldlat,"mem-loads latency" ),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ), +OPT_BOOLEAN ('U' ,"--all-user" , &all_user,"collect only user level data" ), +OPT_BOOLEAN ('K' ,"--all-kernel" , &all_kernel,"collect only kernel level data" ), OPT_END() }; argc =parse_options (argc, argv, options, record_mem_usage,PARSE_OPT_STOP_AT_NON_OPTION ); - rec_argc = argc +7 ;/* max number of arguments */ + rec_argc = argc +9 ;/* max number of arguments */ rec_argv =calloc (rec_argc +1 ,sizeof (char *));if (!rec_argv)return -1 ;@@ -104,6 +107,12 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) rec_argv[i++] =perf_mem_events__name (j); }; +if (all_user) + rec_argv[i++] ="--all-user" ; + +if (all_kernel) + rec_argv[i++] ="--all-kernel" ; +for (j =0 ; j < argc; j++, i++) rec_argv[i] = argv[j];Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf mem: Add -U/-K (--all-user/--all-kernel) options
In reply to Jiri Olsaperf mem: Add -U/-K (--all-user/--all-kernel) options
Commit-ID: ad16511b0e404652331a5350c522d0824f8209de Gitweb: http://git.kernel.org/tip/ad16511b0e404652331a5350c522d0824f8209de Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 24 Mar 2016 13:52:16 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 30 Mar 2016 11:14:07 -0300
perf mem: Add -U/-K (--all-user/--all-kernel) options
Add -U/-K (--all-user/--all-kernel) options to use the perf record --all-user/--all-kernel options.
--- tools/perf/Documentation/perf-mem.txt | 8 ++++++++ tools/perf/builtin-mem.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
tools/perf/Documentation/perf-mem.txt +8 -0
@@ -48,6 +48,14 @@ OPTIONS option can be passed in record mode. It will be interpreted the same way as perf record. +-K:: +--all-kernel:: + Configure all used events to run in kernel space. + +-U:: +--all-user:: + Configure all used events to run in user space. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1]
tools/perf/builtin-mem.c +10 -1
@@ -62,19 +62,22 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)int rec_argc, i =0 , j;const char **rec_argv;int ret; +bool all_user = false, all_kernel = false;struct option options[] = {OPT_CALLBACK ('e' ,"event" , &mem,"event" ,"event selector. use 'perf mem record -e list' to list available events" , parse_record_events),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ), +OPT_BOOLEAN ('U' ,"--all-user" , &all_user,"collect only user level data" ), +OPT_BOOLEAN ('K' ,"--all-kernel" , &all_kernel,"collect only kernel level data" ),OPT_END () }; argc =parse_options (argc, argv, options, record_mem_usage,PARSE_OPT_STOP_AT_NON_OPTION ); - rec_argc = argc +7 ;/* max number of arguments */ + rec_argc = argc +9 ;/* max number of arguments */ rec_argv =calloc (rec_argc +1 ,sizeof (char *));if (!rec_argv)return -1 ;
@@ -103,6 +106,12 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) rec_argv[i++] =perf_mem_events__name (j); }; +if (all_user) + rec_argv[i++] ="--all-user" ; + +if (all_kernel) + rec_argv[i++] ="--all-kernel" ; +for (j =0 ; j < argc; j++, i++) rec_argv[i] = argv[j];
Jiri Olsa
reviewerPATCH 3/6 perf tools: Make hists__collapse_insert_entry static
In reply to Jiri OlsaNo need to export hists__collapse_insert_entry function.
--- tools/perf/util/hist.c | 5 +++-- tools/perf/util/hist.h | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-)
tools/perf/util/hist.c +3 -2
@@ -1295,8 +1295,9 @@ static int hists__hierarchy_insert_entry(struct hists *hists,return ret; } -int hists__collapse_insert_entry (struct hists *hists,struct rb_root *root, -struct hist_entry *he) +static int hists__collapse_insert_entry (struct hists *hists, +struct rb_root *root, +struct hist_entry *he) {struct rb_node **p = &root->rb_node;struct rb_node *parent =NULL ;
tools/perf/util/hist.h +0 -2
@@ -199,8 +199,6 @@ int hists__init(void);int __hists__init (struct hists *hists,struct perf_hpp_list *hpp_list);struct rb_root *hists__get_rotate_entries_in (struct hists *hists); -int hists__collapse_insert_entry (struct hists *hists, -struct rb_root *root,struct hist_entry *he);struct perf_hpp {char *buf;
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Make hists__collapse_insert_entry static
perf tools: Make hists__collapse_insert_entry static
Commit-ID: 592dac6f35cf222a7687d4ff1ea7df0e6ef722e0 Gitweb: http://git.kernel.org/tip/592dac6f35cf222a7687d4ff1ea7df0e6ef722e0 Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 24 Mar 2016 13:52:17 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 30 Mar 2016 11:14:07 -0300
perf tools: Make hists__collapse_insert_entry static
No need to export hists__collapse_insert_entry function.
--- tools/perf/util/hist.c | 5 +++-- tools/perf/util/hist.h | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-)
tools/perf/util/hist.c +3 -2
@@ -1295,8 +1295,9 @@ static int hists__hierarchy_insert_entry(struct hists *hists,return ret; } -int hists__collapse_insert_entry (struct hists *hists,struct rb_root *root, -struct hist_entry *he) +static int hists__collapse_insert_entry (struct hists *hists, +struct rb_root *root, +struct hist_entry *he) {struct rb_node **p = &root->rb_node;struct rb_node *parent =NULL ;
tools/perf/util/hist.h +0 -2
@@ -199,8 +199,6 @@ int hists__init(void);int __hists__init (struct hists *hists,struct perf_hpp_list *hpp_list);struct rb_root *hists__get_rotate_entries_in (struct hists *hists); -int hists__collapse_insert_entry (struct hists *hists, -struct rb_root *root,struct hist_entry *he);struct perf_hpp {char *buf;
Jiri Olsa
reviewerPATCH 4/6 perf tools: Introduce trim function
In reply to Jiri OlsaTo be used in cases for both sides trim.
--- tools/perf/ui/browsers/hists.c | 3 +-- tools/perf/ui/stdio/hist.c | 3 +-- tools/perf/util/util.h | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-)
tools/perf/ui/browsers/hists.c +1 -2
@@ -1607,9 +1607,8 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows ret = fmt->header (fmt, &dummy_hpp,hists_to_evsel (hists)); dummy_hpp.buf[ret] ='\0' ; -rtrim (dummy_hpp.buf); - start =ltrim (dummy_hpp.buf); + start =trim (dummy_hpp.buf); ret =strlen (start);if (start != dummy_hpp.buf)
tools/perf/ui/stdio/hist.c +1 -2
@@ -569,9 +569,8 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp, first_col = false; fmt->header (fmt, hpp,hists_to_evsel (hists)); -rtrim (hpp->buf); - header_width +=fprintf (fp,"%s" ,ltrim (hpp->buf)); + header_width +=fprintf (fp,"%s" ,trim (hpp->buf)); } }
tools/perf/util/util.h +5 -0
@@ -254,6 +254,11 @@ int hex2u64(const char *ptr, u64 *val);char *ltrim (char *s);char *rtrim (char *s); +static inline char *trim (char *s) +{ +return ltrim (rtrim (s)); +} +void dump_stack (void );void sighandler_dump_stack (int sig);
Signature · 1 line
2.4.3
Jiri Olsa
reviewerPATCH 5/6 perf tools: Unify -f/--force option documentation
In reply to Jiri Olsa--- tools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-diff.txt | 2 +- tools/perf/Documentation/perf-report.txt | 2 +- tools/perf/Documentation/perf-script.txt | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-annotate.txt +1 -1
@@ -33,7 +33,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. -v:: --verbose::
tools/perf/Documentation/perf-diff.txt +1 -1
@@ -75,7 +75,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. --symfs=<directory>:: Look for files with symbols relative to this directory.
tools/perf/Documentation/perf-report.txt +1 -1
@@ -285,7 +285,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. --symfs=<directory>:: Look for files with symbols relative to this directory.
tools/perf/Documentation/perf-script.txt +4 -0
@@ -262,6 +262,10 @@ include::itrace.txt[] --ns:: Use 9 decimal places when displaying time (i.e. show the nanoseconds) +-f:: +--force:: + Don't do ownership validation. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-script-perl[1],
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Make -f/--force option documentation consistent across tools
perf tools: Make -f/--force option documentation consistent across tools
Commit-ID: e0be62cc0325d65e1b7ae55d23e3d224638c20a6 Gitweb: http://git.kernel.org/tip/e0be62cc0325d65e1b7ae55d23e3d224638c20a6 Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 24 Mar 2016 13:52:19 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 30 Mar 2016 11:14:08 -0300
perf tools: Make -f/--force option documentation consistent across tools
--- tools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-diff.txt | 2 +- tools/perf/Documentation/perf-report.txt | 2 +- tools/perf/Documentation/perf-script.txt | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-annotate.txt +1 -1
@@ -33,7 +33,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. -v:: --verbose::
tools/perf/Documentation/perf-diff.txt +1 -1
@@ -75,7 +75,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. --symfs=<directory>:: Look for files with symbols relative to this directory.
tools/perf/Documentation/perf-report.txt +1 -1
@@ -285,7 +285,7 @@ OPTIONS -f:: --force:: - Don't complain, do it. + Don't do ownership validation. --symfs=<directory>:: Look for files with symbols relative to this directory.
tools/perf/Documentation/perf-script.txt +4 -0
@@ -262,6 +262,10 @@ include::itrace.txt[] --ns:: Use 9 decimal places when displaying time (i.e. show the nanoseconds) +-f:: +--force:: + Don't do ownership validation. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-script-perl[1],
Jiri Olsa
reviewerPATCH 6/6 perf tests: Add test to check for event times
In reply to Jiri OlsaThis test creates software event 'cpu-clock'
attaches it in several ways and checks that
enabled and running times match.
--- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/event-times.c | 236 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 242 insertions(+) create mode 100644 tools/perf/tests/event-times.c
tools/perf/tests/Build +1 -0
@@ -37,6 +37,7 @@ perf-y += topology.o perf-y += cpumap.o perf-y += stat.o perf-y += event_update.o +perf-y += event-times.o $(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c tests/Build $(call rule_mkdir)
tools/perf/tests/builtin-test.c +4 -0
@@ -204,6 +204,10 @@ static struct test generic_tests[] = { .func = test__event_update, }, { + .desc = "Test events times", + .func = test__event_times, + }, + { .func = NULL, }, };
tools/perf/tests/event-times.c new file +236 -0
236 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -85,6 +85,7 @@ int test__synthesize_stat_config(int subtest);int test__synthesize_stat (int subtest);int test__synthesize_stat_round (int subtest);int test__event_update (int subtest); +int test__event_times (int subtest);#if defined(__arm__) || defined(__aarch64__)#ifdef HAVE_DWARF_UNWIND_SUPPORT
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests: Add test to check for event times
perf tests: Add test to check for event times
Commit-ID: b31d660df37c1701fd18d526faeb9a86f0fc7dd2 Gitweb: http://git.kernel.org/tip/b31d660df37c1701fd18d526faeb9a86f0fc7dd2 Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 24 Mar 2016 13:52:20 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 30 Mar 2016 11:14:08 -0300
perf tests: Add test to check for event times
This test creates software event 'cpu-clock' attaches it in several ways and checks that enabled and running times match.
Committer notes:
Testing it:
[acme@jouet linux]$ perf test -v times
44: Test events times :
--- start ---
test child forked, pid 27170
attaching to spawned child, enable on exec
OK : ena 307328, run 307328
attaching to current thread as enabled
OK : ena 7826, run 7826
attaching to current thread as disabled
OK : ena 738, run 738 attaching to CPU 0 as enabled
SKIP : not enough rights
attaching to CPU 0 as enabled
SKIP : not enough rights
test child finished with -2
---- end ----
Test events times: Skip
[acme@jouet linux]$
[root@jouet ~]# perf test times
44: Test events times : Ok
[root@jouet ~]# perf test -v times
44: Test events times :
--- start ---
test child forked, pid 27306
attaching to spawned child, enable on exec
OK : ena 479290, run 479290
attaching to current thread as enabled
OK : ena 11356, run 11356
attaching to current thread as disabled
OK : ena 987, run 987
attaching to CPU 0 as enabled
OK : ena 3717, run 3717
attaching to CPU 0 as enabled
OK : ena 2323, run 2323 test child finished with 0
---- end ----
Test events times: Ok
[root@jouet ~]#
--- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/event-times.c | 236 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 242 insertions(+)
tools/perf/tests/Build +1 -0
@@ -37,6 +37,7 @@ perf-y += topology.o perf-y += cpumap.o perf-y += stat.o perf-y += event_update.o +perf-y += event-times.o $(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c tests/Build $(call rule_mkdir)
tools/perf/tests/builtin-test.c +4 -0
@@ -204,6 +204,10 @@ static struct test generic_tests[] = { .func = test__event_update, }, { + .desc = "Test events times", + .func = test__event_times, + }, + { .func = NULL, }, };
tools/perf/tests/event-times.c new file +236 -0
236 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -85,6 +85,7 @@ int test__synthesize_stat_config(int subtest);int test__synthesize_stat (int subtest);int test__synthesize_stat_round (int subtest);int test__event_update (int subtest); +int test__event_times (int subtest);#if defined(__arm__) || defined(__aarch64__)#ifdef HAVE_DWARF_UNWIND_SUPPORT
Arnaldo Carvalho de Melo
maintainerEm Thu, Mar 24, 2016 at 01:52:14PM +0100, Jiri Olsa escreveu:
Quoted 6 lines
hi,
sending assorted fixes and leftover from previous mem patchset.Also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes
Applied all, after adjustments, except for patch 1.
- Arnaldo
Quoted 30 lines
thanks,
jirka
---
Jiri Olsa (6):
perf mem: Add --ldlat option
perf mem: Add -U/-K (--all-user/--all-kernel) options perf tools: Makehists__collapse_insert_entrystatic perf tools: Introduce trim function
perf tools: Unify -f/--force option documentation perf tests: Add test to check for event timestools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-diff.txt | 2 +- tools/perf/Documentation/perf-mem.txt | 11 +++++ tools/perf/Documentation/perf-report.txt | 2 +- tools/perf/Documentation/perf-script.txt | 4 ++ tools/perf/builtin-mem.c | 12 ++++- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 ++ tools/perf/tests/event-times.c | 236 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 3 +- tools/perf/ui/stdio/hist.c | 3 +- tools/perf/util/hist.c | 5 +- tools/perf/util/hist.h | 2 - tools/perf/util/mem-events.c | 17 ++++++- tools/perf/util/mem-events.h | 1 + tools/perf/util/util.h | 5 ++ 17 files changed, 298 insertions(+), 13 deletions(-) create mode 100644 tools/perf/tests/event-times.c