summaryrefslogtreecommitdiffstats
path: root/tools/perf
Commit message (Collapse)AuthorAgeFilesLines
...
| * perf tools: Move u64_swap unionBorislav Petkov2014-04-292-5/+5
| | | | | | | | | | | | | | | | ... to its single user's header, evsel.h. Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/tip-9os1chjyz12upubfsjc71d99@git.kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tests: Add a test of kvm-390: trace eventAlexander Yarygin2014-04-291-0/+7
| | | | | | | | | | | | | | | | | | Add a s390 specific test of a hardcoded trace event with '-' in the name. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1398440047-6641-4-git-send-email-yarygin@linux.vnet.ibm.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tests: Add numeric identifier to evlist_testAlexander Yarygin2014-04-291-45/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In tests/parse-events.c test cases are declared in evlist_test[] arrays. Elements of arrays are initialized in following pattern: [i] = { .name = ..., .check = ..., }, When perf-test is running with '-v' option, 'i' variable will be printed for every existing test. However, we can't add any arch specific tests inside #ifdefs, because it will create collision between the element number inside #ifdef and the next one outside. This patch adds 'id' field in evlist_test, uses it as a test identifier and removes explicit numbering of array elements. This helps to number tests with gaps. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1398440047-6641-3-git-send-email-yarygin@linux.vnet.ibm.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tools: Parse tracepoints with '-' in system nameAlexander Yarygin2014-04-291-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trace events potentially can have a '-' in their trace system name, e.g. kvm on s390 defines kvm-s390:* tracepoints. We could not parse them, because there was no rule for this: $ sudo ./perf top -e "kvm-s390:*" invalid or unsupported event: 'kvm-s390:*' This patch adds an extra rule to event_legacy_tracepoint which handles those cases. Without the patch, perf will not accept such tracepoints in the -e option. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Link: http://lkml.kernel.org/r/1398440047-6641-2-git-send-email-yarygin@linux.vnet.ibm.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tools: Handle EINTR error for readn/writenNamhyung Kim2014-04-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | Those readn/writen functions are to ensure read/write does I/O for a given size exactly. But ion() - its implementation - does not handle in case it returns prematurely due to a signal. As it's not an error itself so just retry the operation. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398346054-3322-1-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | Merge branch 'perf/urgent' into perf/core, to resolve conflictIngo Molnar2014-05-016-18/+50
|\ \ | |/ |/| | | | | | | | | Conflicts: tools/perf/arch/x86/tests/dwarf-unwind.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
| * perf tests x86: Fix stack map lookup in dwarf unwind testJiri Olsa2014-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous commit 'perf x86: Fix perf to use non-executable stack, again' moved stack map into MAP__VARIABLE map type again. Fixing the dwarf unwind test stack map lookup appropriately. Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/n/tip-ttzyhbe4zls24z7ednkmhvxl@git.kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf x86: Fix perf to use non-executable stack, againMathias Krause2014-04-302-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arch/x86/tests/regs_load.S is missing the linker note about the stack requirements, therefore making the linker fall back to an executable stack. As this object gets linked against the final perf binary, it'll needlessly end up with an executable stack. Fix this by adding the appropriate linker note. Also add a global linker flag to prevent future regressions, as suggested by Jiri. This way perf won't get an executable stack even if we fail to add the .GNU-stack linker note to future assembler files. Though, doing so might create regressions the other way around, when (statically) linking against libraries needing an executable stack. But, apparently, regressing in that direction is wanted as it is an indicator of poor code quality -- or just missing linker notes. Fixes: 3c8b06f981 ("perf tests x86: Introduce perf_regs_load function") Signed-off-by: Mathias Krause <minipli@googlemail.com> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1398617466-22749-1-git-send-email-minipli@googlemail.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf machine: Search for modules in %s/lib/modules/%sRichard Yao2014-04-301-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules installed outside of the kernel's build system should go into "%s/lib/modules/%s/extra", but at present, perf will only look at them when they are in "%s/lib/modules/%s/kernel". Lets encourage good citizenship by relaxing this requirement to "%s/lib/modules/%s". This way open source modules that are out-of-tree have no incentive to start populating a directory reserved for in-kernel modules and I can stop hex-editing my system's perf binary when profiling OSS out-of-tree modules. Feedback from Namhyung Kim correctly revealed that the hex-edits that I had been doing meant that perf was also traversing the build and source symlinks in %s/lib/modules/%s. That is undesireable, so we explicitly exclude them from traversal with a minor tweak to the traversal routine. Signed-off-by: Richard Yao <ryao@gentoo.org> Acked-by: Namhyung kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398532675-13684-1-git-send-email-ryao@gentoo.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tests: Add static build make testJiri Olsa2014-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding test for building static perf build into the automated suite. Also available via following commands: $ make -f tests/make make_static - make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.7u5MlB4njo LDFLAGS=-static $ make -f tests/make make_static_O - make_static_O: cd . && make -f Makefile O=/tmp/tmp.Ay6r3wEmtX DESTDIR=/tmp/tmp.vK0KQwO0Vi LDFLAGS=-static Acked-by: David Ahern <dsahern@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1398760413-7574-1-git-send-email-jolsa@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tools: Fix bfd dependency libraries detectionJiri Olsa2014-04-301-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's false assumption in the library detection code assuming -liberty and -lz are always present once bfd is detected. The fails on Ubuntu (14.04) as reported by Ingo. Forcing the bdf dependency libraries detection any time bfd library is detected. Reported-by: Ingo Molnar <mingo@kernel.org> Tested-by: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1398676935-6615-1-git-send-email-jolsa@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * perf tools: Use LDFLAGS instead of ALL_LDFLAGSJiri Olsa2014-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We no longer use ALL_LDFLAGS, Replacing with LDFLAGS. Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1398675770-3109-1-git-send-email-jolsa@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tests: Add map groups sharing with thread object testJiri Olsa2014-04-284-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test create 2 processes abstractions, with several threads and checks they properly share and maintain map groups info. Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-6-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tools: Share map_groups among threads of the same groupJiri Olsa2014-04-283-13/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sharing map groups within all process threads. This way there's only one copy of mmap info and it's reachable from any thread within the process. Original-patch-by: Arnaldo Carvalho de Melo <acme@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-5-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tools: Reference count map_groups objectsArnaldo Carvalho de Melo2014-04-283-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will share it among threads in the same process. Adding map_groups__get/map_groups__put interface for that. Signed-off-by: Arnaldo Carvalho de Melo <acme@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-4-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tools: Allocate thread map_groups's dynamicallyArnaldo Carvalho de Melo2014-04-287-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving towards sharing map groups within a process threads. Because of this we need the map groups to be dynamically allocated. No other functional change is intended in here. Based on a patch by Jiri Olsa, but this time _just_ making the conversion from statically allocating thread->mg to turning it into a pointer and instead of initializing it at thread's constructor, introduce a constructor/destructor for the map_groups class and call at thread creation time. Later we will introduce the get/put methods when we move to sharing those map_groups, when the get/put refcounting semantics will be needed. Signed-off-by: Arnaldo Carvalho de Melo <acme@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-3-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tests: Add thread maps lookup automated testsJiri Olsa2014-04-285-0/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding automated test for memory maps lookup within multiple machines threads. The test creates 4 threads and separated memory maps. It checks that we could use thread__find_addr_map function with thread object based on TID to find memory maps. Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1397490723-1992-2-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tests: Add a test case for hists filteringNamhyung Kim2014-04-284-0/+321
| | | | | | | | | | | | | | | | | | Now we have changed how hists stats are accounted especially when filter(s) applied. So add a test case to verify it. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398396494-12811-2-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | perf tests: Factor out fake_setup_machine()Namhyung Kim2014-04-284-139/+195
| | | | | | | | | | | | | | | | | | | | The fake_setup_machine() is for setting up a environment for testing various hists operations. As it'll be used for other test cases it'd better factoring it out. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398396494-12811-1-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | Merge tag 'perf-core-for-mingo' of ↵Ingo Molnar2014-04-256-103/+171
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core Pull perf/core improvements and fixes from Jiri Olsa: * Factor hists statistics counts processing which in turn also fixes several bugs in TUI report command (Namhyung Kim) Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
| * | perf hists/tui: Count callchain rows separatelyNamhyung Kim2014-04-241-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When TUI hist browser expands/collapses callchains it accounted number of callchain nodes into total entries to show. However this code ignores filtering so that it can make the cursor go to out of screen. Thanks to Jiri Olsa for pointing out a bug (and a fix) in the code. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-12-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf top/tui: Update nr_entries properly after a filter is appliedNamhyung Kim2014-04-242-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hist_browser__reset() is only called right after a filter is applied so it needs to udpate browser->nr_entries properly. We cannot use hists->nr_non_filtered_entreis directly since it's possible that such entries are also filtered out by minimum percentage limit. In addition when a filter is used for perf top, hist browser's nr_entries field was not updated after applying the filter. But it needs to be updated as new samples are coming. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-11-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf ui/tui: Rename hist_browser__update_nr_entries()Namhyung Kim2014-04-241-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename ->nr_pcnt_entries and hist_browser__update_pcnt_entries() to ->nr_non_filtered_entries and hist_browser__update_nr_entries() since it's now used for filtering as well. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-10-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()Namhyung Kim2014-04-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nr_entries variable is increased inside the loop in the function but it always count the first entry regardless of it's filtered or not; caused an off-by-one error. It'd become a problem especially there's no entry at all - it'd get a segfault during referencing a NULL pointer. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-9-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf hists: Add missing update on filtered stats in hists__decay_entries()Namhyung Kim2014-04-241-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a filter is used for perf top, its hists->nr_non_filtered_entries was not updated after it removed an entry in hists__decay_entries(). Also hists->stats.total_non_filtered_period was missed too. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-8-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf tools: Account entry stats when it's added to the output treeNamhyung Kim2014-04-244-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, accounting each sample is done in multiple places - once when adding them to the input tree, other when adding them to the output tree. It's not only confusing but also can cause a subtle problem since concurrent processing like in perf top might see the updated stats before adding entries into the output tree - like seeing more (blank) lines at the end and/or slight inaccurate percentage. To fix this, only account the entries when it's moved into the output tree so that they cannot be seen prematurely. There're some exceptional cases here and there - they should be addressed separately with comments. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-7-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf hists: Collapse expanded callchains after filter is appliedNamhyung Kim2014-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a filter is applied a hist entry checks whether its callchain was folded and account it to the output stat. But this is rather hacky and only TUI-specific. Simply fold the callchains for the entry looks like a simpler and more generic solution IMHO. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-6-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf hists: Add a couple of hists stat helper functionsNamhyung Kim2014-04-243-25/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add hists__{reset,inc}_[filter_]stats() functions to cleanup accesses to hist stats (for output). Note that number of samples in the stat is not handled here since it belongs to the input stage. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-5-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf hists: Move column length calculation out of hists__inc_stats()Namhyung Kim2014-04-242-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's not the part of logic of hists__inc_stats() so it'd be better to move it out of the function. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-4-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf hists: Rename hists__inc_stats()Namhyung Kim2014-04-243-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing hists__inc_nr_entries() is a misnomer as it's not only increasing ->nr_entries but also other stats. So rename it to more general hists__inc_stats(). Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-3-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
| * | perf report: Count number of entries separatelyNamhyung Kim2014-04-241-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hists->nr_entries is counted in multiple places so that they can confuse readers of the code. This is a preparation of later change and do not intend any functional difference. Note that report__collapse_hists() now changed to return nothing since its return value (nr_samples) is only for checking if there's any data in the input file and this can be acheived by checking ->nr_entries. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1398327843-31845-2-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
* | | Merge branch 'perf/urgent' into perf/core, to pick up fixesIngo Molnar2014-04-256-2/+21
|\ \ \ | |/ / |/| / | |/ Signed-off-by: Ingo Molnar <mingo@kernel.org>
| * perf tools: Disable libdw unwind for all but x86 archJiri Olsa2014-04-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far there's only x86 libdw unwind support merged in perf. Disable it on all other architectures in case libdw unwind support is detected in system. Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Josh Boyer <jwboyer@fedoraproject.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1397988006-14158-1-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
| * perf tests x86: Fix memory leak in sample_ustack()Masanari Iida2014-04-231-0/+1
| | | | | | | | | | | | | | | | | | The buf is not freed, when kernel failed to get stack map and return. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Link: http://lkml.kernel.org/r/1398091024-7901-1-git-send-email-standby24x7@gmail.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
| * perf tools: Improve error reportingAdrien BAK2014-04-202-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current version, when using perf record, if something goes wrong in tools/perf/builtin-record.c:375 session = perf_session__new(file, false, NULL); The error message: "Not enough memory for reading per file header" is issued. This error message seems to be outdated and is not very helpful. This patch proposes to replace this error message by "Perf session creation failed" I believe this issue has been brought to lkml: https://lkml.org/lkml/2014/2/24/458 although this patch only tackles a (small) part of the issue. Additionnaly, this patch improves error reporting in tools/perf/util/data.c open_file_write. Currently, if the call to open fails, the user is unaware of it. This patch logs the error, before returning the error code to the caller. Reported-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Adrien BAK <adrien.bak@metascale.org> Link: http://lkml.kernel.org/r/1397786443.3093.4.camel@beast [ Reorganize the changelog into paragraphs ] [ Added empty line after fd declaration in open_file_write ] Signed-off-by: Jiri Olsa <jolsa@redhat.com>
| * perf tools: Adjust symbols in VDSOVladimir Nikulichev2014-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pert-report doesn't resolve function names in VDSO: $ perf report --stdio -g flat,0.0,15,callee --sort pid ... 8.76% 0x7fff6b1fe861 __gettimeofday ACE_OS::gettimeofday() ... In this case symbol values should be adjusted the same way as for executables, relocatable objects and prelinked libraries. After fix: $ perf report --stdio -g flat,0.0,15,callee --sort pid ... 8.76% __vdso_gettimeofday __gettimeofday ACE_OS::gettimeofday() Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> Tested-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvs Signed-off-by: Jiri Olsa <jolsa@redhat.com>
| * perf kvm: Fix 'Min time' counting in report commandAlexander Yarygin2014-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every event in the perf-kvm has a 'stats' structure, which contains max/min/average/etc times of handling this event. The problem is that the 'perf-kvm stat report' command always shows that 'min time' is 0us for every event. Example: # perf kvm stat report Analyze events for all VCPUs: VM-EXIT Samples Samples% Time% Min Time Max Time Avg time [..] 0xB2 MSCH 12 0.07% 0.00% 0us 8us 7.31us ( +- 2.11% ) 0xB2 CHSC 12 0.07% 0.00% 0us 18us 9.39us ( +- 9.49% ) 0xB2 STPX 8 0.05% 0.00% 0us 2us 1.88us ( +- 7.18% ) 0xB2 STSI 7 0.04% 0.00% 0us 44us 16.49us ( +- 38.20% ) [..] This happens because the 'stats' structure is not initialized and stats->min equals to 0. Lets initialize the structure for every event after its allocation using init_stats() function. This initializes stats->min to -1 and makes 'Min time' statistics counting work: # perf kvm stat report Analyze events for all VCPUs: VM-EXIT Samples Samples% Time% Min Time Max Time Avg time [..] 0xB2 MSCH 12 0.07% 0.00% 6us 8us 7.31us ( +- 2.11% ) 0xB2 CHSC 12 0.07% 0.00% 7us 18us 9.39us ( +- 9.49% ) 0xB2 STPX 8 0.05% 0.00% 1us 2us 1.88us ( +- 7.18% ) 0xB2 STSI 7 0.04% 0.00% 1us 44us 16.49us ( +- 38.20% ) [..] Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1397053319-2130-3-git-send-email-borntraeger@de.ibm.com [ Fixing the perf examples changelog output ] Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf callchain: Add generic report parse callchain callback functionDon Zickus2014-04-223-78/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | This takes the parse_callchain_opt function and copies it into the callchain.c file. Now the c2c tool can use it too without duplicating. Update perf-report to use the new routine too. Signed-off-by: Don Zickus <dzickus@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1396896924-129847-5-git-send-email-dzickus@redhat.com [ Adding missing braces to multiline if condition ] Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf kmem: Utilize the new generic cpunode_mapDon Zickus2014-04-221-75/+3
| | | | | | | | | | | | | | | | | | | | | | Use the previous patch implementation of cpunode_map for builtin-kmem.c Should not be any functional difference. Signed-off-by: Don Zickus <dzickus@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Li Zefan <lizf@cn.fujitsu.com> Link: http://lkml.kernel.org/r/1396896924-129847-4-git-send-email-dzickus@redhat.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf tools: Use cpu/possible instead of cpu/kernel_maxDon Zickus2014-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | The system's max configuration is represented by cpu/possible and cpu/kernel_max can be huge (4096 vs. 128), so save space by keeping smaller structures. Signed-off-by: Don Zickus <dzickus@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1396896924-129847-3-git-send-email-dzickus@redhat.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf tools: Allow ability to map cpus to nodes easilyDon Zickus2014-04-222-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch figures out the max number of cpus and nodes that are on the system and creates a map of cpu to node. This allows us to provide a cpu and quickly get the node associated with it. It was mostly copied from builtin-kmem.c and tweaked slightly to use less memory (use possible cpus instead of max). It also calculates the max number of nodes. Signed-off-by: Don Zickus <dzickus@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1396896924-129847-2-git-send-email-dzickus@redhat.com [ Removing out label code in init_cpunode_map ] [ Adding check for snprintf error ] [ Removing unneeded returns ] Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf tools: Fix pmu object compilation errorJiri Olsa2014-04-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After applying some patches got another shadowing error: CC util/pmu.o util/pmu.c: In function ‘pmu_alias_terms’: util/pmu.c:287:35: error: declaration of ‘clone’ shadows a global declaration [-Werror=shadow] Renaming clone to cloned. Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1397674818-27054-1-git-send-email-jolsa@redhat.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | Merge branch 'perf/urgent' into perf/core, to pick up PMU driver fixes.Ingo Molnar2014-04-182-2/+3
|\ \ | |/ | | | | Signed-off-by: Ingo Molnar <mingo@kernel.org>
| * perf tools: Instead of redirecting flex output, use -oCody P Schafer2014-04-151-2/+2
| | | | | | | | | | | | | | | | | | This gives us a real filename instead of having '<stdout>' show up all over the place when debugging. Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1396652539-2416-1-git-send-email-cody@linux.vnet.ibm.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
| * perf tools: Fix double free in perf test 21 (code-reading.c)Adrian Hunter2014-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | perf_evlist__delete() deletes attached cpu and thread maps but the test is still using them, so remove them from the evlist before deleting it. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: http://lkml.kernel.org/r/53465E3E.8070201@intel.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf sched: Introduce --list-cmds for use by scriptsRamkumar Ramachandra2014-04-162-5/+7
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-5-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf lock: Introduce --list-cmds for use by scriptsRamkumar Ramachandra2014-04-162-5/+7
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-4-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf mem: Introduce --list-cmds for use by scriptsRamkumar Ramachandra2014-04-162-8/+9
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-3-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf kmem: Introduce --list-cmds for use by scriptsRamkumar Ramachandra2014-04-162-5/+7
| | | | | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-2-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
* | perf tools: Show absolute percentage by defaultNamhyung Kim2014-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | Now perf report will show absolute percentage on filter entries by default. Suggested-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1397145720-8063-8-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@redhat.com>
OpenPOWER on IntegriCloud