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: [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 He Kuang
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 reloc sections have 'Addend' in the entry, but there's no

Re: [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/5 15:11, Alexei Starovoitov wrote: On 8/4/15 11:51 PM, Wangnan (F) wrote: void bpf_store_half(void *skb, int off, int val) asm("llvm.bpf.store.half"); int func() { bpf_store_half(0, 0, 0); return 0; } Compiled with: $ clang -g -target bpf -O2 -S -c test.c And

Re: [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 8/4/15 11:51 PM, Wangnan (F) wrote: void bpf_store_half(void *skb, int off, int val) asm("llvm.bpf.store.half"); int func() { bpf_store_half(0, 0, 0); return 0; } Compiled with: $ clang -g -target bpf -O2 -S -c test.c And get this: .text .globl func

Re: [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/5 10:05, Wangnan (F) wrote: Send again since llvmdev is moved to llvm-...@lists.llvm.org On 2015/8/5 9:58, Wangnan (F) wrote: On 2015/8/4 3:44, Alexei Starovoitov wrote: On 7/31/15 3:18 AM, Wangnan (F) wrote: [SNIP] didn't have time to look at it. from your llvm patches

Re: [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/5 10:05, Wangnan (F) wrote: Send again since llvmdev is moved to llvm-...@lists.llvm.org On 2015/8/5 9:58, Wangnan (F) wrote: On 2015/8/4 3:44, Alexei Starovoitov wrote: On 7/31/15 3:18 AM, Wangnan (F) wrote: [SNIP] didn't have time to look at it. from your llvm patches

Re: [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 8/4/15 11:51 PM, Wangnan (F) wrote: void bpf_store_half(void *skb, int off, int val) asm(llvm.bpf.store.half); int func() { bpf_store_half(0, 0, 0); return 0; } Compiled with: $ clang -g -target bpf -O2 -S -c test.c And get this: .text .globl func

Re: [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/5 15:11, Alexei Starovoitov wrote: On 8/4/15 11:51 PM, Wangnan (F) wrote: void bpf_store_half(void *skb, int off, int val) asm(llvm.bpf.store.half); int func() { bpf_store_half(0, 0, 0); return 0; } Compiled with: $ clang -g -target bpf -O2 -S -c test.c And get

Re: [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 He Kuang
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 reloc sections have 'Addend' in the entry, but there's no

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:

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

2015-08-04 Thread Wangnan (F)
Send again since llvmdev is moved to llvm-...@lists.llvm.org On 2015/8/5 9:58, Wangnan (F) wrote: On 2015/8/4 17:01, Wangnan (F) wrote: For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from:

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

2015-08-04 Thread Wangnan (F)
On 2015/8/4 17:01, Wangnan (F) wrote: For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from: http://lkml.kernel.org/r/55b1535e.8090...@plumgrid.com Our goal is to fild a way to make BPF program get an unique ID for

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

2015-08-04 Thread Wangnan (F)
For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from: http://lkml.kernel.org/r/55b1535e.8090...@plumgrid.com Our goal is to fild a way to make BPF program get an unique ID for each type so it can pass the ID to other

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

2015-08-04 Thread Wangnan (F)
For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from: http://lkml.kernel.org/r/55b1535e.8090...@plumgrid.com Our goal is to fild a way to make BPF program get an unique ID for each type so it can pass the ID to other

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

2015-08-04 Thread Wangnan (F)
Send again since llvmdev is moved to llvm-...@lists.llvm.org On 2015/8/5 9:58, Wangnan (F) wrote: On 2015/8/4 17:01, Wangnan (F) wrote: For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from:

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

2015-08-04 Thread Wangnan (F)
On 2015/8/4 17:01, Wangnan (F) wrote: For people who in llvmdev: This mail is belong to a thread in linux kernel mailing list, the first message can be retrived from: http://lkml.kernel.org/r/55b1535e.8090...@plumgrid.com Our goal is to fild a way to make BPF program get an unique ID for