RE: [EXTERNAL] Re: [PATCH v4] perf inject --jit: Remove //anon mmap events

2020-06-12 Thread Steve MacLean
>>> Hi Ian, >>> I tried this as well with latest perf/core. The difference is that >>> unresolved addresses currently look like: >>> >>> 0.00% java [JIT] tid 221782 [.] 0x451499a4 >>> 0.00% java [JIT] tid 221782 [.] 0x4514f3e8 >>

RE: [EXTERNAL] Re: [PATCH v4] perf inject --jit: Remove //anon mmap events

2020-05-29 Thread Steve MacLean
>/tmp/perf/perf record -k 1 -e cycles:u -o /tmp/perf.data java >-agentpath:/tmp/perf/libperf-jvmti.so -XX:+PreserveFramePointer >-XX:InitialCodeCacheSize=20M -XX:ReservedCodeCacheSize=1G -jar >dacapo-9.12-bach.jar jython Its also possible the `InitialCodeCacheSize=20M` argument is masking the

RE: [EXTERNAL] Re: [PATCH v4] perf inject --jit: Remove //anon mmap events

2020-05-29 Thread Steve MacLean
> I've been trying variants of: > > Before: >/tmp/perf/perf record -k 1 -e cycles:u -o /tmp/perf.data java >-agentpath:/tmp/perf/libperf-jvmti.so -XX:+PreserveFramePointer >-XX:InitialCodeCacheSize=20M -XX:ReservedCodeCacheSize=1G -jar >dacapo-9.12-bach.jar jython /tmp/perf/perf inject -i /tmp/p

RE: [EXTERNAL] Re: [PATCH v4] perf inject --jit: Remove //anon mmap events

2020-05-27 Thread Steve MacLean
>> ** Implemented solution >> >> This patch solves the issue by removing // anon mmap events for any >> process which has a valid jit-.dump file. >> >> It tracks on a per process basis to handle the case where some running >> apps support jit-.dump, but some only support perf-.map. >> >> It adds

[PATCH v4] perf inject --jit: Remove //anon mmap events

2020-05-26 Thread Steve MacLean
From: Steve MacLean **perf-.map and jit-.dump designs: When a JIT generates code to be executed, it must allocate memory and mark it executable using an mmap call. *** perf-.map design The perf-.map assumes that any sample recorded in an anonymous memory page is JIT code. It then tries to

[PATCH RESEND] perf inject --jit: Remove //anon mmap events

2019-10-17 Thread Steve MacLean
From: Steve MacLean While a JIT is jitting code it will eventually need to commit more pages and change these pages to executable permissions. Typically the JIT will want these colocated to minimize branch displacements. The kernel will coalesce these anonymous mapping with identical

[tip: perf/urgent] perf docs: Correct and clarify jitdump spec

2019-10-07 Thread tip-bot2 for Steve MacLean
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 2657983b4c0d81632c6a73bae469951b0d341251 Gitweb: https://git.kernel.org/tip/2657983b4c0d81632c6a73bae469951b0d341251 Author:Steve MacLean AuthorDate:Sat, 28 Sep 2019 01:53:08 Committer

[tip: perf/urgent] perf map: Fix overlapped map handling

2019-10-07 Thread tip-bot2 for Steve MacLean
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: ee212d6ea20887c0ef352be8563ca13dbf965906 Gitweb: https://git.kernel.org/tip/ee212d6ea20887c0ef352be8563ca13dbf965906 Author:Steve MacLean AuthorDate:Sat, 28 Sep 2019 01:39:00 Committer

[tip: perf/urgent] perf inject jit: Fix JIT_CODE_MOVE filename

2019-10-07 Thread tip-bot2 for Steve MacLean
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: b59711e9b0d22fd47abfa00602fd8c365cdd3ab7 Gitweb: https://git.kernel.org/tip/b59711e9b0d22fd47abfa00602fd8c365cdd3ab7 Author:Steve MacLean AuthorDate:Sat, 28 Sep 2019 01:41:18 Committer

[PATCH 3/4] perf inject --jit: Remove //anon mmap events

2019-10-02 Thread Steve MacLean
From: Steve MacLean While a JIT is jitting code it will eventually need to commit more pages and change these pages to executable permissions. Typically the JIT will want these colocated to minimize branch displacements. The kernel will coalesce these anonymous mapping with identical

RE: [PATCH 3/4 RESEND] perf inject --jit: Remove //anon mmap events

2019-10-02 Thread Steve MacLean
> looks like Andi is right, I'm still getting malformed patch error > the patch has extra characters '=20' and broken lines, like: My apologies, I was trying to get by with an inappropriate mailer. I have an sendmail account now, and will resend.

[PATCH 3/4 RESEND] perf inject --jit: Remove //anon mmap events

2019-09-30 Thread Steve MacLean
how-mmap-events | grep '//anon' Repro: This issue was discovered while testing the initial CoreCLR jitdump implementation. https://github.com/dotnet/coreclr/pull/26897. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Ji

RE: [PATCH 3/4] perf inject --jit: Remove //anon mmap events

2019-09-30 Thread Steve MacLean
SNIP > I can't apply this one: > patching file builtin-inject.c > Hunk #1 FAILED at 263. > 1 out of 1 hunk FAILED -- saving rejects to file builtin-inject.c.rej I assume this is because I based my patches on the wrong tip. > patching file util/jitdump.c > patch: malformed patch at line 23

[PATCH 4/4] perf docs: Correct and clarify jitdump spec

2019-09-27 Thread Steve MacLean
value. Specify that the reader uses the value to detect endian mismatches. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: linux-kernel@vger.kernel.org Signed-off-by: Steve MacLean

[PATCH 3/4] perf inject --jit: Remove //anon mmap events

2019-09-27 Thread Steve MacLean
how-mmap-events | grep '//anon' Repro: This issue was discovered while testing the initial CoreCLR jitdump implementation. https://github.com/dotnet/coreclr/pull/26897. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Ji

[PATCH 2/4] perf inject jit: Fix JIT_CODE_MOVE filename

2019-09-27 Thread Steve MacLean
e. Make both records emit the same filename based on the full 64 bit code_index field. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: linux-kernel@vger.kernel.org Signed-off-by:

[PATCH 1/4] perf map: fix overlapped map handling

2019-09-27 Thread Steve MacLean
e [unknown] symbols were resolved. Tested-by: Brian Robbins Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: linux-kernel@vger.kernel.org Signed-off-by: Steve MacLean --- tools/

RE: [PATCH] perf map: fix overlapped map handling

2019-09-27 Thread Steve MacLean
>> An earlier version of this patch used: >> after->start = map->end; >> +after->pgoff += map->end - pos->start; >> >> Instead of the newer Functionally equivalent: >> after->start = map->end; >> +after->pgoff = pos-

RE: [PATCH] perf map: fix overlapped map handling

2019-09-20 Thread Steve MacLean
>> after->start = map->end; >> +after->pgoff = pos->map_ip(pos, map->end); > > So is this equivalent to what __split_vma() does in the kernel, i.e.: > >if (new_below) >new->vm_end = addr; >else { >new->vm_start

[PATCH] perf map: fix overlapped map handling

2019-09-20 Thread Steve MacLean
symbol name resolution for any ip in the after region. Make maps__fixup_overlappings() correctly populate map.pgoff. Add an assert that new mapping matches old mapping at the beginning of the after map. Signed-off-by: Steve MacLean --- tools/perf/util/map.c | 3 +++ 1 file changed, 3 insertions