perf tools: Fix attr tests
Jiri Olsa
reviewercover perf tools: Fix attr tests
hi,
attr tests have been broken for some time now. Updating the data files plus some other processing fixes.
It's also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/attr_test
thanks,
jirka
---
tools/perf/perf.h | 1 +
tools/perf/tests/attr.c | 12 +++++++++++-
tools/perf/tests/attr.py | 50 +++++++++++++++++++++++++++++---------------------
tools/perf/tests/attr/base-record | 8 ++++----
tools/perf/tests/attr/base-stat | 4 ++--
tools/perf/tests/attr/test-record-C0 | 1 +
tools/perf/tests/attr/test-record-basic | 1 +
tools/perf/tests/attr/test-record-branch-any | 2 +-
tools/perf/tests/attr/test-record-branch-filter-any | 2 +-
tools/perf/tests/attr/test-record-branch-filter-any_call | 2 +-
tools/perf/tests/attr/test-record-branch-filter-any_ret | 2 +-
tools/perf/tests/attr/test-record-branch-filter-hv | 2 +-
tools/perf/tests/attr/test-record-branch-filter-ind_call | 2 +-
tools/perf/tests/attr/test-record-branch-filter-k | 2 +-
tools/perf/tests/attr/test-record-branch-filter-u | 2 +-
tools/perf/tests/attr/test-record-count | 1 +
tools/perf/tests/attr/test-record-data | 3 +--
tools/perf/tests/attr/test-record-freq | 1 +
tools/perf/tests/attr/test-record-graph-default | 1 +
tools/perf/tests/attr/test-record-graph-dwarf | 4 +++-
tools/perf/tests/attr/test-record-graph-fp | 1 +
tools/perf/tests/attr/test-record-group | 2 ++
tools/perf/tests/attr/test-record-group-sampling | 3 ++-
tools/perf/tests/attr/test-record-group1 | 2 ++
tools/perf/tests/attr/{test-record-no-delay => test-record-no-buffering} | 4 ++--
tools/perf/tests/attr/test-record-no-inherit | 1 +
tools/perf/tests/attr/test-record-no-samples | 1 +
tools/perf/tests/attr/test-record-period | 1 +
tools/perf/tests/attr/test-record-raw | 2 +-
tools/perf/tests/attr/test-stat-C0 | 4 ++--
tools/perf/tests/attr/test-stat-default | 2 ++
tools/perf/tests/attr/test-stat-detailed-1 | 2 ++
tools/perf/tests/attr/test-stat-detailed-2 | 3 +++
tools/perf/tests/attr/test-stat-detailed-3 | 5 +++++
tools/perf/util/evsel.c | 8 +++++++-
35 files changed, 98 insertions(+), 46 deletions(-)Jiri Olsa
reviewerPATCH 1/15 perf tools: Fix -n option
The kernel fails to add a non sampling event event with having precise_ip set.
Make sure the precise_ip is 0 when using -n option to create non sampling event in record.
--- tools/perf/util/evsel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/util/evsel.c +3 -1
@@ -890,8 +890,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, attr->sample_period =0 ; } -if (opts->no_samples) +if (opts->no_samples) { attr->sample_freq =0 ; + attr->precise_ip =0 ; + }if (opts->inherit_stat) attr->inherit_stat =1 ;
Signature · 1 line
2.9.4
Arnaldo Carvalho de Melo
maintainerRe: [PATCH 01/15] perf tools: Fix -n option
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.
Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
I ask this because perhaps we should tell the user that what its being asked on a command line doesn't make sense instead of dropping the precise_ip as in your patch.
- Arnaldo
Quoted 24 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/evsel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/perf/util/evsel.c +3
-1@@ -890,8 +890,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, attr->sample_period =0 ; } -if (opts->no_samples) +if (opts->no_samples) { attr->sample_freq =0 ; + attr->precise_ip =0 ; + }if (opts->inherit_stat) attr->inherit_stat =1 ;Signature · 1 line
2.9.4
PATCH v2 1/15 perf tools: Fix -n option
Quoted 9 lines · Arnaldo Carvalho de Melo
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:pppu). /bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
v2 attached, thanks
jirka
---
The kernel fails to add a non sampling event event with having precise_ip set, like:
$ perf record -e cycles:ppp -n ls Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:pppu). /bin/dmesg may provide additional information. No CONFIG_PERF_EVENTS=y kernel support configured?
Make sure the precise_ip is 0 when using -n option to create non sampling event in record.
--- tools/perf/util/evsel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/util/evsel.c +3 -1
@@ -890,8 +890,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, attr->sample_period =0 ; } -if (opts->no_samples) +if (opts->no_samples) { attr->sample_freq =0 ; + attr->precise_ip =0 ; + }if (opts->inherit_stat) attr->inherit_stat =1 ;
Signature · 1 line
2.9.4
Arnaldo Carvalho de Melo
maintainerRe: [PATCHv2 01/15] perf tools: Fix -n option
Em Mon, Jul 03, 2017 at 05:16:54PM +0200, Jiri Olsa escreveu:
Quoted 19 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking/proc/sys/kernel/perf_event_max_sample_rate.
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (cycles:pppu)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?
Quoted 1 line
v2 attached, thanks
Ok, so the user asks for --no-samples but at the same time asks for precision equal to :ppp, we should stop right there and warn the user that that is not possible, instead of silently dropping off what the user explicitely asked.
I'm cooking a few patches to allow that, then we can apply your patch, that, with the current set of users will never kick in :-)
- Arnaldo
Quoted 40 lines
jirka
---
The kernel fails to add a non sampling event event with havingprecise_ipset, like:$ perf record -e cycles:ppp -n ls Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:pppu). /bin/dmesg may provide additional information. No CONFIG_PERF_EVENTS=y kernel support configured?Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/evsel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/perf/util/evsel.c +3
-1@@ -890,8 +890,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, attr->sample_period =0 ; } -if (opts->no_samples) +if (opts->no_samples) { attr->sample_freq =0 ; + attr->precise_ip =0 ; + }if (opts->inherit_stat) attr->inherit_stat =1 ;Signature · 1 line
2.9.4
Re: [PATCHv2 01/15] perf tools: Fix -n option
Quoted 20 lines · Arnaldo Carvalho de Melo
Em Mon, Jul 03, 2017 at 05:16:54PM +0200, Jiri Olsa escreveu:
Quoted 19 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking/proc/sys/kernel/perf_event_max_sample_rate.
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (cycles:pppu)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?
Quoted 6 lines
Quoted 1 line
v2 attached, thanks
Ok, so the user asks for --no-samples but at the same time asks for precision equal to :ppp, we should stop right there and warn the user that that is not possible, instead of silently dropping off what the user explicitely asked.
well I take this option more like debug/devel one.. you have failing command line and want to investigate the kernel state without having samples generated under your fingers
can't see why would normal user need it
Quoted 3 lines
I'm cooking a few patches to allow that, then we can apply your patch, that, with the current set of users will never kick in :-)
ok
jirka
Arnaldo Carvalho de Melo
maintainerRe: [PATCHv2 01/15] perf tools: Fix -n option
Em Mon, Jul 03, 2017 at 06:22:28PM +0200, Jiri Olsa escreveu:
Quoted 28 lines · Arnaldo Carvalho de Melo
Quoted 20 lines
Em Mon, Jul 03, 2017 at 05:16:54PM +0200, Jiri Olsa escreveu:
Quoted 19 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking/proc/sys/kernel/perf_event_max_sample_rate.
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (cycles:pppu)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?Quoted 6 lines
Quoted 1 line
v2 attached, thanks
Ok, so the user asks for --no-samples but at the same time asks for precision equal to :ppp, we should stop right there and warn the user that that is not possible, instead of silently dropping off what the user explicitely asked.
Quoted 9 lines
well I take this option more like debug/devel one.. you have failing command line and want to investigate the kernel state without having samples generated under your fingers
can't see why would normal user need it
Quoted 3 lines
I'm cooking a few patches to allow that, then we can apply your patch, that, with the current set of users will never kick in :-)
Take a look at:
and:
Its in my perf/core branch now.
- Arnaldo
Re: [PATCHv2 01/15] perf tools: Fix -n option
Quoted 41 lines · Arnaldo Carvalho de Melo
Em Mon, Jul 03, 2017 at 06:22:28PM +0200, Jiri Olsa escreveu:
Quoted 28 lines · Arnaldo Carvalho de Melo
Quoted 20 lines
Em Mon, Jul 03, 2017 at 05:16:54PM +0200, Jiri Olsa escreveu:
Quoted 19 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
Quoted 5 lines
The kernel fails to add a non sampling event event with having
precise_ipset.Make sure the
precise_ipis 0 when using -n option to create non sampling event in record.Ok, but how could that happen? What was the scenario? Which command? Can you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking/proc/sys/kernel/perf_event_max_sample_rate.
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (cycles:pppu)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?Quoted 6 lines
Quoted 1 line
v2 attached, thanks
Ok, so the user asks for --no-samples but at the same time asks for precision equal to :ppp, we should stop right there and warn the user that that is not possible, instead of silently dropping off what the user explicitely asked.
Quoted 9 lines
well I take this option more like debug/devel one.. you have failing command line and want to investigate the kernel state without having samples generated under your fingers
can't see why would normal user need it
Quoted 3 lines
I'm cooking a few patches to allow that, then we can apply your patch, that, with the current set of users will never kick in :-)
Take a look at:
Quoted 7 lines
and:
Its in my perf/core branch now.
I think I'd just go for simple warning once we detect -n and :p but if you think error is necessary I'll live ;-)
jirka
Arnaldo Carvalho de Melo
maintainerRe: [PATCHv2 01/15] perf tools: Fix -n option
Em Mon, Jul 03, 2017 at 06:58:38PM +0200, Jiri Olsa escreveu:
Quoted 21 lines · Arnaldo Carvalho de Melo
Quoted 19 lines
Em Mon, Jul 03, 2017 at 06:22:28PM +0200, Jiri Olsa escreveu:
Quoted 6 lines · Arnaldo Carvalho de Melo
Quoted 4 lines
Ok, so the user asks for --no-samples but at the same time asks for precision equal to :ppp, we should stop right there and warn the user that that is not possible, instead of silently dropping off what the user explicitely asked.
Quoted 8 lines
well I take this option more like debug/devel one.. you have failing command line and want to investigate the kernel state without having samples generated under your fingers
can't see why would normal user need it
Quoted 2 lines
I'm cooking a few patches to allow that, then we can apply your patch, that, with the current set of users will never kick in :-)
Take a look at:
Quoted 8 lines
Quoted 5 lines
and:
Its in my perf/core branch now.
I think I'd just go for simple warning once we detect -n and :p but if you think error is necessary I'll live ;-)
Ok, so you don't find any error in my patches, good :-)
I don't like options that are developer-only-that-knows-what-is-doing, nor things that get chopped up behind your feet, so I think the way I did covers your case and provides meaningful error messages when an invalid combination of options is used.
- Arnaldo
Jiri Olsa
reviewerPATCH 2/15 perf tests attr: Do not store failed events
In reply to Jiri OlsaDo not mess up our temp space with files we don't
need - failed event open attempts.
--- tools/perf/tests/attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr.c +1 -1
@@ -136,7 +136,7 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, {int errno_saved = errno; -if (store_event (attr, pid, cpu, fd, group_fd, flags)) { +if ((fd !=-1 ) &&store_event (attr, pid, cpu, fd, group_fd, flags)) {pr_err ("test attr FAILED" );exit (128 ); }
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Do not store failed events
perf tests attr: Do not store failed events
Commit-ID: d78ada4a767a744cad5efa210b8acf57748b91d7 Gitweb: http://git.kernel.org/tip/d78ada4a767a744cad5efa210b8acf57748b91d7 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:17 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:14 -0300
perf tests attr: Do not store failed events
Do not mess up our temp space with files we don't need - failed event open attempts.
--- tools/perf/tests/attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr.c +1 -1
@@ -136,7 +136,7 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, {int errno_saved = errno; -if (store_event (attr, pid, cpu, fd, group_fd, flags)) { +if ((fd !=-1 ) &&store_event (attr, pid, cpu, fd, group_fd, flags)) {pr_err ("test attr FAILED" );exit (128 ); }
Jiri Olsa
reviewerPATCH 3/15 perf tests attr: Add test_attr__ready function
In reply to Jiri OlsaWe create many test events before the real ones just to test specific features. But there's no way for attr tests to separate those test events from those it needs to check.
Adding 'ready' call from the events open interface to trigger/start events collection for attr test.
--- tools/perf/perf.h | 1 + tools/perf/tests/attr.c | 10 ++++++++++ tools/perf/util/evsel.c | 4 ++++ 3 files changed, 15 insertions(+)
tools/perf/perf.h +1 -0
@@ -7,6 +7,7 @@#include <linux/perf_event.h> extern bool test_attr__enabled; +void test_attr__ready (void );void test_attr__init (void );void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu,int fd,int group_fd,unsigned long flags);
tools/perf/tests/attr.c +10 -0
@@ -36,6 +36,7 @@#define ENV "PERF_TEST_ATTR"static char *dir; +static bool ready;void test_attr__init (void ) {
@@ -67,6 +68,9 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,FILE *file;char path[PATH_MAX ]; +if (!ready) +return 0 ; +snprintf (path,PATH_MAX ,"%s/event-%d-%llu-%d" , dir, attr->type, attr->config, fd);
@@ -144,6 +148,12 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, errno = errno_saved; } +void test_attr__ready (void ) +{ +if (unlikely (test_attr__enabled) && !ready) + ready = true; +} +static int run_dir (const char *d,const char *perf) {char v[] ="-vvvvv" ;
tools/perf/util/evsel.c +4 -0
@@ -58,6 +58,8 @@ static int perf_evsel__no_extra_init(struct perf_evsel *evsel __maybe_unused)return 0 ; } +void __weak test_attr__ready (void ) { } +static void perf_evsel__no_extra_fini (struct perf_evsel *evsel__maybe_unused ) { }
@@ -1568,6 +1570,8 @@ int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,pr_debug2 ("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx" , pid, cpus->map[cpu], group_fd, flags); +test_attr__ready (); + fd =sys_perf_event_open (&evsel->attr, pid, cpus->map[cpu], group_fd, flags);
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Add test_attr__ready function
perf tests attr: Add test_attr__ready function
Commit-ID: 10213e2ff2e0453324689eb50e73df3df1ee6163 Gitweb: http://git.kernel.org/tip/10213e2ff2e0453324689eb50e73df3df1ee6163 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:18 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:15 -0300
perf tests attr: Add test_attr__ready function
We create many test events before the real ones just to test specific features. But there's no way for attr tests to separate those test events from those it needs to check.
Adding 'ready' call from the events open interface to trigger/start events collection for attr test.
--- tools/perf/perf.h | 1 + tools/perf/tests/attr.c | 10 ++++++++++ tools/perf/util/evsel.c | 4 ++++ 3 files changed, 15 insertions(+)
tools/perf/perf.h +1 -0
@@ -7,6 +7,7 @@#include <linux/perf_event.h> extern bool test_attr__enabled; +void test_attr__ready (void );void test_attr__init (void );void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu,int fd,int group_fd,unsigned long flags);
tools/perf/tests/attr.c +10 -0
@@ -36,6 +36,7 @@#define ENV "PERF_TEST_ATTR"static char *dir; +static bool ready;void test_attr__init (void ) {
@@ -67,6 +68,9 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,FILE *file;char path[PATH_MAX ]; +if (!ready) +return 0 ; +snprintf (path,PATH_MAX ,"%s/event-%d-%llu-%d" , dir, attr->type, attr->config, fd);
@@ -144,6 +148,12 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, errno = errno_saved; } +void test_attr__ready (void ) +{ +if (unlikely (test_attr__enabled) && !ready) + ready = true; +} +static int run_dir (const char *d,const char *perf) {char v[] ="-vvvvv" ;
tools/perf/util/evsel.c +4 -0
@@ -58,6 +58,8 @@ static int perf_evsel__no_extra_init(struct perf_evsel *evsel __maybe_unused)return 0 ; } +void __weak test_attr__ready (void ) { } +static void perf_evsel__no_extra_fini (struct perf_evsel *evsel__maybe_unused ) { }
@@ -1572,6 +1574,8 @@ retry_open:pr_debug2 ("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx" , pid, cpus->map[cpu], group_fd, flags); +test_attr__ready (); + fd =sys_perf_event_open (&evsel->attr, pid, cpus->map[cpu], group_fd, flags);
Jiri Olsa
reviewerPATCH 4/15 perf tests attr: Make compare_data global
In reply to Jiri OlsaMaking compare_data global, so it could be used outside the Test class scope to compare command results.
--- tools/perf/tests/attr.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
tools/perf/tests/attr.py +18 -18
@@ -9,6 +9,20 @@ import logging import shutil import ConfigParser +def compare_data(a, b): + # Allow multiple values in assignment separated by '|' + a_list = a.split('|') + b_list = b.split('|') + + for a_item in a_list: + for b_item in b_list: + if (a_item == b_item): + return True + elif (a_item == '*') or (b_item == '*'): + return True + + return False + class Fail(Exception): def __init__(self, test, msg): self.msg = msg
@@ -82,26 +96,12 @@ class Event(dict): self.add(base) self.add(data) - def compare_data(self, a, b): - # Allow multiple values in assignment separated by '|' - a_list = a.split('|') - b_list = b.split('|') - - for a_item in a_list: - for b_item in b_list: - if (a_item == b_item): - return True - elif (a_item == '*') or (b_item == '*'): - return True - - return False - def equal(self, other): for t in Event.terms: log.debug(" [%s] %s %s" % (t, self[t], other[t])); if not self.has_key(t) or not other.has_key(t): return False - if not self.compare_data(self[t], other[t]): + if not compare_data(self[t], other[t]): return False return True
@@ -109,7 +109,7 @@ class Event(dict): for t in Event.terms: if not self.has_key(t) or not other.has_key(t): continue - if not self.compare_data(self[t], other[t]): + if not compare_data(self[t], other[t]): log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) # Test file description needs to have following sections:
@@ -218,9 +218,9 @@ class Test(object): self.perf, self.command, tempdir, self.args) ret = os.WEXITSTATUS(os.system(cmd)) - log.info(" '%s' ret %d " % (cmd, ret)) + log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) - if ret != int(self.ret): + if not compare_data(str(ret), str(self.ret)): raise Unsup(self) def compare(self, expect, result):
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Make compare_data global
perf tests attr: Make compare_data global
Commit-ID: 04c31bcf86c4fa51022ec254827f1c7c41306167 Gitweb: http://git.kernel.org/tip/04c31bcf86c4fa51022ec254827f1c7c41306167 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:19 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:16 -0300
perf tests attr: Make compare_data global
Making compare_data global, so it could be used outside the Test class scope to compare command results.
--- tools/perf/tests/attr.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
tools/perf/tests/attr.py +18 -18
@@ -9,6 +9,20 @@ import logging import shutil import ConfigParser +def compare_data(a, b): + # Allow multiple values in assignment separated by '|' + a_list = a.split('|') + b_list = b.split('|') + + for a_item in a_list: + for b_item in b_list: + if (a_item == b_item): + return True + elif (a_item == '*') or (b_item == '*'): + return True + + return False + class Fail(Exception): def __init__(self, test, msg): self.msg = msg
@@ -82,26 +96,12 @@ class Event(dict): self.add(base) self.add(data) - def compare_data(self, a, b): - # Allow multiple values in assignment separated by '|' - a_list = a.split('|') - b_list = b.split('|') - - for a_item in a_list: - for b_item in b_list: - if (a_item == b_item): - return True - elif (a_item == '*') or (b_item == '*'): - return True - - return False - def equal(self, other): for t in Event.terms: log.debug(" [%s] %s %s" % (t, self[t], other[t])); if not self.has_key(t) or not other.has_key(t): return False - if not self.compare_data(self[t], other[t]): + if not compare_data(self[t], other[t]): return False return True
@@ -109,7 +109,7 @@ class Event(dict): for t in Event.terms: if not self.has_key(t) or not other.has_key(t): continue - if not self.compare_data(self[t], other[t]): + if not compare_data(self[t], other[t]): log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) # Test file description needs to have following sections:
@@ -218,9 +218,9 @@ class Test(object): self.perf, self.command, tempdir, self.args) ret = os.WEXITSTATUS(os.system(cmd)) - log.info(" '%s' ret %d " % (cmd, ret)) + log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) - if ret != int(self.ret): + if not compare_data(str(ret), str(self.ret)): raise Unsup(self) def compare(self, expect, result):
Jiri Olsa
reviewerPATCH 5/15 perf tests attr: Rename compare_data to data_equal
In reply to Jiri OlsaThe data_equal name fits better to the return value of the function. It's true when the data is equal.
--- tools/perf/tests/attr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/perf/tests/attr.py +4 -4
@@ -9,7 +9,7 @@ import logging import shutil import ConfigParser -def compare_data(a, b): +def data_equal(a, b): # Allow multiple values in assignment separated by '|' a_list = a.split('|') b_list = b.split('|')
@@ -101,7 +101,7 @@ class Event(dict): log.debug(" [%s] %s %s" % (t, self[t], other[t])); if not self.has_key(t) or not other.has_key(t): return False - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): return False return True
@@ -109,7 +109,7 @@ class Event(dict): for t in Event.terms: if not self.has_key(t) or not other.has_key(t): continue - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) # Test file description needs to have following sections:
@@ -220,7 +220,7 @@ class Test(object): log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) - if not compare_data(str(ret), str(self.ret)): + if not data_equal(str(ret), str(self.ret)): raise Unsup(self) def compare(self, expect, result):
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Rename compare_data to data_equal
perf tests attr: Rename compare_data to data_equal
Commit-ID: dde622a5063c71a1864a41dfaed4baaabfa84ba6 Gitweb: http://git.kernel.org/tip/dde622a5063c71a1864a41dfaed4baaabfa84ba6 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:20 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:16 -0300
perf tests attr: Rename compare_data to data_equal
The data_equal name fits better to the return value of the function. It's true when the data is equal.
--- tools/perf/tests/attr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/perf/tests/attr.py +4 -4
@@ -9,7 +9,7 @@ import logging import shutil import ConfigParser -def compare_data(a, b): +def data_equal(a, b): # Allow multiple values in assignment separated by '|' a_list = a.split('|') b_list = b.split('|')
@@ -101,7 +101,7 @@ class Event(dict): log.debug(" [%s] %s %s" % (t, self[t], other[t])); if not self.has_key(t) or not other.has_key(t): return False - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): return False return True
@@ -109,7 +109,7 @@ class Event(dict): for t in Event.terms: if not self.has_key(t) or not other.has_key(t): continue - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) # Test file description needs to have following sections:
@@ -220,7 +220,7 @@ class Test(object): log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) - if not compare_data(str(ret), str(self.ret)): + if not data_equal(str(ret), str(self.ret)): raise Unsup(self) def compare(self, expect, result):
Jiri Olsa
reviewerPATCH 6/15 perf tests attr: Add 1s for exclude_kernel and task base bits
In reply to Jiri OlsaThere's an event open fallback which set exclude_kernel=1 in case use does not have enough privileges. Adding both 0|1 for this attribute, because we don't know what value it is.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -15,7 +15,7 @@ inherit=1 pinned=0 exclusive=0 exclude_user=0 -exclude_kernel=0 +exclude_kernel=0|1 exclude_hv=0 exclude_idle=0 mmap=1
tools/perf/tests/attr/base-stat +1 -1
@@ -15,7 +15,7 @@ inherit=1 pinned=0 exclusive=0 exclude_user=0 -exclude_kernel=0 +exclude_kernel=0|1 exclude_hv=0 exclude_idle=0 mmap=0
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Add 1s for exclude_kernel and task base bits
perf tests attr: Add 1s for exclude_kernel and task base bits
Commit-ID: 5ced95b2374b0fb3c1d0367c6e8cf82d41292990 Gitweb: http://git.kernel.org/tip/5ced95b2374b0fb3c1d0367c6e8cf82d41292990 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:21 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:17 -0300
perf tests attr: Add 1s for exclude_kernel and task base bits
There's an event open fallback which set exclude_kernel=1 in case use does not have enough privileges. Adding both 0|1 for this attribute, because we don't know what value it is.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -15,7 +15,7 @@ inherit=1 pinned=0 exclusive=0 exclude_user=0 -exclude_kernel=0 +exclude_kernel=0|1 exclude_hv=0 exclude_idle=0 mmap=1
tools/perf/tests/attr/base-stat +1 -1
@@ -15,7 +15,7 @@ inherit=1 pinned=0 exclusive=0 exclude_user=0 -exclude_kernel=0 +exclude_kernel=0|1 exclude_hv=0 exclude_idle=0 mmap=0
Jiri Olsa
reviewerPATCH 7/15 perf tests attr: Fix record dwarf test
In reply to Jiri OlsaFollowing commit:
commit 5c0cf22477ea ("perf record: Store data mmaps for dwarf unwind")
have enabled address sampling for dwarf unwind, we need to reflect that in this test by adding ADDR sample_type and enabling mmap_data.
--- tools/perf/tests/attr/test-record-graph-dwarf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/tests/attr/test-record-graph-dwarf +2 -1
@@ -3,8 +3,9 @@ command = record args = --call-graph dwarf -- kill >/dev/null 2>&1 [event:base-record] -sample_type=12583 +sample_type=45359 exclude_callchain_user=1 sample_stack_user=8192 # TODO different for each arch, no support for that now sample_regs_user=* +mmap_data=1
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix record dwarf test
perf tests attr: Fix record dwarf test
Commit-ID: d9115e924088b714bb801713751bf7922d799f95 Gitweb: http://git.kernel.org/tip/d9115e924088b714bb801713751bf7922d799f95 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:22 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:18 -0300
perf tests attr: Fix record dwarf test
Following commit:
commit 5c0cf22477ea ("perf record: Store data mmaps for dwarf unwind")
have enabled address sampling for dwarf unwind, we need to reflect that in this test by adding ADDR sample_type and enabling mmap_data.
--- tools/perf/tests/attr/test-record-graph-dwarf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/tests/attr/test-record-graph-dwarf +2 -1
@@ -3,8 +3,9 @@ command = record args = --call-graph dwarf -- kill >/dev/null 2>&1 [event:base-record] -sample_type=12583 +sample_type=45359 exclude_callchain_user=1 sample_stack_user=8192 # TODO different for each arch, no support for that now sample_regs_user=* +mmap_data=1
Jiri Olsa
reviewerPATCH 8/15 perf tests attr: Fix no-delay test
In reply to Jiri OlsaFollowing commit:
commit 509051ea8427 ("perf record: Rename --no-delay to --no-buffering")
removed '-D' option and renamed --no-delay into --no-buffering. Fixing that in the attr tests.
---
.../perf/tests/attr/{test-record-no-delay => test-record-no-buffering} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename tools/perf/tests/attr/{test-record-no-delay => test-record-no-buffering} (70%)tools/perf/tests/attr/test-record-no-buffering renamed from tools/perf/tests/attr/test-record-no-delay +1 -1
@@ -1,6 +1,6 @@ [config] command = record -args = -D kill >/dev/null 2>&1 +args = --no-buffering kill >/dev/null 2>&1 [event:base-record] sample_period=4000
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix no-delay test
perf tests attr: Fix no-delay test
Commit-ID: 44fed277f81ba22e3f2fbcf1501c3b14aeb9f8e4 Gitweb: http://git.kernel.org/tip/44fed277f81ba22e3f2fbcf1501c3b14aeb9f8e4 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:23 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:18 -0300
perf tests attr: Fix no-delay test
Following commit:
commit 509051ea8427 ("perf record: Rename --no-delay to --no-buffering")
removed '-D' option and renamed --no-delay into --no-buffering. Fixing that in the attr tests.
---
.../perf/tests/attr/{test-record-no-delay => test-record-no-buffering} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/tests/attr/test-record-no-buffering renamed from tools/perf/tests/attr/test-record-no-delay +1 -1
@@ -1,6 +1,6 @@ [config] command = record -args = -D kill >/dev/null 2>&1 +args = --no-buffering kill >/dev/null 2>&1 [event:base-record] sample_period=4000
Jiri Olsa
reviewerPATCH 9/15 perf tests attr: Add proper return values
In reply to Jiri OlsaThe record command now properly returns the status of the tracee if there's any. We need to properly set the expected return value of the tracee in the attr tests.
--- tools/perf/tests/attr/test-record-C0 | 1 + tools/perf/tests/attr/test-record-basic | 1 + tools/perf/tests/attr/test-record-branch-any | 1 + tools/perf/tests/attr/test-record-branch-filter-any | 1 + tools/perf/tests/attr/test-record-branch-filter-any_call | 1 + tools/perf/tests/attr/test-record-branch-filter-any_ret | 1 + tools/perf/tests/attr/test-record-branch-filter-hv | 1 + tools/perf/tests/attr/test-record-branch-filter-ind_call | 1 + tools/perf/tests/attr/test-record-branch-filter-k | 1 + tools/perf/tests/attr/test-record-branch-filter-u | 1 + tools/perf/tests/attr/test-record-count | 1 + tools/perf/tests/attr/test-record-data | 1 + tools/perf/tests/attr/test-record-freq | 1 + tools/perf/tests/attr/test-record-graph-default | 1 + tools/perf/tests/attr/test-record-graph-dwarf | 1 + tools/perf/tests/attr/test-record-graph-fp | 1 + tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 1 + tools/perf/tests/attr/test-record-group1 | 1 + tools/perf/tests/attr/test-record-no-buffering | 1 + tools/perf/tests/attr/test-record-no-inherit | 1 + tools/perf/tests/attr/test-record-no-samples | 1 + tools/perf/tests/attr/test-record-period | 1 + tools/perf/tests/attr/test-record-raw | 1 + 24 files changed, 24 insertions(+)
tools/perf/tests/attr/test-record-C0 +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -C 0 kill >/dev/null 2>&1 +ret = 1 [event:base-record] cpu=0
tools/perf/tests/attr/test-record-basic +1 -0
@@ -1,5 +1,6 @@ [config] command = record args = kill >/dev/null 2>&1 +ret = 1 [event:base-record]
tools/perf/tests/attr/test-record-branch-any +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -b kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any_call +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any_call kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any_ret +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any_ret kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-hv +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j hv kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-ind_call +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j ind_call kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-k +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j k kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-u +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j u kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-count +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -c 123 kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=123
tools/perf/tests/attr/test-record-data +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -d kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-freq +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -F 100 kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=100
tools/perf/tests/attr/test-record-graph-default +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -g kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=295
tools/perf/tests/attr/test-record-graph-dwarf +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --call-graph dwarf -- kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=45359
tools/perf/tests/attr/test-record-graph-fp +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --call-graph fp kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=295
tools/perf/tests/attr/test-record-group +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --group -e cycles,instructions kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-group-sampling +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -e '{cycles,cache-misses}:S' kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-group1 +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -e '{cycles,instructions}' kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-no-buffering +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --no-buffering kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-no-inherit +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -i kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=263
tools/perf/tests/attr/test-record-no-samples +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -n kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=0
tools/perf/tests/attr/test-record-period +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -c 100 -P kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=100
tools/perf/tests/attr/test-record-raw +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -R kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Add proper return values
perf tests attr: Add proper return values
Commit-ID: a72fe0afa18abd8d05d26944b32850775cb6c941 Gitweb: http://git.kernel.org/tip/a72fe0afa18abd8d05d26944b32850775cb6c941 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:24 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:19 -0300
perf tests attr: Add proper return values
The record command now properly returns the status of the tracee if there's any. We need to properly set the expected return value of the tracee in the attr tests.
--- tools/perf/tests/attr/test-record-C0 | 1 + tools/perf/tests/attr/test-record-basic | 1 + tools/perf/tests/attr/test-record-branch-any | 1 + tools/perf/tests/attr/test-record-branch-filter-any | 1 + tools/perf/tests/attr/test-record-branch-filter-any_call | 1 + tools/perf/tests/attr/test-record-branch-filter-any_ret | 1 + tools/perf/tests/attr/test-record-branch-filter-hv | 1 + tools/perf/tests/attr/test-record-branch-filter-ind_call | 1 + tools/perf/tests/attr/test-record-branch-filter-k | 1 + tools/perf/tests/attr/test-record-branch-filter-u | 1 + tools/perf/tests/attr/test-record-count | 1 + tools/perf/tests/attr/test-record-data | 1 + tools/perf/tests/attr/test-record-freq | 1 + tools/perf/tests/attr/test-record-graph-default | 1 + tools/perf/tests/attr/test-record-graph-dwarf | 1 + tools/perf/tests/attr/test-record-graph-fp | 1 + tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 1 + tools/perf/tests/attr/test-record-group1 | 1 + tools/perf/tests/attr/test-record-no-buffering | 1 + tools/perf/tests/attr/test-record-no-inherit | 1 + tools/perf/tests/attr/test-record-no-samples | 1 + tools/perf/tests/attr/test-record-period | 1 + tools/perf/tests/attr/test-record-raw | 1 + 24 files changed, 24 insertions(+)
tools/perf/tests/attr/test-record-C0 +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -C 0 kill >/dev/null 2>&1 +ret = 1 [event:base-record] cpu=0
tools/perf/tests/attr/test-record-basic +1 -0
@@ -1,5 +1,6 @@ [config] command = record args = kill >/dev/null 2>&1 +ret = 1 [event:base-record]
tools/perf/tests/attr/test-record-branch-any +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -b kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any_call +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any_call kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-any_ret +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j any_ret kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-hv +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j hv kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-ind_call +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j ind_call kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-k +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j k kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-branch-filter-u +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -j u kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-count +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -c 123 kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=123
tools/perf/tests/attr/test-record-data +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -d kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-freq +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -F 100 kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=100
tools/perf/tests/attr/test-record-graph-default +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -g kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=295
tools/perf/tests/attr/test-record-graph-dwarf +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --call-graph dwarf -- kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=45359
tools/perf/tests/attr/test-record-graph-fp +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --call-graph fp kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=295
tools/perf/tests/attr/test-record-group +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --group -e cycles,instructions kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-group-sampling +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -e '{cycles,cache-misses}:S' kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-group1 +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -e '{cycles,instructions}' kill >/dev/null 2>&1 +ret = 1 [event-1:base-record] fd=1
tools/perf/tests/attr/test-record-no-buffering +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = --no-buffering kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
tools/perf/tests/attr/test-record-no-inherit +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -i kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_type=263
tools/perf/tests/attr/test-record-no-samples +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -n kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=0
tools/perf/tests/attr/test-record-period +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -c 100 -P kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=100
tools/perf/tests/attr/test-record-raw +1 -0
@@ -1,6 +1,7 @@ [config] command = record args = -R kill >/dev/null 2>&1 +ret = 1 [event:base-record] sample_period=4000
Jiri Olsa
reviewerPATCH 10/15 perf tests attr: Fix cpu test disabled term setup
In reply to Jiri OlsaThe stat command creates all events disabled and enables them either manualy or via the enable_on_exec bit.
--- tools/perf/tests/attr/test-stat-C0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/attr/test-stat-C0 +2 -2
@@ -4,6 +4,6 @@ args = -e cycles -C 0 kill >/dev/null 2>&1 ret = 1 [event:base-stat] -# events are enabled by default when attached to cpu -disabled=0 +# events are disabled by default when attached to cpu +disabled=1 enable_on_exec=0
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix cpu test disabled term setup
perf tests attr: Fix cpu test disabled term setup
Commit-ID: 6f193400eaf1de53145cc13ff69f88336e9a9c9a Gitweb: http://git.kernel.org/tip/6f193400eaf1de53145cc13ff69f88336e9a9c9a Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:25 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:19 -0300
perf tests attr: Fix cpu test disabled term setup
The stat command creates all events disabled and enables them either manualy or via the enable_on_exec bit.
--- tools/perf/tests/attr/test-stat-C0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/attr/test-stat-C0 +2 -2
@@ -4,6 +4,6 @@ args = -e cycles -C 0 kill >/dev/null 2>&1 ret = 1 [event:base-stat] -# events are enabled by default when attached to cpu -disabled=0 +# events are disabled by default when attached to cpu +disabled=1 enable_on_exec=0
Jiri Olsa
reviewerPATCH 11/15 perf tests attr: Fix sample_period setup
In reply to Jiri OlsaThe final period can differ from what user specifies on command line due to the perf_event_max_sample_rate sysctl setup.
Thus we can't predixt the sample_period value any more.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-branch-any | 1 - tools/perf/tests/attr/test-record-branch-filter-any | 1 - tools/perf/tests/attr/test-record-branch-filter-any_call | 1 - tools/perf/tests/attr/test-record-branch-filter-any_ret | 1 - tools/perf/tests/attr/test-record-branch-filter-hv | 1 - tools/perf/tests/attr/test-record-branch-filter-ind_call | 1 - tools/perf/tests/attr/test-record-branch-filter-k | 1 - tools/perf/tests/attr/test-record-branch-filter-u | 1 - tools/perf/tests/attr/test-record-data | 2 -- tools/perf/tests/attr/test-record-no-buffering | 1 - tools/perf/tests/attr/test-record-raw | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -7,7 +7,7 @@ cpu=* type=0|1 size=112 config=0 -sample_period=4000 +sample_period=* sample_type=263 read_format=0 disabled=1
tools/perf/tests/attr/test-record-branch-any +0 -1
@@ -4,6 +4,5 @@ args = -b kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-any +0 -1
@@ -4,6 +4,5 @@ args = -j any kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-any_call +0 -1
@@ -4,6 +4,5 @@ args = -j any_call kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=16
tools/perf/tests/attr/test-record-branch-filter-any_ret +0 -1
@@ -4,6 +4,5 @@ args = -j any_ret kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=32
tools/perf/tests/attr/test-record-branch-filter-hv +0 -1
@@ -4,6 +4,5 @@ args = -j hv kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-ind_call +0 -1
@@ -4,6 +4,5 @@ args = -j ind_call kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=64
tools/perf/tests/attr/test-record-branch-filter-k +0 -1
@@ -4,6 +4,5 @@ args = -j k kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-u +0 -1
@@ -4,6 +4,5 @@ args = -j u kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-data +0 -2
@@ -4,8 +4,6 @@ args = -d kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 - # sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | # PERF_SAMPLE_ADDR | PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC sample_type=33039
tools/perf/tests/attr/test-record-no-buffering +0 -1
@@ -4,7 +4,6 @@ args = --no-buffering kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=263 watermark=0 wakeup_events=1
tools/perf/tests/attr/test-record-raw +0 -1
@@ -4,5 +4,4 @@ args = -R kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=1415
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix sample_period setup
perf tests attr: Fix sample_period setup
Commit-ID: 5ff0cf421c37f53bb658a097c610cc1e3ced1133 Gitweb: http://git.kernel.org/tip/5ff0cf421c37f53bb658a097c610cc1e3ced1133 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:26 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:20 -0300
perf tests attr: Fix sample_period setup
The final period can differ from what user specifies on command line due to the perf_event_max_sample_rate sysctl setup.
Thus we can't predixt the sample_period value any more.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-branch-any | 1 - tools/perf/tests/attr/test-record-branch-filter-any | 1 - tools/perf/tests/attr/test-record-branch-filter-any_call | 1 - tools/perf/tests/attr/test-record-branch-filter-any_ret | 1 - tools/perf/tests/attr/test-record-branch-filter-hv | 1 - tools/perf/tests/attr/test-record-branch-filter-ind_call | 1 - tools/perf/tests/attr/test-record-branch-filter-k | 1 - tools/perf/tests/attr/test-record-branch-filter-u | 1 - tools/perf/tests/attr/test-record-data | 2 -- tools/perf/tests/attr/test-record-no-buffering | 1 - tools/perf/tests/attr/test-record-raw | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -7,7 +7,7 @@ cpu=* type=0|1 size=112 config=0 -sample_period=4000 +sample_period=* sample_type=263 read_format=0 disabled=1
tools/perf/tests/attr/test-record-branch-any +0 -1
@@ -4,6 +4,5 @@ args = -b kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-any +0 -1
@@ -4,6 +4,5 @@ args = -j any kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-any_call +0 -1
@@ -4,6 +4,5 @@ args = -j any_call kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=16
tools/perf/tests/attr/test-record-branch-filter-any_ret +0 -1
@@ -4,6 +4,5 @@ args = -j any_ret kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=32
tools/perf/tests/attr/test-record-branch-filter-hv +0 -1
@@ -4,6 +4,5 @@ args = -j hv kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-ind_call +0 -1
@@ -4,6 +4,5 @@ args = -j ind_call kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=64
tools/perf/tests/attr/test-record-branch-filter-k +0 -1
@@ -4,6 +4,5 @@ args = -j k kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-branch-filter-u +0 -1
@@ -4,6 +4,5 @@ args = -j u kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=2311 branch_sample_type=8
tools/perf/tests/attr/test-record-data +0 -2
@@ -4,8 +4,6 @@ args = -d kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 - # sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | # PERF_SAMPLE_ADDR | PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC sample_type=33039
tools/perf/tests/attr/test-record-no-buffering +0 -1
@@ -4,7 +4,6 @@ args = --no-buffering kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=263 watermark=0 wakeup_events=1
tools/perf/tests/attr/test-record-raw +0 -1
@@ -4,5 +4,4 @@ args = -R kill >/dev/null 2>&1 ret = 1 [event:base-record] -sample_period=4000 sample_type=1415
Jiri Olsa
reviewerPATCH 12/15 perf tests attr: Fix precise_ip setup
In reply to Jiri OlsaWe have test to detect to highest precise possible, so test can't just predict precise_ip value.
--- tools/perf/tests/attr/base-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr/base-record +1 -1
@@ -25,7 +25,7 @@ inherit_stat=0 enable_on_exec=1 task=0 watermark=0 -precise_ip=0 +precise_ip=0|1|2|3 mmap_data=0 sample_id_all=1 exclude_host=0|1
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix precise_ip setup
perf tests attr: Fix precise_ip setup
Commit-ID: 042049404f7a149446d5c839a088fb928b11ce7a Gitweb: http://git.kernel.org/tip/042049404f7a149446d5c839a088fb928b11ce7a Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:27 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:21 -0300
perf tests attr: Fix precise_ip setup
We have a test to detect to highest precise possible, so test can't just predict precise_ip value.
--- tools/perf/tests/attr/base-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr/base-record +1 -1
@@ -25,7 +25,7 @@ inherit_stat=0 enable_on_exec=1 task=0 watermark=0 -precise_ip=0 +precise_ip=0|1|2|3 mmap_data=0 sample_id_all=1 exclude_host=0|1
Jiri Olsa
reviewerPATCH 13/15 perf tests attr: Fix stat sample_type setup
In reply to Jiri OlsaQuoted 1 line
From following commit:
commit 4979d0c7d0c7 ("perf stat record: Add record command")
we started to assign PERF_SAMPLE_IDENTIFIER to sample_type.
Fixing the attr stat tests accordingly.
--- tools/perf/tests/attr/base-stat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr/base-stat +1 -1
@@ -8,7 +8,7 @@ type=0 size=112 config=0 sample_period=0 -sample_type=0 +sample_type=65536 read_format=3 disabled=1 inherit=1
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix stat sample_type setup
perf tests attr: Fix stat sample_type setup
Commit-ID: b78e92e6071d5131f5ba6b25437d82c0fcef09de Gitweb: http://git.kernel.org/tip/b78e92e6071d5131f5ba6b25437d82c0fcef09de Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:28 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:21 -0300
perf tests attr: Fix stat sample_type setup
Quoted 1 line
From following commit:
commit 4979d0c7d0c7 ("perf stat record: Add record command")
we started to assign PERF_SAMPLE_IDENTIFIER to sample_type.
Fixing the attr stat tests accordingly.
--- tools/perf/tests/attr/base-stat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/attr/base-stat +1 -1
@@ -8,7 +8,7 @@ type=0 size=112 config=0 sample_period=0 -sample_type=0 +sample_type=65536 read_format=3 disabled=1 inherit=1
Jiri Olsa
reviewerPATCH 14/15 perf tests attr: Add optional term
In reply to Jiri OlsaSome of the stat events are quite rare to find on common machines (like front end cycles).
Adding an 'optional' term to mark such events in attr tests. Event marked as optional will not fail the test case if it's not found in results.
--- tools/perf/tests/attr.py | 14 +++++++++++--- tools/perf/tests/attr/test-stat-default | 2 ++ tools/perf/tests/attr/test-stat-detailed-1 | 2 ++ tools/perf/tests/attr/test-stat-detailed-2 | 3 +++ tools/perf/tests/attr/test-stat-detailed-3 | 5 +++++ 5 files changed, 23 insertions(+), 3 deletions(-)
tools/perf/tests/attr.py +11 -3
@@ -105,6 +105,11 @@ class Event(dict): return False return True + def optional(self): + if self.has_key('optional') and self['optional'] == '1': + return True + return False + def diff(self, other): for t in Event.terms: if not self.has_key(t) or not other.has_key(t):
@@ -244,9 +249,12 @@ class Test(object): log.debug(" match: [%s] matches %s" % (exp_name, str(exp_list))) # we did not any matching event - fail - if (not exp_list): - exp_event.diff(res_event) - raise Fail(self, 'match failure'); + if not exp_list: + if exp_event.optional(): + log.debug(" %s does not match, but is optional" % exp_name) + else: + exp_event.diff(res_event) + raise Fail(self, 'match failure'); match[exp_name] = exp_list
tools/perf/tests/attr/test-stat-default +2 -0
@@ -38,12 +38,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
tools/perf/tests/attr/test-stat-detailed-1 +2 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
tools/perf/tests/attr/test-stat-detailed-2 +3 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
@@ -108,6 +110,7 @@ config=65538 fd=15 type=3 config=1 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1I << 0 |
tools/perf/tests/attr/test-stat-detailed-3 +5 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
@@ -108,6 +110,7 @@ config=65538 fd=15 type=3 config=1 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1I << 0 |
@@ -162,6 +165,7 @@ config=65540 fd=21 type=3 config=512 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1D << 0 |
@@ -171,3 +175,4 @@ config=512 fd=22 type=3 config=66048 +optional=1
Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Add optional term
perf tests attr: Add optional term
Commit-ID: 1f41873c22826fc92d4bb03c58cf44664fdc3bb8 Gitweb: http://git.kernel.org/tip/1f41873c22826fc92d4bb03c58cf44664fdc3bb8 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:29 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 18 Jul 2017 23:14:22 -0300
perf tests attr: Add optional term
Some of the stat events are quite rare to find on common machines (like front end cycles).
Adding an 'optional' term to mark such events in attr tests. Event marked as optional will not fail the test case if it's not found in results.
--- tools/perf/tests/attr.py | 14 +++++++++++--- tools/perf/tests/attr/test-stat-default | 2 ++ tools/perf/tests/attr/test-stat-detailed-1 | 2 ++ tools/perf/tests/attr/test-stat-detailed-2 | 3 +++ tools/perf/tests/attr/test-stat-detailed-3 | 5 +++++ 5 files changed, 23 insertions(+), 3 deletions(-)
tools/perf/tests/attr.py +11 -3
@@ -105,6 +105,11 @@ class Event(dict): return False return True + def optional(self): + if self.has_key('optional') and self['optional'] == '1': + return True + return False + def diff(self, other): for t in Event.terms: if not self.has_key(t) or not other.has_key(t):
@@ -244,9 +249,12 @@ class Test(object): log.debug(" match: [%s] matches %s" % (exp_name, str(exp_list))) # we did not any matching event - fail - if (not exp_list): - exp_event.diff(res_event) - raise Fail(self, 'match failure'); + if not exp_list: + if exp_event.optional(): + log.debug(" %s does not match, but is optional" % exp_name) + else: + exp_event.diff(res_event) + raise Fail(self, 'match failure'); match[exp_name] = exp_list
tools/perf/tests/attr/test-stat-default +2 -0
@@ -38,12 +38,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
tools/perf/tests/attr/test-stat-detailed-1 +2 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
tools/perf/tests/attr/test-stat-detailed-2 +3 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
@@ -108,6 +110,7 @@ config=65538 fd=15 type=3 config=1 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1I << 0 |
tools/perf/tests/attr/test-stat-detailed-3 +5 -0
@@ -39,12 +39,14 @@ config=0 fd=6 type=0 config=7 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND [event7:base-stat] fd=7 type=0 config=8 +optional=1 # PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS [event8:base-stat]
@@ -108,6 +110,7 @@ config=65538 fd=15 type=3 config=1 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1I << 0 |
@@ -162,6 +165,7 @@ config=65540 fd=21 type=3 config=512 +optional=1 # PERF_TYPE_HW_CACHE, # PERF_COUNT_HW_CACHE_L1D << 0 |
@@ -171,3 +175,4 @@ config=512 fd=22 type=3 config=66048 +optional=1
Jiri Olsa
reviewerPATCH 15/15 perf tests attr: Fix task term values
In reply to Jiri OlsaThe perf_event_attr::task is 1 by default for first (tracking) event in the session. Setting task=1 as default and adding task=0 for cases that need it.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 2 +- tools/perf/tests/attr/test-record-group1 | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -23,7 +23,7 @@ comm=1 freq=1 inherit_stat=0 enable_on_exec=1 -task=0 +task=1 watermark=0 precise_ip=0|1|2|3 mmap_data=0
tools/perf/tests/attr/test-record-group +1 -0
@@ -17,5 +17,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0
tools/perf/tests/attr/test-record-group-sampling +1 -1
@@ -23,7 +23,7 @@ sample_type=343 # PERF_FORMAT_ID | PERF_FORMAT_GROUP read_format=12 - +task=0 mmap=0 comm=0 enable_on_exec=0
tools/perf/tests/attr/test-record-group1 +1 -0
@@ -18,5 +18,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0
Signature · 1 line
2.9.4
Re: [PATCH 15/15] perf tests attr: Fix task term values
Quoted 3 lines · Jiri Olsa
The
perf_event_attr::taskis 1 by default for first (tracking) event in the session. Setting task=1 as default and adding task=0 for cases that need it.
hm, looks like this one was overlooked..
thanks,
jirka
Quoted 61 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 2 +- tools/perf/tests/attr/test-record-group1 | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)tools/perf/tests/attr/base-record +1
-1@@ -23,7 +23,7 @@ comm=1 freq=1 inherit_stat=0 enable_on_exec=1 -task=0 +task=1 watermark=0 precise_ip=0|1|2|3 mmap_data=0tools/perf/tests/attr/test-record-group +1
-0@@ -17,5 +17,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0tools/perf/tests/attr/test-record-group-sampling +1
-1@@ -23,7 +23,7 @@ sample_type=343 # PERF_FORMAT_ID | PERF_FORMAT_GROUP read_format=12 - +task=0 mmap=0 comm=0 enable_on_exec=0tools/perf/tests/attr/test-record-group1 +1
-0@@ -18,5 +18,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0Signature · 1 line
2.9.4
Re: [PATCH 15/15] perf tests attr: Fix task term values
Quoted 10 lines · Jiri Olsa
Quoted 3 lines · Jiri Olsa
The
perf_event_attr::taskis 1 by default for first (tracking) event in the session. Setting task=1 as default and adding task=0 for cases that need it.hm, looks like this one was overlooked..
thanks,
jirkaQuoted 1 line
I have pull perf/core yesterday afternoon and could not find. However when this is already fixed, I will remove it from my patch list
Thanks Thomas
Quoted 61 lines
Quoted 60 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 2 +- tools/perf/tests/attr/test-record-group1 | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)tools/perf/tests/attr/base-record +1
-1@@ -23,7 +23,7 @@ comm=1 freq=1 inherit_stat=0 enable_on_exec=1 -task=0 +task=1 watermark=0 precise_ip=0|1|2|3 mmap_data=0tools/perf/tests/attr/test-record-group +1
-0@@ -17,5 +17,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0tools/perf/tests/attr/test-record-group-sampling +1
-1@@ -23,7 +23,7 @@ sample_type=343 # PERF_FORMAT_ID | PERF_FORMAT_GROUP read_format=12 - +task=0 mmap=0 comm=0 enable_on_exec=0tools/perf/tests/attr/test-record-group1 +1
-0@@ -18,5 +18,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0Signature · 1 line
2.9.4
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tests attr: Fix task term values
In reply to Jiri Olsaperf tests attr: Fix task term values
Commit-ID: 10836d9f9ac63d40ccfa756f871ce4ed51ae3b52 Gitweb: https://git.kernel.org/tip/10836d9f9ac63d40ccfa756f871ce4ed51ae3b52 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 3 Jul 2017 16:50:30 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 2 Oct 2017 13:59:18 -0300
perf tests attr: Fix task term values
The perf_event_attr::task is 1 by default for first (tracking) event in the session. Setting task=1 as default and adding task=0 for cases that need it.
--- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/test-record-group | 1 + tools/perf/tests/attr/test-record-group-sampling | 2 +- tools/perf/tests/attr/test-record-group1 | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/tests/attr/base-record +1 -1
@@ -23,7 +23,7 @@ comm=1 freq=1 inherit_stat=0 enable_on_exec=1 -task=0 +task=1 watermark=0 precise_ip=0|1|2|3 mmap_data=0
tools/perf/tests/attr/test-record-group +1 -0
@@ -17,5 +17,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0
tools/perf/tests/attr/test-record-group-sampling +1 -1
@@ -23,7 +23,7 @@ sample_type=343 # PERF_FORMAT_ID | PERF_FORMAT_GROUP read_format=12 - +task=0 mmap=0 comm=0 enable_on_exec=0
tools/perf/tests/attr/test-record-group1 +1 -0
@@ -18,5 +18,6 @@ sample_type=327 read_format=4 mmap=0 comm=0 +task=0 enable_on_exec=0 disabled=0
Quoted 7 lines · Jiri Olsa
hi,
attr tests have been broken for some time now. Updating the data files plus some other processing fixes.It's also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/attr_test
hi,
just noticed that this got removed from your branch.. anything wrong with that?
thanks,
jirka
Quoted 40 lines
thanks,
jirka--- tools/perf/perf.h | 1 + tools/perf/tests/attr.c | 12 +++++++++++- tools/perf/tests/attr.py | 50 +++++++++++++++++++++++++++++--------------------- tools/perf/tests/attr/base-record | 8 ++++---- tools/perf/tests/attr/base-stat | 4 ++-- tools/perf/tests/attr/test-record-C0 | 1 + tools/perf/tests/attr/test-record-basic | 1 + tools/perf/tests/attr/test-record-branch-any | 2 +- tools/perf/tests/attr/test-record-branch-filter-any | 2 +- tools/perf/tests/attr/test-record-branch-filter-any_call | 2 +- tools/perf/tests/attr/test-record-branch-filter-any_ret | 2 +- tools/perf/tests/attr/test-record-branch-filter-hv | 2 +- tools/perf/tests/attr/test-record-branch-filter-ind_call | 2 +- tools/perf/tests/attr/test-record-branch-filter-k | 2 +- tools/perf/tests/attr/test-record-branch-filter-u | 2 +- tools/perf/tests/attr/test-record-count | 1 + tools/perf/tests/attr/test-record-data | 3 +-- tools/perf/tests/attr/test-record-freq | 1 + tools/perf/tests/attr/test-record-graph-default | 1 + tools/perf/tests/attr/test-record-graph-dwarf | 4 +++- tools/perf/tests/attr/test-record-graph-fp | 1 + tools/perf/tests/attr/test-record-group | 2 ++ tools/perf/tests/attr/test-record-group-sampling | 3 ++- tools/perf/tests/attr/test-record-group1 | 2 ++ tools/perf/tests/attr/{test-record-no-delay => test-record-no-buffering} | 4 ++-- tools/perf/tests/attr/test-record-no-inherit | 1 + tools/perf/tests/attr/test-record-no-samples | 1 + tools/perf/tests/attr/test-record-period | 1 + tools/perf/tests/attr/test-record-raw | 2 +- tools/perf/tests/attr/test-stat-C0 | 4 ++-- tools/perf/tests/attr/test-stat-default | 2 ++ tools/perf/tests/attr/test-stat-detailed-1 | 2 ++ tools/perf/tests/attr/test-stat-detailed-2 | 3 +++ tools/perf/tests/attr/test-stat-detailed-3 | 5 +++++ tools/perf/util/evsel.c | 8 +++++++- 35 files changed, 98 insertions(+), 46 deletions(-)
Arnaldo Carvalho de Melo
maintainerEm Mon, Jul 17, 2017 at 02:18:14PM +0200, Jiri Olsa escreveu:
Quoted 11 lines · Jiri Olsa
Quoted 7 lines
hi,
attr tests have been broken for some time now. Updating the data files plus some other processing fixes.It's also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/attr_testhi,
just noticed that this got removed from your branch.. anything wrong with that?
Something st00pid on my part, I'll get it remerged, sorry.
- Arnaldo
Quoted 43 lines
thanks,
jirkaQuoted 40 lines
thanks,
jirka--- tools/perf/perf.h | 1 + tools/perf/tests/attr.c | 12 +++++++++++- tools/perf/tests/attr.py | 50 +++++++++++++++++++++++++++++--------------------- tools/perf/tests/attr/base-record | 8 ++++---- tools/perf/tests/attr/base-stat | 4 ++-- tools/perf/tests/attr/test-record-C0 | 1 + tools/perf/tests/attr/test-record-basic | 1 + tools/perf/tests/attr/test-record-branch-any | 2 +- tools/perf/tests/attr/test-record-branch-filter-any | 2 +- tools/perf/tests/attr/test-record-branch-filter-any_call | 2 +- tools/perf/tests/attr/test-record-branch-filter-any_ret | 2 +- tools/perf/tests/attr/test-record-branch-filter-hv | 2 +- tools/perf/tests/attr/test-record-branch-filter-ind_call | 2 +- tools/perf/tests/attr/test-record-branch-filter-k | 2 +- tools/perf/tests/attr/test-record-branch-filter-u | 2 +- tools/perf/tests/attr/test-record-count | 1 + tools/perf/tests/attr/test-record-data | 3 +-- tools/perf/tests/attr/test-record-freq | 1 + tools/perf/tests/attr/test-record-graph-default | 1 + tools/perf/tests/attr/test-record-graph-dwarf | 4 +++- tools/perf/tests/attr/test-record-graph-fp | 1 + tools/perf/tests/attr/test-record-group | 2 ++ tools/perf/tests/attr/test-record-group-sampling | 3 ++- tools/perf/tests/attr/test-record-group1 | 2 ++ tools/perf/tests/attr/{test-record-no-delay => test-record-no-buffering} | 4 ++-- tools/perf/tests/attr/test-record-no-inherit | 1 + tools/perf/tests/attr/test-record-no-samples | 1 + tools/perf/tests/attr/test-record-period | 1 + tools/perf/tests/attr/test-record-raw | 2 +- tools/perf/tests/attr/test-stat-C0 | 4 ++-- tools/perf/tests/attr/test-stat-default | 2 ++ tools/perf/tests/attr/test-stat-detailed-1 | 2 ++ tools/perf/tests/attr/test-stat-detailed-2 | 3 +++ tools/perf/tests/attr/test-stat-detailed-3 | 5 +++++ tools/perf/util/evsel.c | 8 +++++++- 35 files changed, 98 insertions(+), 46 deletions(-)