Re: [PATCH v2] wait while adding MMC host to ensure root mounts

2013-04-02 Thread Adrian Hunter
On 27/03/13 13:57, Chris Ball wrote: > Hi, > > On Wed, Mar 27 2013, Ulf Hansson wrote: >> I noticed you merged this. I thought the idea was to use the rootwait >> or rootdelay? > > That's necessary before the patch, but it would be better if we didn't > have to pass rootwait, all else being equal

Re: [PATCH v2] wait while adding MMC host to ensure root mounts

2013-04-03 Thread Adrian Hunter
On 02/04/13 17:24, Sergey Yanovich wrote: > On Tue, 2013-04-02 at 16:36 +0300, Adrian Hunter wrote: >> On my system it is significant: >> >> Before the patch: >> >> [1.625623] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. >> >> After

Re: [PATCH v2] wait while adding MMC host to ensure root mounts

2013-04-04 Thread Adrian Hunter
On 04/04/13 13:59, Sergey Yanovich wrote: > On Thu, 2013-04-04 at 09:35 +0300, Adrian Hunter wrote: >> No, I am booting from eMMC. > > Well, in this case you should be aware, that your system is not > concurrency-safe without the patch. It may or may not boot each time > d

Re: [PATCH v2 07/12] rbtree: adjust root color in rb_insert_color() only when necessary

2012-08-31 Thread Adrian Hunter
n) ../../lib/rbtree.c: In function 'rb_erase': ../../lib/rbtree.c:368:2: error: unknown type name 'bool' make: *** [util/rbtree.o] Error 1 How about: From: Adrian Hunter Date: Fri, 31 Aug 2012 10:49:27 +0300 Subject: [PATCH] perf tools: fix build for another rbtree.c change Fixes:

Re: [PATCH v2 07/12] rbtree: adjust root color in rb_insert_color() only when necessary

2012-08-31 Thread Adrian Hunter
On 31/08/12 11:15, Andrew Morton wrote: > On Fri, 31 Aug 2012 01:07:24 -0700 Michel Lespinasse > wrote: > >> On Fri, Aug 31, 2012 at 1:01 AM, Adrian Hunter >> wrote: >>> This breaks tools/perf build in linux-next: >>> >>> ../../lib/rbtree

[PATCH V12 00/13] perf tools: some fixes and tweaks

2013-08-26 Thread Adrian Hunter
e_type changes Removed perf_evlist__sample_type() Added __perf_evlist__combined_sample_type() Added perf_evlist__combined_sample_type() Added perf_evlist__make_sample_types_compatible() Added ack's to patches acked by Jiri Olsa

[PATCH V12 09/13] perf tools: add support for PERF_SAMPLE_IDENTFIER

2013-08-26 Thread Adrian Hunter
Enable parsing of samples with sample format bit PERF_SAMPLE_IDENTFIER. In addition, if the kernel supports it, prefer it to selecting PERF_SAMPLE_ID thereby avoiding the need to force compatible sample types. Signed-off-by: Adrian Hunter --- tools/perf/tests/mmap-basic.c | 2 +- tools/perf

[PATCH V12 06/13] perf tools: remove references to struct ip_event

2013-08-26 Thread Adrian Hunter
struct ip_event assumes fixed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. The information is anyway in struct sample, so use that instead. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/builtin-inject.c | 4

[PATCH V12 11/13] perf tools: expand perf_event__synthesize_sample()

2013-08-26 Thread Adrian Hunter
Expand perf_event__synthesize_sample() to handle all sample format bits. Signed-off-by: Adrian Hunter --- tools/perf/builtin-inject.c | 4 +- tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 95 - 3 files changed, 97 insertions(+), 3

[PATCH V12 08/13] perf tools: move perf_evlist__config() to a new source file

2013-08-26 Thread Adrian Hunter
perf_evlist. It is not used by the Python API. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/Makefile | 1 + tools/perf/util/evlist.c | 24 tools/perf/util/record.c | 27 +++ 3 files changed, 28 insertions(+), 24 deletions

[PATCH V12 10/13] perf tools: add missing 'abi' member to 'struct regs_dump'

2013-08-26 Thread Adrian Hunter
And store the parsed value there. Note that the 'abi' is 0 (no registers), 1 (32-bit registers) or 2 (64-bit registers), but the registers are anyway copied one-by-one as 64-bit values onto the event i.e. see 'perf_output_sample_regs()' Signed-off-by: Adrian Hunter

[PATCH V12 07/13] perf: make events stream always parsable

2013-08-26 Thread Adrian Hunter
must be read first before it is possible to parse samples found later in the perf.data file. Signed-off-by: Adrian Hunter Acked-by: Peter Zijlstra Tested-by: Stephane Eranian --- include/uapi/linux/perf_event.h | 27 --- kernel/events/core.c| 11 ++- 2

[PATCH V12 04/13] perf tools: tidy up sample parsing overflow checking

2013-08-26 Thread Adrian Hunter
The size of data retrieved from a sample event must be validated to ensure it does not go past the end of the event. That was being done sporadically and without considering integer overflows. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa --- tools/perf/util/evsel.c | 112

[PATCH V12 13/13] perf tools: add a sample parsing test

2013-08-26 Thread Adrian Hunter
Add a test that checks that sample parsing is correctly implemented. Signed-off-by: Adrian Hunter --- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/sample-parsing.c | 316 ++ tools/perf/tests/tests.h

[PATCH V12 05/13] perf tools: remove unnecessary callchain validation

2013-08-26 Thread Adrian Hunter
Now that the sample parsing correctly checks data sizes there is no reason for it to be done again for callchains. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/util/callchain.c | 8 tools/perf/util/callchain.h | 5 - tools/perf/util/session.c | 20

[PATCH V12 12/13] perf tools: add a function to calculate sample event size

2013-08-26 Thread Adrian Hunter
Add perf_event__sample_event_size() which can be used when synthesizing sample events to determine how big the resulting event will be, and therefore how much memory to allocate. Signed-off-by: Adrian Hunter --- tools/perf/util/event.h | 2 ++ tools/perf/util/evsel.c | 92

[PATCH V12 01/13] perf tools: allow non-matching sample types

2013-08-26 Thread Adrian Hunter
le on that basis. Signed-off-by: Adrian Hunter --- tools/perf/builtin-report.c | 2 +- tools/perf/util/event.h | 14 + tools/perf/util/evlist.c| 136 +--- tools/perf/util/evlist.h| 7 ++- tools/perf/util/evsel.c

[PATCH V12 03/13] perf tools: change machine__findnew_thread() to set thread pid

2013-08-26 Thread Adrian Hunter
ndnew_thread(machine, pid, pid) whereas the usage to find the specific thread is: machine__findnew_thread(machine, pid, tid) Signed-off-by: Adrian Hunter Acked-by: David Ahern --- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kmem.c | 3 ++- tools/perf/builtin-kvm.c

[PATCH V12 02/13] perf tools: add pid to struct thread

2013-08-26 Thread Adrian Hunter
Record pid on struct thread. The member is named 'pid_' to avoid confusion with the 'tid' member which was previously named 'pid'. Signed-off-by: Adrian Hunter Acked-by: David Ahern --- tools/perf/util/machine.c | 16 +++- tools/perf/util/threa

Re: [PATCH 3/3] perf tools: add 'keep tracking' test

2013-08-26 Thread Adrian Hunter
On 13/08/13 05:33, Namhyung Kim wrote: > On Wed, 7 Aug 2013 16:30:31 +0300, Adrian Hunter wrote: >> Add a test for the newly added PERF_COUNT_SW_DUMMY event. >> The test checks that tracking events continue when an >> event is disabled but a dummy software event is not &g

Re: [PATCH 1/3] perf: add a dummy software event to keep tracking

2013-08-26 Thread Adrian Hunter
On 07/08/13 16:30, Adrian Hunter wrote: > When an event is disabled the "tracking" events > selected by the 'mmap', 'comm' and 'task' bits of > struct perf_event_attr, are also disabled. However, > the information those events provide is neces

[PATCH V13 01/12] perf tools: change machine__findnew_thread() to set thread pid

2013-08-27 Thread Adrian Hunter
ndnew_thread(machine, pid, pid) whereas the usage to find the specific thread is: machine__findnew_thread(machine, pid, tid) Signed-off-by: Adrian Hunter Acked-by: David Ahern --- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kmem.c | 3 ++- tools/perf/builtin-kvm.c

[PATCH V13 00/12] perf tools: some fixes and tweaks

2013-08-27 Thread Adrian Hunter
pos calculation id_pos/is_pos updated whenever sample_type changes Removed perf_evlist__sample_type() Added __perf_evlist__combined_sample_type() Added perf_evlist__combined_sample_type() Added perf_evlist__make_sample_types_compatible()

[PATCH V13 09/12] perf tools: expand perf_event__synthesize_sample()

2013-08-27 Thread Adrian Hunter
Expand perf_event__synthesize_sample() to handle all sample format bits. Signed-off-by: Adrian Hunter --- tools/perf/builtin-inject.c | 4 +- tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 95 - 3 files changed, 97 insertions(+), 3

[PATCH V13 06/12] perf tools: move perf_evlist__config() to a new source file

2013-08-27 Thread Adrian Hunter
perf_evlist. It is not used by the Python API. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/Makefile | 1 + tools/perf/util/evlist.c | 22 -- tools/perf/util/record.c | 25 + 3 files changed, 26 insertions(+), 22 deletions

[PATCH V13 07/12] perf tools: add support for PERF_SAMPLE_IDENTFIER

2013-08-27 Thread Adrian Hunter
Enable parsing of samples with sample format bit PERF_SAMPLE_IDENTFIER. In addition, if the kernel supports it, prefer it to selecting PERF_SAMPLE_ID thereby allowing non-matching sample types. Signed-off-by: Adrian Hunter --- tools/perf/builtin-report.c | 2 +- tools/perf/tests/mmap

[PATCH V13 03/12] perf tools: remove unnecessary callchain validation

2013-08-27 Thread Adrian Hunter
Now that the sample parsing correctly checks data sizes there is no reason for it to be done again for callchains. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/util/callchain.c | 8 tools/perf/util/callchain.h | 5 - tools/perf/util/session.c | 20

[PATCH V13 12/12] perf tools: allow non-matching sample types

2013-08-27 Thread Adrian Hunter
. 'perf_evlist__config()' forces sample types to be compatible on that basis. Signed-off-by: Adrian Hunter --- tools/perf/util/event.h | 16 tools/perf/util/evlist.c | 25 + tools/perf/util/evlist.h | 1 + tools/perf/util/record.c | 5 - 4 files c

[PATCH V13 11/12] perf tools: add a sample parsing test

2013-08-27 Thread Adrian Hunter
Add a test that checks that sample parsing is correctly implemented. Signed-off-by: Adrian Hunter --- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/sample-parsing.c | 316 ++ tools/perf/tests/tests.h

[PATCH V13 10/12] perf tools: add a function to calculate sample event size

2013-08-27 Thread Adrian Hunter
Add perf_event__sample_event_size() which can be used when synthesizing sample events to determine how big the resulting event will be, and therefore how much memory to allocate. Signed-off-by: Adrian Hunter --- tools/perf/util/event.h | 2 ++ tools/perf/util/evsel.c | 92

[PATCH V13 08/12] perf tools: add missing 'abi' member to 'struct regs_dump'

2013-08-27 Thread Adrian Hunter
And store the parsed value there. Note that the 'abi' is 0 (no registers), 1 (32-bit registers) or 2 (64-bit registers), but the registers are anyway copied one-by-one as 64-bit values onto the event i.e. see 'perf_output_sample_regs()' Signed-off-by: Adrian Hunter

[PATCH V13 05/12] perf: make events stream always parsable

2013-08-27 Thread Adrian Hunter
must be read first before it is possible to parse samples found later in the perf.data file. Signed-off-by: Adrian Hunter Acked-by: Peter Zijlstra Tested-by: Stephane Eranian --- include/uapi/linux/perf_event.h | 27 --- kernel/events/core.c| 11 ++- 2

[PATCH V13 04/12] perf tools: remove references to struct ip_event

2013-08-27 Thread Adrian Hunter
struct ip_event assumes fixed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. The information is anyway in struct sample, so use that instead. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/builtin-inject.c | 4

[PATCH V13 02/12] perf tools: tidy up sample parsing overflow checking

2013-08-27 Thread Adrian Hunter
The size of data retrieved from a sample event must be validated to ensure it does not go past the end of the event. That was being done sporadically and without considering integer overflows. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa --- tools/perf/util/evsel.c | 112

PERF_EVENT_IOC_SET_OUTPUT

2013-10-01 Thread Adrian Hunter
Hi It does not seem possible to use set-output between task contexts of different types (e.g. a software event to a hardware event) If you look at perf_event_set_output(): /* * If its not a per-cpu rb, it must be the same task. */ if (output_event->cpu

Re: [BUG] perf tests: Test converting perf time to TSC

2013-10-02 Thread Adrian Hunter
On 02/10/13 16:23, Jiri Olsa wrote: > hi, > got a segfault in the tsc test on latest acme's tree. > > I'm dealing with some other issues right now, so just reporting ;-) The capability bits have changed positions. You need to have: commit fa7315871046b9a4c48627905691dbde57e51033 Author: Peter Z

Re: [BUG] perf tests: Test converting perf time to TSC

2013-10-03 Thread Adrian Hunter
On 03/10/13 11:17, Jiri Olsa wrote: > On Wed, Oct 02, 2013 at 04:46:59PM +0300, Adrian Hunter wrote: >> On 02/10/13 16:23, Jiri Olsa wrote: >>> hi, >>> got a segfault in the tsc test on latest acme's tree. >>> >>> I'm dealing with some

Re: [BUG] perf tests: Test converting perf time to TSC

2013-10-03 Thread Adrian Hunter
On 03/10/13 11:58, Peter Zijlstra wrote: > On Thu, Oct 03, 2013 at 10:56:25AM +0200, Peter Zijlstra wrote: >>> No the ABI is broken in that case - better to crash. >> >> No; neither case should crash. > > OK; previously we would report cap_usr_time = 1 even though we might not > have written stuff

Re: [BUG] perf tests: Test converting perf time to TSC

2013-10-03 Thread Adrian Hunter
On 03/10/13 11:56, Peter Zijlstra wrote: > On Thu, Oct 03, 2013 at 11:42:46AM +0300, Adrian Hunter wrote: >> On 03/10/13 11:17, Jiri Olsa wrote: >>> On Wed, Oct 02, 2013 at 04:46:59PM +0300, Adrian Hunter wrote: >>>> On 02/10/13 16:23, Jiri Olsa wrote: >>>

Re: [BUG] perf tests: Test converting perf time to TSC

2013-10-03 Thread Adrian Hunter
On 03/10/13 14:02, Peter Zijlstra wrote: > On Thu, Oct 03, 2013 at 01:13:45PM +0300, Adrian Hunter wrote: >>> Anyway; looking at this, why does time_zero have these different checks >>> from the other time bits? >>> >>> @@ -1897,6 +1898,11 @

Re: [tip:perf/core] perf/x86: Clean up cap_user_time* setting

2013-10-04 Thread Adrian Hunter
On 4/10/2013 8:31 p.m., tip-bot for Peter Zijlstra wrote: Commit-ID: d8b11a0cbd1c66ce283eb9dabe0498dfa6483f32 Gitweb: http://git.kernel.org/tip/d8b11a0cbd1c66ce283eb9dabe0498dfa6483f32 Author: Peter Zijlstra AuthorDate: Thu, 3 Oct 2013 16:00:14 +0200 Committer: Ingo Molnar CommitDate:

[PATCH V4 0/9] perf tools: kcore improvements

2013-10-06 Thread Adrian Hunter
machine__create_modules() Use 'modules' pointer Adrian Hunter (9): perf tools: make a separate function to parse /proc/modules perf tools: validate kcore module addresses perf tools: workaround objdump difficulties with kcore perf

[PATCH V4 9/9] perf tools: add ability to find kcore in build-id cache

2013-10-06 Thread Adrian Hunter
When no vmlinux is found, tools will use kallsyms and, if possible, kcore. Add the ability to find kcore in the build-id cache. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 147 +-- 1 file changed, 103 insertions(+), 44 deletions

[PATCH V4 5/9] perf tools: fix annotate_browser__callq()

2013-10-06 Thread Adrian Hunter
When following a call, annotate_browser__callq() uses the current symbol's map to look up the target ip. That will not work if the target ip is on a map with a different mapping (i.e. start - pgoff is different). Signed-off-by: Adrian Hunter --- tools/perf/ui/browsers/annotate.c

[PATCH V4 8/9] perf buildid-cache: add ability to add kcore to the cache

2013-10-06 Thread Adrian Hunter
determined. The tool will not make additional copies of kcore if there is already one with the same modules at the same addresses. Currently, perf tools will not look for kcore in the cache. That is addressed in another patch. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-buildid

[PATCH V4 7/9] perf tools: add copyfile_mode()

2013-10-06 Thread Adrian Hunter
Add a function to copy a file specifying the permissions to use for the created file. Signed-off-by: Adrian Hunter --- tools/perf/util/util.c | 18 +- tools/perf/util/util.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/util.c b/tools

[PATCH V4 6/9] perf tools: find kcore symbols on other maps

2013-10-06 Thread Adrian Hunter
Use the new map__find_other_map_symbol() to find kcore symbols on other maps. Signed-off-by: Adrian Hunter --- tools/perf/util/annotate.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 46746b8

[PATCH V4 2/9] perf tools: validate kcore module addresses

2013-10-06 Thread Adrian Hunter
object code. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 194 ++- 1 file changed, 173 insertions(+), 21 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index ffdf2e7..668dbc3 100644 --- a/tools/perf/util

[PATCH V4 3/9] perf tools: workaround objdump difficulties with kcore

2013-10-06 Thread Adrian Hunter
: Adrian Hunter --- tools/perf/util/annotate.c | 21 tools/perf/util/symbol-elf.c | 221 +++ tools/perf/util/symbol-minimal.c | 9 ++ tools/perf/util/symbol.h | 14 +++ 4 files changed, 265 insertions(+) diff --git a/tools/perf/util

[PATCH V4 1/9] perf tools: make a separate function to parse /proc/modules

2013-10-06 Thread Adrian Hunter
Make a separate function to parse /proc/modules so that it can be reused. Signed-off-by: Adrian Hunter --- tools/perf/util/machine.c | 67 +-- tools/perf/util/symbol.c | 58 tools/perf/util/symbol.h | 3

[PATCH V4 4/9] perf tools: add map__find_other_map_symbol()

2013-10-06 Thread Adrian Hunter
Add a function to find a symbol using an ip that might be on a different map. Signed-off-by: Adrian Hunter --- tools/perf/util/map.c | 27 +++ tools/perf/util/map.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c

Re: [BUG] Junk output from perf test

2013-10-07 Thread Adrian Hunter
On 07/10/13 10:21, Jiri Olsa wrote: > On Mon, Oct 07, 2013 at 11:47:13AM +0530, Ramkumar Ramachandra wrote: >> Hi, >> >> `perf test` doesn't give me a clean run; it seems to be out-of-date. I >> spent many hours on tracing "parse events tests" with gdb, but >> preprocessor macros and other complexi

[PATCH V5 07/12] perf tools: remove references to struct ip_event

2013-07-11 Thread Adrian Hunter
struct ip_event assumes fixeed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. The information is anyway in struct sample, so use that instead. Signed-off-by: Adrian Hunter --- tools/perf/builtin-inject.c | 4 ++-- tools/perf/builtin

[PATCH V5 10/12] perf tools: add support for PERF_SAMPLE_IDENTFIER

2013-07-11 Thread Adrian Hunter
Enable parsing of samples with sample format bit PERF_SAMPLE_IDENTFIER. In addition, if the kernel supports it, prefer it to selecting PERF_SAMPLE_ID thereby avoiding the need to force compatible sample types. Signed-off-by: Adrian Hunter --- tools/perf/tests/mmap-basic.c | 2 +- tools/perf

[PATCH V5 03/12] perf tools: add pid to struct thread

2013-07-11 Thread Adrian Hunter
Record pid on struct thread. The member is named 'pid_' to avoid confusion with the 'tid' member which was previously named 'pid'. Signed-off-by: Adrian Hunter --- tools/perf/util/machine.c | 16 +++- tools/perf/util/thread.c | 3 ++- tools/perf/ut

[PATCH V5 00/12] perf tools: some fixes and tweaks

2013-07-11 Thread Adrian Hunter
d perf_evlist__combined_sample_type() Added perf_evlist__make_sample_types_compatible() Added ack's to patches acked by Jiri Olsa Adrian Hunter (12): perf tools: add debug prints perf tools: allow non-matching sample types perf tools: add pid t

[PATCH V5 01/12] perf tools: add debug prints

2013-07-11 Thread Adrian Hunter
It is useful to see the arguments to perf_event_open and whether the perf events ring buffer was mmapped per-cpu or per-thread. That information will now be displayed when verbose is 2 i.e option -vv Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa --- tools/perf/util/evlist.c | 3 +++ tools

[PATCH V5 11/12] perf tools: expand perf_event__synthesize_sample()

2013-07-11 Thread Adrian Hunter
Expand perf_event__synthesize_sample() to handle all sample format bits. Signed-off-by: Adrian Hunter --- tools/perf/builtin-inject.c | 3 +- tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 70 - 3 files changed, 72 insertions(+), 2

[PATCH V5 05/12] perf tools: tidy up sample parsing overflow checking

2013-07-11 Thread Adrian Hunter
The size of data retrieved from a sample event must be validated to ensure it does not go past the end of the event. That was being done sporadically and without considering integer overflows. Signed-off-by: Adrian Hunter --- tools/perf/util/evsel.c | 101

[PATCH V5 08/12] perf tools: move struct ip_event

2013-07-11 Thread Adrian Hunter
struct ip_event assumes fixed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. struct ip_event is no longer used except by hists_link.c. Move it there. Signed-off-by: Adrian Hunter --- tools/perf/tests/hists_link.c | 23

[PATCH V5 09/12] perf: make events stream always parsable

2013-07-11 Thread Adrian Hunter
, that is the first position immediately after the header. For non-sample events, that is the last position. Signed-off-by: Adrian Hunter --- include/uapi/linux/perf_event.h | 3 ++- kernel/events/core.c| 11 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a

[PATCH V5 12/12] perf tools: add a sample parsing test

2013-07-11 Thread Adrian Hunter
Add a test that checks that sample parsing is correctly implemented. Signed-off-by: Adrian Hunter --- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/sample-parsing.c | 231 ++ tools/perf/tests/tests.h

[PATCH V5 04/12] perf tools: change machine__findnew_thread() to set thread pid

2013-07-11 Thread Adrian Hunter
Add a new parameter for 'pid' to machine__findnew_thread(). Change callers to pass 'pid' when it is known. Signed-off-by: Adrian Hunter --- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kmem.c | 3 ++- tools/perf/builtin-kvm.c | 3 ++- tools/perf/bui

[PATCH V5 06/12] perf tools: remove unnecessary callchain validation

2013-07-11 Thread Adrian Hunter
Now that the sample parsing correctly checks data sizes there is no reason for it to be done again for callchains. Signed-off-by: Adrian Hunter --- tools/perf/util/callchain.c | 8 tools/perf/util/callchain.h | 5 - tools/perf/util/session.c | 20 3 files

[PATCH V5 02/12] perf tools: allow non-matching sample types

2013-07-11 Thread Adrian Hunter
le on that basis. Signed-off-by: Adrian Hunter --- tools/perf/builtin-report.c | 2 +- tools/perf/util/event.h | 14 + tools/perf/util/evlist.c| 135 ++-- tools/perf/util/evlist.h| 8 ++- tools/perf/util/evsel.c

Re: [PATCH V4 20/21] perf: make events stream always parsable

2013-07-11 Thread Adrian Hunter
On 05/07/13 16:24, Namhyung Kim wrote: > Hi Adrian, > > On Thu, Jul 4, 2013 at 10:20 PM, Adrian Hunter > wrote: >> The event stream is not always parsable because the format of a sample >> is dependent on the sample_type of the selected event. When there >> is mo

Re: [PATCH V5 09/12] perf: make events stream always parsable

2013-07-11 Thread Adrian Hunter
On 11/07/13 18:43, David Ahern wrote: > On 7/11/13 7:12 AM, Adrian Hunter wrote: >> The event stream is not always parsable because the format of a sample >> is dependent on the sample_type of the selected event. When there >> is more than one selected event and the sam

Re: [PATCH V5 09/12] perf: make events stream always parsable

2013-07-12 Thread Adrian Hunter
On 12/07/13 12:56, Peter Zijlstra wrote: > On Thu, Jul 11, 2013 at 04:12:18PM +0300, Adrian Hunter wrote: >> The event stream is not always parsable because the format of a sample >> is dependent on the sample_type of the selected event. When there >> is more than one s

[PATCH 00/11] perf tools: kcore improvements

2013-09-16 Thread Adrian Hunter
handling of kallsyms with kcore which has been sent earlier. Adrian Hunter (11): perf tools: fix buildid cache handling of kallsyms with kcore perf tools: fix path unpopulated in machine__create_modules() perf tools: make a separate function to parse /proc/modules perf

[PATCH 04/11] perf tools: validate kcore module addresses

2013-09-16 Thread Adrian Hunter
object code. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 194 ++- 1 file changed, 173 insertions(+), 21 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 1926292..eb9bd45 100644 --- a/tools/perf/util

[PATCH 05/11] perf tools: workaround objdump difficulties with kcore

2013-09-16 Thread Adrian Hunter
: Adrian Hunter --- tools/perf/util/annotate.c | 21 tools/perf/util/symbol-elf.c | 221 +++ tools/perf/util/symbol-minimal.c | 9 ++ tools/perf/util/symbol.h | 14 +++ 4 files changed, 265 insertions(+) diff --git a/tools/perf/util

[PATCH 02/11] perf tools: fix path unpopulated in machine__create_modules()

2013-09-16 Thread Adrian Hunter
In machine__create_modules() the 'path' char array was used in a call to symbol__restricted_filename() without always being populated. Signed-off-by: Adrian Hunter --- tools/perf/util/machine.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools

[PATCH 11/11] perf tools: add ability to find kcore in build-id cache

2013-09-16 Thread Adrian Hunter
When no vmlinux is found, tools will use kallsyms and, if possible, kcore. Add the ability to find kcore in the build-id cache. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 138 --- 1 file changed, 94 insertions(+), 44 deletions

[PATCH 10/11] perf buildid-cache: add ability to add kcore to the cache

2013-09-16 Thread Adrian Hunter
determined. The tool will not make additional copies of kcore if there is already one with the same modules at the same addresses. Currently, perf tools will not look for kcore in the cache. That is addressed in another patch. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-buildid

[PATCH 07/11] perf tools: fix annotate_browser__callq()

2013-09-16 Thread Adrian Hunter
When following a call, annotate_browser__callq() uses the current symbol's map to look up the target ip. That will not work if the target ip is on a map with a different mapping (i.e. start - pgoff is different). Signed-off-by: Adrian Hunter --- tools/perf/ui/browsers/annotate.c

[PATCH 08/11] perf tools: find kcore symbols on other maps

2013-09-16 Thread Adrian Hunter
Use the new map__find_other_map_symbol() to find kcore symbols on other maps. Signed-off-by: Adrian Hunter --- tools/perf/util/annotate.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 69cf8ae

[PATCH 03/11] perf tools: make a separate function to parse /proc/modules

2013-09-16 Thread Adrian Hunter
Make a separate function to parse /proc/modules so that it can be reused. Signed-off-by: Adrian Hunter --- tools/perf/util/machine.c | 67 +-- tools/perf/util/symbol.c | 58 tools/perf/util/symbol.h | 3

[PATCH 09/11] perf tools: add copyfile_mode()

2013-09-16 Thread Adrian Hunter
Add a function to copy a file specifying the permissions to use for the created file. Signed-off-by: Adrian Hunter --- tools/perf/util/util.c | 18 +- tools/perf/util/util.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/util.c b/tools

[PATCH 06/11] perf tools: add map__find_other_map_symbol()

2013-09-16 Thread Adrian Hunter
Add a function to find a symbol using an ip that might be on a different map. Signed-off-by: Adrian Hunter --- tools/perf/util/map.c | 27 +++ tools/perf/util/map.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c

[PATCH 01/11] perf tools: fix buildid cache handling of kallsyms with kcore

2013-09-16 Thread Adrian Hunter
When kallsyms is used with kcore the dso long_name becomes the kcore file name. That prevents the buildid cache from caching kallsyms. (There is no support at present for caching kcore). Fix by changing it so that the kallsyms name is used in that case instead. Signed-off-by: Adrian Hunter

Re: [tip:perf/core] perf: Fix broken union in ' struct perf_event_mmap_page'

2013-09-18 Thread Adrian Hunter
cap_usr_fixed to identify kernels that have the capabilities bits fixed 2. Swap the positions of cap_usr_time and cap_usr_rdpmc so that cap_usr_rdpmc remains in bit 0 > > Vince > > > > > On Tue, 23 Jul 2013, tip-bot for Adrian Hunter wrote: > >> Commit-I

Re: [PATCH, v3] perf: Always set bit 0 in the capabilities field of 'struct perf_event_mmap_page' to 0, to maintain the ABI

2013-09-19 Thread Adrian Hunter
On 19/09/13 13:40, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > >> On Thu, Sep 19, 2013 at 12:28:18PM +0200, Ingo Molnar wrote: >> >> You really don't like version fields do you ;-) > > Indeed they are a horrible concept. > >> Would it make sense to do something like s/cap_usr/cap_user/ an

[PATCH 2/2] perf tools: fix parsing with no sample_id_all bit set

2013-09-04 Thread Adrian Hunter
: Adrian Hunter --- tools/perf/util/evlist.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index b8727ae..7101283 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -446,20 +446,25 @@ static int

[PATCH 1/2] perf tools: add test for parsing with no sample_id_all bit

2013-09-04 Thread Adrian Hunter
Add a test for parsing a non-sample event when there is more than one selected event but no sample_id_all bit set. The test fails because of a bug in the evlist logic. That is fixed in a separate patch. Signed-off-by: Adrian Hunter --- tools/perf/Makefile | 3 +- tools

[PATCH 0/2] perf tools: fix parsing with no sample_id_all bit set

2013-09-04 Thread Adrian Hunter
Hi Here is a fix, with a test to illustrate the issue. Adrian Hunter (2): perf tools: add test for parsing with no sample_id_all bit perf tools: fix parsing with no sample_id_all bit set tools/perf/Makefile | 3 +- tools/perf/tests/builtin-test.c

[PATCH] perf kvm: fix sample_type manipulation

2013-09-05 Thread Adrian Hunter
Manipulating the sample_type of an evsel requires the use of: perf_evsel__set_sample_bit() and perf_evsel__reset_sample_bit() Manipulating the sample type of an evlist requires the id position to be recalculated. Signed-off-by: Adrian Hunter --- tools/perf/builtin-kvm.c | 20

[PATCH V2 0/2] perf kvm: fix sample_type manipulation

2013-09-06 Thread Adrian Hunter
Hi Here is the sample identifier fix (version 2). Changes in V2: perf tools: fix id pos in perf_evlist__open() New patch perf kvm: fix sample_type manipulation Remove setting of id_pos Adrian Hunter (2): perf tools: fix id pos in

[PATCH V2 1/2] perf tools: fix id pos in perf_evlist__open()

2013-09-06 Thread Adrian Hunter
Ensure the id_pos is correct when perf_evlist__open() is used. Signed-off-by: Adrian Hunter --- tools/perf/util/evlist.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index b8727ae..005c0eb 100644 --- a/tools/perf/util

[PATCH V2 2/2] perf kvm: fix sample_type manipulation

2013-09-06 Thread Adrian Hunter
Manipulating the sample_type of an evsel requires the use of: perf_evsel__set_sample_bit() and perf_evsel__reset_sample_bit() Signed-off-by: Adrian Hunter --- tools/perf/builtin-kvm.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf

Re: [PATCHv2 00/25] perf tool: Add support for multiple data file storage

2013-09-09 Thread Adrian Hunter
On 09/09/13 14:17, Peter Zijlstra wrote: > On Sun, Sep 01, 2013 at 12:36:11PM +0200, Jiri Olsa wrote: >> hi, >> sending the support for multiple file storage. Initial >> RFC is here: >> http://marc.info/?l=linux-kernel&m=137408381902423&w=2 >> >> v2 changes: >> - reworked perf mmap size setup to

[PATCH] perf tools: fix objdump line parsing offset validation

2013-09-12 Thread Adrian Hunter
ASM_CLAC ret retq Signed-off-by: Adrian Hunter --- tools/perf/util/annotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index bfc5a27..7eae548 100644 -

[PATCH] perf tools: fix buildid cache handling of kallsyms with kcore

2013-09-12 Thread Adrian Hunter
When kallsyms is used with kcore the dso long_name becomes the kcore file name. That prevents the buildid cache from caching kallsyms. (There is no support at present for caching kcore). Fix by changing it so that the kallsyms name is used in that case instead. Signed-off-by: Adrian Hunter

[PATCH] perf tools: fix compile with libelf without get_phdrnum

2013-09-13 Thread Adrian Hunter
Add a feature check for get_phdrnum() and implement a replacement if it is not present. Signed-off-by: Adrian Hunter --- tools/perf/config/Makefile | 3 +++ tools/perf/config/feature-tests.mak | 9 + tools/perf/util/symbol-elf.c| 16 3 files changed

Re: [PATCH V4 8/9] perf buildid-cache: add ability to add kcore to the cache

2013-10-08 Thread Adrian Hunter
On 08/10/13 10:41, Namhyung Kim wrote: > On Mon, 7 Oct 2013 09:50:17 +0300, Adrian Hunter wrote: >> kcore can be used to view the running kernel object code. >> However, kcore changes as modules are loaded and unloaded, >> and when the kernel decides to modify its own code.

[PATCH V5 1/9] perf tools: make a separate function to parse /proc/modules

2013-10-08 Thread Adrian Hunter
Make a separate function to parse /proc/modules so that it can be reused. Signed-off-by: Adrian Hunter --- tools/perf/util/machine.c | 67 +-- tools/perf/util/symbol.c | 58 tools/perf/util/symbol.h | 3

[PATCH V5 0/9] perf tools: kcore improvements

2013-10-08 Thread Adrian Hunter
ols: fix buildid cache handling of kallsyms with kcore Dropped because it has been applied perf tools: fix path unpopulated in machine__create_modules() Use 'modules' pointer Adrian Hunter (9): perf tools: make a separate function to parse

[PATCH V5 9/9] perf tools: add ability to find kcore in build-id cache

2013-10-08 Thread Adrian Hunter
When no vmlinux is found, tools will use kallsyms and, if possible, kcore. Add the ability to find kcore in the build-id cache. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 147 +-- 1 file changed, 103 insertions(+), 44 deletions

[PATCH V5 3/9] perf tools: workaround objdump difficulties with kcore

2013-10-08 Thread Adrian Hunter
: Adrian Hunter --- tools/perf/util/annotate.c | 21 tools/perf/util/symbol-elf.c | 221 +++ tools/perf/util/symbol-minimal.c | 9 ++ tools/perf/util/symbol.h | 14 +++ 4 files changed, 265 insertions(+) diff --git a/tools/perf/util

[PATCH V5 5/9] perf tools: fix annotate_browser__callq()

2013-10-08 Thread Adrian Hunter
When following a call, annotate_browser__callq() uses the current symbol's map to look up the target ip. That will not work if the target ip is on a map with a different mapping (i.e. start - pgoff is different). Signed-off-by: Adrian Hunter --- tools/perf/ui/browsers/annotate.c

[PATCH V5 7/9] perf tools: add copyfile_mode()

2013-10-08 Thread Adrian Hunter
Add a function to copy a file specifying the permissions to use for the created file. Signed-off-by: Adrian Hunter --- tools/perf/util/util.c | 18 +- tools/perf/util/util.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/util.c b/tools

  1   2   3   4   5   6   7   8   9   10   >