Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 11:18 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 10:10:09AM -0800, Stephane Eranian escreveu: >> On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo >> wrote: >> > Em Fri, Jan 27, 2017 at 09:46:55AM

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 11:18 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 10:10:09AM -0800, Stephane Eranian escreveu: >> On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo >> wrote: >> > Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: >> >> On Fri,

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 10:10:09AM -0800, Stephane Eranian escreveu: > On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo > wrote: > > Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: > >> On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 10:10:09AM -0800, Stephane Eranian escreveu: > On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo > wrote: > > Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: > >> On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo > >> wrote: > >> > Em

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: > On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo > wrote: > > Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: > >> Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: > On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo > wrote: > > Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: > >> Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: > >> >

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: >> On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo >> wrote: >> > Em Fri, Jan 27, 2017 at 12:43:05PM

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 10:05 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 09:46:55AM -0800, Stephane Eranian escreveu: >> On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo >> wrote: >> > Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo >> > escreveu:

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: >> > Something like the (compile tested only) below might

Re: [PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 9:38 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: >> > Something like the (compile tested only) below might be sufficient to >> >

[PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: > > Something like the (compile tested only) below might be sufficient to > > disambiguate things. It would need a corresponding tools/perf patch of > >

[PATCH] handle munmap records in tools/perf was: Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 12:43:05PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: > > Something like the (compile tested only) below might be sufficient to > > disambiguate things. It would need a corresponding tools/perf patch of > >

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 7:43 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: >> Something like the (compile tested only) below might be sufficient to >> disambiguate things. It would need a corresponding tools/perf patch of

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Stephane Eranian
On Fri, Jan 27, 2017 at 7:43 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: >> Something like the (compile tested only) below might be sufficient to >> disambiguate things. It would need a corresponding tools/perf patch of >> course, but

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: > Something like the (compile tested only) below might be sufficient to > disambiguate things. It would need a corresponding tools/perf patch of > course, but I'm not too familiar with that code anymore. I'm working on patch to do

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Arnaldo Carvalho de Melo
Em Fri, Jan 27, 2017 at 02:07:02PM +0100, Peter Zijlstra escreveu: > Something like the (compile tested only) below might be sufficient to > disambiguate things. It would need a corresponding tools/perf patch of > course, but I'm not too familiar with that code anymore. I'm working on patch to do

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Peter Zijlstra
On Thu, Jan 26, 2017 at 03:16:08PM -0800, Stephane Eranian wrote: > One solution would be for the kernel to report actual mmaps and not resulting > VMA layouts. Is that case you would have your 4 mmaps each reporting 4kb. > That means the perf hook in the mmap code would have to be placed

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-27 Thread Peter Zijlstra
On Thu, Jan 26, 2017 at 03:16:08PM -0800, Stephane Eranian wrote: > One solution would be for the kernel to report actual mmaps and not resulting > VMA layouts. Is that case you would have your 4 mmaps each reporting 4kb. > That means the perf hook in the mmap code would have to be placed

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 3:09 PM, Andres Freund wrote: > Hi Stephane, > > > On 2017-01-26 14:51:02 -0800, Stephane Eranian wrote: >> Ok, I think I see the problem now (sorry was slow): > > No worries ;) > > >> the timeline is as follows as seen from the user in your case:

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 3:09 PM, Andres Freund wrote: > Hi Stephane, > > > On 2017-01-26 14:51:02 -0800, Stephane Eranian wrote: >> Ok, I think I see the problem now (sorry was slow): > > No worries ;) > > >> the timeline is as follows as seen from the user in your case: >> >> T0:

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi Stephane, On 2017-01-26 14:51:02 -0800, Stephane Eranian wrote: > Ok, I think I see the problem now (sorry was slow): No worries ;) > the timeline is as follows as seen from the user in your case: > > T0: mmap(0x1000) for func1() > T1 mmap(0x2000) for func1(); > T3: jit emits info

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi Stephane, On 2017-01-26 14:51:02 -0800, Stephane Eranian wrote: > Ok, I think I see the problem now (sorry was slow): No worries ;) > the timeline is as follows as seen from the user in your case: > > T0: mmap(0x1000) for func1() > T1 mmap(0x2000) for func1(); > T3: jit emits info

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 23:15:08 +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 09:49:03AM +0100, Peter Zijlstra wrote: > > > > BTW, it's also a bit weird that those MMAP2 records triggered by > > > mprotect/mmap, have prot set to 0... > > > > Yes, mprotect() does: vma->vm_flags = newflags; before

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 23:15:08 +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 09:49:03AM +0100, Peter Zijlstra wrote: > > > > BTW, it's also a bit weird that those MMAP2 records triggered by > > > mprotect/mmap, have prot set to 0... > > > > Yes, mprotect() does: vma->vm_flags = newflags; before

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 09:49:03AM +0100, Peter Zijlstra wrote: > > BTW, it's also a bit weird that those MMAP2 records triggered by > > mprotect/mmap, have prot set to 0... > > Yes, mprotect() does: vma->vm_flags = newflags; before calling > perf_event_mmap(vma); which then looks at

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 09:49:03AM +0100, Peter Zijlstra wrote: > > BTW, it's also a bit weird that those MMAP2 records triggered by > > mprotect/mmap, have prot set to 0... > > Yes, mprotect() does: vma->vm_flags = newflags; before calling > perf_event_mmap(vma); which then looks at

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 2:38 PM, Andres Freund wrote: > On 2017-01-26 14:26:12 -0800, Stephane Eranian wrote: >> On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: >> > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: >> >> The problem

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 2:38 PM, Andres Freund wrote: > On 2017-01-26 14:26:12 -0800, Stephane Eranian wrote: >> On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: >> > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: >> >> The problem is that (quoted below) without that hack

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 14:26:12 -0800, Stephane Eranian wrote: > On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: > > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: > >> The problem is that (quoted below) without that hack the subsequent > >> mmaps just expand

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 14:26:12 -0800, Stephane Eranian wrote: > On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: > > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: > >> The problem is that (quoted below) without that hack the subsequent > >> mmaps just expand the previous VMAs which

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: >> The problem is that (quoted below) without that hack the subsequent >> mmaps just expand the previous VMAs which leads to perf loosing its >>

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 2:19 PM, Peter Zijlstra wrote: > On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: >> The problem is that (quoted below) without that hack the subsequent >> mmaps just expand the previous VMAs which leads to perf loosing its >> (address,range) -> symbol

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Peter Zijlstra
On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: > The problem is that (quoted below) without that hack the subsequent > mmaps just expand the previous VMAs which leads to perf loosing its > (address,range) -> symbol mappings for previously (in the same expanded > range) known

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Peter Zijlstra
On Thu, Jan 26, 2017 at 01:00:52PM -0800, Andres Freund wrote: > The problem is that (quoted below) without that hack the subsequent > mmaps just expand the previous VMAs which leads to perf loosing its > (address,range) -> symbol mappings for previously (in the same expanded > range) known

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi, On 2017-01-26 13:34:35 -0800, Stephane Eranian wrote: > On Thu, Jan 26, 2017 at 1:22 PM, Andres Freund wrote: > > > > On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > > > Nope, not yet. I didn't want to submit an implementation that has the > > > > ugly hack of

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi, On 2017-01-26 13:34:35 -0800, Stephane Eranian wrote: > On Thu, Jan 26, 2017 at 1:22 PM, Andres Freund wrote: > > > > On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > > > Nope, not yet. I didn't want to submit an implementation that has the > > > > ugly hack of mmap()ing /dev/zero

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 1:22 PM, Andres Freund wrote: > > On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > > Nope, not yet. I didn't want to submit an implementation that has the > > > ugly hack of mmap()ing /dev/zero pages to prevent VMA merging ;). But > > > once

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 1:22 PM, Andres Freund wrote: > > On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > > Nope, not yet. I didn't want to submit an implementation that has the > > > ugly hack of mmap()ing /dev/zero pages to prevent VMA merging ;). But > > > once that's resolved I

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > Nope, not yet. I didn't want to submit an implementation that has the > > ugly hack of mmap()ing /dev/zero pages to prevent VMA merging ;). But > > once that's resolved I plan to push it upstream (they indicated > > interest). As long as

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
On 2017-01-26 13:17:56 -0800, Stephane Eranian wrote: > > Nope, not yet. I didn't want to submit an implementation that has the > > ugly hack of mmap()ing /dev/zero pages to prevent VMA merging ;). But > > once that's resolved I plan to push it upstream (they indicated > > interest). As long as

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 1:00 PM, Andres Freund wrote: > > Hi Stephane, > > On 2017-01-26 12:32:02 -0800, Stephane Eranian wrote: > > On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > > > Hi, > > > > > > While working on optionally jit-compiling parts

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
On Thu, Jan 26, 2017 at 1:00 PM, Andres Freund wrote: > > Hi Stephane, > > On 2017-01-26 12:32:02 -0800, Stephane Eranian wrote: > > On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > > > Hi, > > > > > > While working on optionally jit-compiling parts of postgres using llvm > > > (MCJIT

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi Stephane, On 2017-01-26 12:32:02 -0800, Stephane Eranian wrote: > On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > > Hi, > > > > While working on optionally jit-compiling parts of postgres using llvm > > (MCJIT currently, but Orc would have the same issue afaics),

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Andres Freund
Hi Stephane, On 2017-01-26 12:32:02 -0800, Stephane Eranian wrote: > On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > > Hi, > > > > While working on optionally jit-compiling parts of postgres using llvm > > (MCJIT currently, but Orc would have the same issue afaics), I'm trying > > to use

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
Hi Andres, Sorry for the delay. On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > Hi, > > While working on optionally jit-compiling parts of postgres using llvm > (MCJIT currently, but Orc would have the same issue afaics), I'm trying > to use perf jit support to make

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-26 Thread Stephane Eranian
Hi Andres, Sorry for the delay. On Fri, Dec 9, 2016 at 9:02 PM, Andres Freund wrote: > Hi, > > While working on optionally jit-compiling parts of postgres using llvm > (MCJIT currently, but Orc would have the same issue afaics), I'm trying > to use perf jit support to make profiling of those

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-25 Thread Andres Freund
Hi, On 2016-12-12 10:28:13 +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 01:01:48AM -0800, Andres Freund wrote: > > > > > > On December 12, 2016 12:49:03 AM PST, Peter Zijlstra > > wrote: > > >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > >

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2017-01-25 Thread Andres Freund
Hi, On 2016-12-12 10:28:13 +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 01:01:48AM -0800, Andres Freund wrote: > > > > > > On December 12, 2016 12:49:03 AM PST, Peter Zijlstra > > wrote: > > >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > > > >> Am I doing

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 01:01:48AM -0800, Andres Freund wrote: > > > On December 12, 2016 12:49:03 AM PST, Peter Zijlstra > wrote: > >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > >> Am I doing something wrong, or is there a bug here? > > > >Expected

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 01:01:48AM -0800, Andres Freund wrote: > > > On December 12, 2016 12:49:03 AM PST, Peter Zijlstra > wrote: > >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > >> Am I doing something wrong, or is there a bug here? > > > >Expected behaviour afaict > >

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Andres Freund
On December 12, 2016 12:49:03 AM PST, Peter Zijlstra wrote: >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: >> Am I doing something wrong, or is there a bug here? > >Expected behaviour afaict So I need to prevent vma merging to use perf jit support?

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Andres Freund
On December 12, 2016 12:49:03 AM PST, Peter Zijlstra wrote: >On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: >> Am I doing something wrong, or is there a bug here? > >Expected behaviour afaict So I need to prevent vma merging to use perf jit support? That seems a bit weird.

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Peter Zijlstra
On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > I presume the increasing MMAP2 size is triggered by the consecutive > pages being represented as a single page-range in the kernel? Yes, we print struct vm_area_struct based information, if vmas get merged, that shows. > If I,

Re: perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-12 Thread Peter Zijlstra
On Fri, Dec 09, 2016 at 09:02:18PM -0800, Andres Freund wrote: > > I presume the increasing MMAP2 size is triggered by the consecutive > pages being represented as a single page-range in the kernel? Yes, we print struct vm_area_struct based information, if vmas get merged, that shows. > If I,

perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-09 Thread Andres Freund
Hi, While working on optionally jit-compiling parts of postgres using llvm (MCJIT currently, but Orc would have the same issue afaics), I'm trying to use perf jit support to make profiling of those JITed parts easier. Turns out the current jit support in perf doesn't work that well for LLVM -

perf/jit doesn't cope well with mprotect() to jit containing pages

2016-12-09 Thread Andres Freund
Hi, While working on optionally jit-compiling parts of postgres using llvm (MCJIT currently, but Orc would have the same issue afaics), I'm trying to use perf jit support to make profiling of those JITed parts easier. Turns out the current jit support in perf doesn't work that well for LLVM -