Namhyung Kim
22af969e8c
perf tools: Call perf_hpp__init() before setting up GUI browsers
...
So that it can be set properly prior to set up output fields. That
makes easy to handle/warn errors during the setup since it doesn't
need to be bothered with the GUI.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-11-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:35 +02:00
Namhyung Kim
512ae1bd6a
perf tools: Consolidate management of default sort orders
...
The perf uses different default sort orders for different use-cases,
and this was scattered throughout the code. Add get_default_sort_
order() function to handle this and change initial value of sort_order
to NULL to distinguish it from user-given one.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1400480762-22852-10-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:35 +02:00
Namhyung Kim
a2ce067e55
perf tools: Allow hpp fields to be sort keys
...
Add overhead{,_sys,_us,_guest_sys,_guest_us}, sample and period sort
keys so that they can be selected with --sort/-s option.
$ perf report -s period,comm --stdio
...
# Overhead Period Command
# ........ ............ ...............
#
47.06% 152 swapper
13.93% 45 qemu-system-arm
12.38% 40 synergys
3.72% 12 firefox
2.48% 8 xchat
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-9-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
fb821c9e71
perf ui: Get rid of callback from __hpp__fmt()
...
The callback was used by TUI for determining color of folded sign
using percent of first field/column. But it cannot be used anymore
since it now support dynamic reordering of output field.
So move the logic to the hist_browser__show_entry().
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-8-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
26d8b33827
perf tools: Consolidate output field handling to hpp format routines
...
Until now the hpp and sort functions do similar jobs different ways.
Since the sort functions converted/wrapped to hpp formats it can do
the job in a uniform way.
The perf_hpp__sort_list has a list of hpp formats to sort entries and
the perf_hpp__list has a list of hpp formats to print output result.
To have a backward compatibility, it automatically adds 'overhead'
field in front of sort list. And then all of fields in sort list
added to the output list (if it's not already there).
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/n/tip-7g3h86woz2sckg3h1lj42ygj@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
043ca389a3
perf tools: Use hpp formats to sort final output
...
Convert output sorting function to use ->sort hpp functions.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-6-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
f156d84e42
perf tools: Support event grouping in hpp ->sort()
...
Move logic of hist_entry__sort_on_period to __hpp__sort() in order to
support event group report.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-5-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
093f0ef34c
perf tools: Use hpp formats to sort hist entries
...
It wrapped sort entries to hpp functions, so using the hpp sort list
to sort entries.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-4-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
8b536999cd
perf tools: Convert sort entries to hpp formats
...
This is a preparation of consolidating management of output field and
sort keys.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-3-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
Namhyung Kim
bc18b7f2e3
perf tools: Add ->cmp(), ->collapse() and ->sort() to perf_hpp_fmt
...
Those function pointers will be used to sort report output based on
the selected fields. This is a preparation of later change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-2-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:33 +02:00
Ingo Molnar
6480c56130
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core
...
Pull perf/core improvements and fixes from Jiri Olsa:
* Add libdw DWARF post unwind support for ARM (Jean Pihet)
* Consolidate types.h for ARM and ARM64 (Jean Pihet)
* Fix possible null pointer dereference in session.c (Masanari Iida)
* Cleanup, remove unused variables in map_switch_event() (Dongsheng Yang)
* Remove nr_state_machine_bugs in perf latency (Dongsheng Yang)
* Remove usage of trace_sched_wakeup(.success) (Peter Zijlstra)
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2014-05-20 08:36:09 +02:00
Stephane Eranian
722e76e60f
fix Haswell precise store data source encoding
...
This patch fixes a bug in precise_store_data_hsw() whereby
it would set the data source memory level to the wrong value.
As per the the SDM Vol 3b Table 18-41 (Layout of Data Linear
Address Information in PEBS Record), when status bit 0 is set
this is a L1 hit, otherwise this is a L1 miss.
This patch encodes the memory level according to the specification.
In V2, we added the filtering on the store events.
Only the following events produce L1 information:
* MEM_UOPS_RETIRED.STLB_MISS_STORES
* MEM_UOPS_RETIRED.LOCK_STORES
* MEM_UOPS_RETIRED.SPLIT_STORES
* MEM_UOPS_RETIRED.ALL_STORES
Cc: mingo@elte.hu
Cc: acme@ghostprotocols.net
Cc: jolsa@redhat.com
Cc: jmario@redhat.com
Cc: ak@linux.intel.com
Tested-and-Reviewed-by: Don Zickus <dzickus@redhat.com >
Signed-off-by: Stephane Eranian <eranian@google.com >
Signed-off-by: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/20140515155644.GA3884@quad
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-05-19 21:52:59 +09:00
Peter Zijlstra
643fd0b9f5
perf: Fix perf_event_open(.flags) test
...
Vince noticed that we test the (unsigned long) flags field against an
(unsigned int) constant. This would allow setting the high bits on 64bit
platforms and not get an error.
There is nothing that uses the high bits, so it should be entirely
harmless, but we don't want userspace to accidentally set them anyway,
so fix the constants.
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Reported-by: Vince Weaver <vincent.weaver@maine.edu >
Tested-by: Vince Weaver <vincent.weaver@maine.edu >
Signed-off-by: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/20140423102254.GL11096@twins.programming.kicks-ass.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-05-19 21:52:59 +09:00
Borislav Petkov
12665b35b0
perf/events/core: Drop unused variable after cleanup
...
... in 3a497f4863 ("perf: Simplify perf_event_exit_task_context()")
Signed-off-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/1399720259-28275-1-git-send-email-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-05-19 21:52:58 +09:00
Jean Pihet
97eac381b1
perf tools: Add libdw DWARF post unwind support for ARM
...
Adding libdw DWARF post unwind support, which is part
of elfutils-devel/libdw-dev package from version 0.158.
The new code is contained in unwin-libdw.c object, and
implements unwind__get_entries unwind interface function.
Signed-off-by: Jean Pihet <jean.pihet@linaro.org >
Reviewed-by: Will Deacon <will.deacon@arm.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/1400229672-16104-4-git-send-email-jean.pihet@linaro.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 11:39:29 +02:00
Jean Pihet
90fa9deb32
perf tests: Add dwarf unwind test on ARM
...
Adding dwarf unwind test, that setups live machine data over
the perf test thread and does the remote unwind.
Need to use -fno-optimize-sibling-calls for test compilation,
otherwise 'krava_*' function calls are optimized into jumps
and omitted from the stack unwind.
So far it was enabled only for x86.
Signed-off-by: Jean Pihet <jean.pihet@linaro.org >
Reviewed-by: Will Deacon <will.deacon@arm.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/1400229672-16104-3-git-send-email-jean.pihet@linaro.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 11:39:18 +02:00
Jean Pihet
3418f9667e
perf tests: Introduce perf_regs_load function on ARM
...
Introducing perf_regs_load function, which is going
to be used for dwarf unwind test in following patches.
It takes single argument as a pointer to the regs dump
buffer and populates it with current registers values.
Signed-off-by: Jean Pihet <jean.pihet@linaro.org >
Reviewed-by: Will Deacon <will.deacon@arm.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/1400229672-16104-2-git-send-email-jean.pihet@linaro.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 11:39:05 +02:00
Jean Pihet
21a8b756b8
perf tools: Consolidate types.h for ARM and ARM64
...
Prevents a build breakage since commit d944c4eebc
'tools: Consolidate types.h'
Signed-off-by: Jean Pihet <jean.pihet@linaro.org >
Link: http://lkml.kernel.org/r/1400229672-16104-1-git-send-email-jean.pihet@linaro.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 11:38:57 +02:00
Masanari Iida
c5765ece8a
perf session: Fix possible null pointer dereference in session.c
...
cppcheck detected following warning:
[tools/perf/util/session.c:1628] -> [tools/perf/util/session.c:1632]:
(warning) Possible null pointer dereference: session - otherwise it
is redundant to check it against null.
In order to avoide null pointer, check the pointer before use.
Signed-off-by: Masanari Iida <standby24x7@gmail.com >
Link: http://lkml.kernel.org/r/1400087618-13628-1-git-send-email-standby24x7@gmail.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 09:18:51 +02:00
Dongsheng Yang
9d372ca59b
perf sched: Cleanup, remove unused variables in map_switch_event()
...
In map_switch_event(), we don't care the previous process currently,
this patch remove the infomation we get but not used.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com >
Link: http://lkml.kernel.org/r/1400218625-14613-1-git-send-email-yangds.fnst@cn.fujitsu.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 09:17:50 +02:00
Dongsheng Yang
67d6259dd0
perf sched: Remove nr_state_machine_bugs in perf latency
...
As we do not use .success in sched_wakeup event any more, then
we can not guarantee that the task when wakeup event happen is
out of run queue. So the message of nr_state_machine_bugs is
not correct.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com >
Link: http://lkml.kernel.org/r/1399945101-21736-1-git-send-email-yangds.fnst@cn.fujitsu.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-16 09:17:36 +02:00
Peter Zijlstra
0680ee7db1
perf tools: Remove usage of trace_sched_wakeup(.success)
...
trace_sched_wakeup(.success) is a dead argument and has been for ages,
the only reason its still there is because of brain dead software, which
apparently includes perf tools
There's a few more instances in pearly snake shit, but that's not
supported as far as I care anyhow, so let that bitrot.
Signed-off-by: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/20140512181946.GG13467@laptop.programming.kicks-ass.net
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-12 21:13:44 +02:00
Ingo Molnar
26f273802b
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core
...
Pull perf/core improvements and fixes from Jiri Olsa:
* Propagate exit status of a command line workload for
record command (Namhyung Kim)
* Use tid for finding thread (Namhyung Kim)
* Clarify the output of perf sched map plus small sched
command fixies (Dongsheng Yang)
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2014-05-12 17:57:48 +02:00
Namhyung Kim
13ce34df11
perf tools: Use tid for finding thread
...
I believe that passing pid (instead of tid) as the 3rd arg of the
machine__find*_thread() was to find a main thread so that it can
search proper map group for symbols. However with the map sharing
patch applied, it now can do it in any thread.
It fixes a bug when each thread has different name, it only reports a
main thread for samples in other threads.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: David Ahern <dsahern@gmail.com >
Acked-by: Stephane Eranian <eranian@google.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1399856202-26221-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-12 11:09:50 +02:00
Namhyung Kim
bac1e4d103
perf tools: Get rid of on_exit() feature test
...
The on_exit() function was only used in perf record but it's gone in
previous patch.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Stephane Eranian <eranian@google.com >
Cc: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org >
Cc: Irina Tirdea <irina.tirdea@intel.com >
Link: http://lkml.kernel.org/r/1399855645-25815-2-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-12 11:09:50 +02:00