Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-06 Thread Alexei Starovoitov
On Thu, Aug 06, 2015 at 12:35:30PM +0800, Wangnan (F) wrote: > > > On 2015/8/6 11:22, Alexei Starovoitov wrote: > >On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: > >>It doesn't work for me at first since in my llvm there's only > >>llvm.bpf.load.*. > >> > >>I think llvm.bpf.store.*

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-06 Thread Alexei Starovoitov
On Thu, Aug 06, 2015 at 12:31:26PM +0800, Wangnan (F) wrote: > > > What about hacking ELF binary in memory? > > 1. load the object into memory; > 2. twist the machine code to EM_X86_64; > 3. load it using elf_begin; > 4. return the twested elf memory image using libdwfl's find_elf callback. >

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-06 Thread Alexei Starovoitov
On Thu, Aug 06, 2015 at 12:35:30PM +0800, Wangnan (F) wrote: On 2015/8/6 11:22, Alexei Starovoitov wrote: On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: It doesn't work for me at first since in my llvm there's only llvm.bpf.load.*. I think llvm.bpf.store.* belone to some

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-06 Thread Alexei Starovoitov
On Thu, Aug 06, 2015 at 12:31:26PM +0800, Wangnan (F) wrote: What about hacking ELF binary in memory? 1. load the object into memory; 2. twist the machine code to EM_X86_64; 3. load it using elf_begin; 4. return the twested elf memory image using libdwfl's find_elf callback. Then

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Wangnan (F)
On 2015/8/6 11:22, Alexei Starovoitov wrote: On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: It doesn't work for me at first since in my llvm there's only llvm.bpf.load.*. I think llvm.bpf.store.* belone to some patches you haven't posted yet? nope. only loads have special

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Wangnan (F)
On 2015/8/6 11:41, Alexei Starovoitov wrote: On Wed, Aug 05, 2015 at 04:59:01PM +0800, He Kuang wrote: Hi, Alexei On 2015/7/30 1:13, Alexei Starovoitov wrote: On 7/29/15 2:38 AM, He Kuang wrote: Hi, Alexei On 2015/7/28 10:18, Alexei Starovoitov wrote: On 7/25/15 3:04 AM, He Kuang wrote:

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Alexei Starovoitov
On Wed, Aug 05, 2015 at 04:59:01PM +0800, He Kuang wrote: > Hi, Alexei > > On 2015/7/30 1:13, Alexei Starovoitov wrote: > >On 7/29/15 2:38 AM, He Kuang wrote: > >>Hi, Alexei > >> > >>On 2015/7/28 10:18, Alexei Starovoitov wrote: > >>>On 7/25/15 3:04 AM, He Kuang wrote: > I noticed that for

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Alexei Starovoitov
On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: > > It doesn't work for me at first since in my llvm there's only > llvm.bpf.load.*. > > I think llvm.bpf.store.* belone to some patches you haven't posted yet? nope. only loads have special instructions ld_abs/ld_ind which are

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Wangnan (F)
On 2015/8/6 11:22, Alexei Starovoitov wrote: On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: It doesn't work for me at first since in my llvm there's only llvm.bpf.load.*. I think llvm.bpf.store.* belone to some patches you haven't posted yet? nope. only loads have special

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Alexei Starovoitov
On Wed, Aug 05, 2015 at 04:59:01PM +0800, He Kuang wrote: Hi, Alexei On 2015/7/30 1:13, Alexei Starovoitov wrote: On 7/29/15 2:38 AM, He Kuang wrote: Hi, Alexei On 2015/7/28 10:18, Alexei Starovoitov wrote: On 7/25/15 3:04 AM, He Kuang wrote: I noticed that for 64-bit elf format, the

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Alexei Starovoitov
On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: It doesn't work for me at first since in my llvm there's only llvm.bpf.load.*. I think llvm.bpf.store.* belone to some patches you haven't posted yet? nope. only loads have special instructions ld_abs/ld_ind which are represented

Re: [llvm-dev] [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event

2015-08-05 Thread Wangnan (F)
On 2015/8/6 11:41, Alexei Starovoitov wrote: On Wed, Aug 05, 2015 at 04:59:01PM +0800, He Kuang wrote: Hi, Alexei On 2015/7/30 1:13, Alexei Starovoitov wrote: On 7/29/15 2:38 AM, He Kuang wrote: Hi, Alexei On 2015/7/28 10:18, Alexei Starovoitov wrote: On 7/25/15 3:04 AM, He Kuang wrote: