Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-12-02 Thread Andi Kleen
On Sun, Dec 02, 2018 at 05:26:32PM +0100, Dominique d'Humières wrote: > Hi Andi, > > % gcc9 -S -pg -mfentry -minstrument-return=call -mrecord-return > /opt/gcc/work/gcc/testsuite/gcc.target/i386/returninst1.c -m32 > cc1: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination >

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-12-02 Thread Dominique d'Humières
Hi Andi, % gcc9 -S -pg -mfentry -minstrument-return=call -mrecord-return /opt/gcc/work/gcc/testsuite/gcc.target/i386/returninst1.c -m32 cc1: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic The tests should be protected. TIA Dominique

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-29 Thread Jan Hubicka
> > I don't think it is because the instrumentation only adds calls, and > calls don't get annotated in DWARF. The only issue I could think of > if is something patches in push instructions through the nops, > but there is really nothing the compiler could do about that. > > I tested gdb and it

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-28 Thread Andi Kleen
On Wed, Nov 28, 2018 at 05:24:37PM +0100, Jan Hubicka wrote: > > On Wed, Nov 28, 2018 at 04:59:25PM +0100, Jan Hubicka wrote: > > > Hi, > > > I wonder how __return_loc sections work. In general it would be nice to > > > > You mean how it's used? It's for patching in/out return instrumentation > >

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-28 Thread Jan Hubicka
> On Wed, Nov 28, 2018 at 04:59:25PM +0100, Jan Hubicka wrote: > > Hi, > > I wonder how __return_loc sections work. In general it would be nice to > > You mean how it's used? It's for patching in/out return instrumentation > at runtime, and to find them we use the sections. > > > avoid direct ou

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-28 Thread Andi Kleen
On Wed, Nov 28, 2018 at 04:59:25PM +0100, Jan Hubicka wrote: > Hi, > I wonder how __return_loc sections work. In general it would be nice to You mean how it's used? It's for patching in/out return instrumentation at runtime, and to find them we use the sections. > avoid direct output of assemble

Re: [PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-28 Thread Jan Hubicka
Hi, I wonder how __return_loc sections work. In general it would be nice to avoid direct output of assembler code in favour of adding instructions to rtl stream which should be possible to insert the call and return. __return_loc seems harder, also I wonder if it makes unwind information possible?

[PING^3] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-21 Thread Andi Kleen
Andi Kleen writes: Ping^3! > Andi Kleen writes: > > Ping!^2 > >> Andi Kleen writes: >> >> Ping! >> >>> From: Andi Kleen >>> >>> When instrumenting programs using __fentry__ it is often useful >>> to instrument the function return too. Traditionally this >>> has been done by patching the retur

Re: [PING^2] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-15 Thread Andi Kleen
Andi Kleen writes: Ping!^2 > Andi Kleen writes: > > Ping! > >> From: Andi Kleen >> >> When instrumenting programs using __fentry__ it is often useful >> to instrument the function return too. Traditionally this >> has been done by patching the return address on the stack >> frame on entry. How

[PING] Re: [PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-08 Thread Andi Kleen
Andi Kleen writes: Ping! > From: Andi Kleen > > When instrumenting programs using __fentry__ it is often useful > to instrument the function return too. Traditionally this > has been done by patching the return address on the stack > frame on entry. However this is fairly complicated (trace > f

[PATCH 1/3] Support instrumenting returns of instrumented functions

2018-11-04 Thread Andi Kleen
From: Andi Kleen When instrumenting programs using __fentry__ it is often useful to instrument the function return too. Traditionally this has been done by patching the return address on the stack frame on entry. However this is fairly complicated (trace function has to emulate a stack) and also