Re: [PATCH v2 2/3] Add a pass to automatically add ptwrite instrumentation

2018-11-22 Thread Andi Kleen
On Thu, Nov 22, 2018 at 02:53:11PM +0100, Richard Biener wrote: > > the optimizer moving it around over function calls etc.? > > The instrumentation should still be useful when the program > > crashes, so we don't want to delay logging too much. > > You can't avoid moving it, yes. But it can be

Re: [PATCH v2 2/3] Add a pass to automatically add ptwrite instrumentation

2018-11-22 Thread Richard Biener
On Tue, Nov 20, 2018 at 7:27 PM Andi Kleen wrote: > > On Tue, Nov 20, 2018 at 01:04:19PM +0100, Richard Biener wrote: > > Since your builtin clobbers memory > > Hmm, maybe we could get rid of that, but then how to avoid > the optimizer moving it around over function calls etc.? > The

Re: [PATCH v2 2/3] Add a pass to automatically add ptwrite instrumentation

2018-11-20 Thread Andi Kleen
On Tue, Nov 20, 2018 at 01:04:19PM +0100, Richard Biener wrote: > Since your builtin clobbers memory Hmm, maybe we could get rid of that, but then how to avoid the optimizer moving it around over function calls etc.? The instrumentation should still be useful when the program crashes, so we don't

Re: [PATCH v2 2/3] Add a pass to automatically add ptwrite instrumentation

2018-11-20 Thread Richard Biener
On Fri, Nov 16, 2018 at 4:57 AM Andi Kleen wrote: > > From: Andi Kleen > > Add a new pass to automatically instrument changes to variables > with the new PTWRITE instruction on x86. PTWRITE writes a 4 or 8 byte > field into an Processor Trace log, which allows low over head > logging of

[PATCH v2 2/3] Add a pass to automatically add ptwrite instrumentation

2018-11-15 Thread Andi Kleen
From: Andi Kleen Add a new pass to automatically instrument changes to variables with the new PTWRITE instruction on x86. PTWRITE writes a 4 or 8 byte field into an Processor Trace log, which allows low over head logging of information. Essentially it's a hardware accelerated printf. This