aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-07perf tests: No need to set attr.sample_freq for tracking !PERF_RECORD_SAMPLEArnaldo Carvalho de Melo1-1/+0
We were asking for a 4kHz sample_freq, making the test fail needlessly when the system reduced /proc/sys/kernel/perf_event_max_sample_rate below that. Before: # perf test -vv dummy 23: Test using a dummy software event to keep tracking : --- start --- test child forked, pid 32421 ------------------------------------------------------------ perf_event_attr: type 1 size 112 config 0x9 { sample_period, sample_freq } 4000 sample_type IP|TID|ID|PERIOD <SNIP> sys_perf_event_open failed, error -22 Unable to open dummy and cycles event test child finished with -2 ---- end ---- Test using a dummy software event to keep tracking: Skip # [root@zoo ~]# cat /proc/sys/kernel/perf_event_max_sample_rate 1000 After: [root@zoo ~]# perf test dummy 23: Test using a dummy software event to keep tracking : Ok Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-487iquegrs2379e5n0pi0tcp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-07perf python: Add missing files to binding link listArnaldo Carvalho de Melo1-0/+2
Fixing this problem, introduced recently: $ perf test python 16: Try 'import perf' in python, checking link problems : FAILED! In verbose mode we find out what is missing: $ perf test -v python 16: Try 'import perf' in python, checking link problems : --- start --- test child forked, pid 24894 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /tmp/build/perf/python/perf.so: undefined symbol: find_next_bit test child finished with -1 ---- end ---- Try 'import perf' in python, checking link problems: FAILED! $ Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: f77b57ad4fc4 ("perf cpu_map: Add cpu_map__new_event function") Link: http://lkml.kernel.org/n/tip-rajx0zkz6czdrnvvwf0jp76p@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-07perf test: No need for setting attr.sample_freq on the RECORD testArnaldo Carvalho de Melo1-1/+0
We're not looking at PERF_RECORD_SAMPLE entries and now by default we use PERF_COUNT_SW_DUMMY, so just remove that setting. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-cly7cnotktv5rqao13pkorem@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-07perf test: Use "dummy" events in the PERF_RECORD_ testArnaldo Carvalho de Melo1-1/+4
As we're test just the !PERF_RECORD_SAMPLE records. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-qp8radcz3il4q9wbnseh337d@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-07perf evlist: Introduce perf_evlist__new_dummy constructorArnaldo Carvalho de Melo2-0/+31
For case where all we need is an evlist with just an "dummy" evsel, like in some 'perf test' entries. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-q52le0pblm2k3ncvyilelr9z@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-07perf tests: No need to set attr.sample_freq in the perf time to TSC testArnaldo Carvalho de Melo1-1/+0
We were asking for a 4kHz sample_freq, making the test fail needlessly when the system reduced /proc/sys/kernel/perf_event_max_sample_rate below that. In this test we only look at the PERF_SAMPLE_TIME fields in PERF_RECORD_ meta events, no need to set sample_freq. Thanks to Namhyung for suggesting that max_sample_rate could be the reason for the test failure, seeing the 'perf test -vv' output I sent. Before: # echo 1000 > /proc/sys/kernel/perf_event_max_sample_rate # perf test TSC 45: Test converting perf time to TSC : FAILED! After: # perf test TSC 45: Test converting perf time to TSC : Ok # cat /proc/sys/kernel/perf_event_max_sample_rate 1000 Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-lcob05qhawkuvsyuu9g1fld5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-06perf pmu: fix alias->snapshot missing initialization bugStephane Eranian1-0/+1
This patch fixes a bug in __perf_pmu__new_alias() whereby the alias->snapshot field was not initialized to false. This led to random alias->snapshot value for an alias and was breaking some measurements such as: $ perf stat -a -e uncore_imc/data_reads/ -I 1000 sleep 100 Because the event ended up being treated as snapshot mode, when it is not. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1452106201-13073-1-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>