Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-04-01 Thread Alexei Starovoitov
On 4/1/16 7:41 AM, Naveen N. Rao wrote: On 2016/03/31 10:52AM, Alexei Starovoitov wrote: On 3/31/16 4:25 AM, Naveen N. Rao wrote: ... + +#ifdef __powerpc__ +#define BPF_KPROBE_READ_RET_IP(ip, ctx){ (ip) = (ctx)->link; } +#define BPF_KRETPROBE_READ_RET_IP(ip, ctx)

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-04-01 Thread Alexei Starovoitov
On 4/1/16 7:41 AM, Naveen N. Rao wrote: On 2016/03/31 10:52AM, Alexei Starovoitov wrote: On 3/31/16 4:25 AM, Naveen N. Rao wrote: ... + +#ifdef __powerpc__ +#define BPF_KPROBE_READ_RET_IP(ip, ctx){ (ip) = (ctx)->link; } +#define BPF_KRETPROBE_READ_RET_IP(ip, ctx)

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-04-01 Thread Naveen N. Rao
On 2016/03/31 10:52AM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: > ... > >+ > >+#ifdef __powerpc__ > >+#define BPF_KPROBE_READ_RET_IP(ip, ctx) { (ip) = (ctx)->link; } > >+#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) BPF_KPROBE_READ_RET_IP(ip, ctx) > >+#else >

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-04-01 Thread Naveen N. Rao
On 2016/03/31 10:52AM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: > ... > >+ > >+#ifdef __powerpc__ > >+#define BPF_KPROBE_READ_RET_IP(ip, ctx) { (ip) = (ctx)->link; } > >+#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) BPF_KPROBE_READ_RET_IP(ip, ctx) > >+#else >

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-03-31 Thread Alexei Starovoitov
On 3/31/16 4:25 AM, Naveen N. Rao wrote: Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. I have fixed

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-03-31 Thread Alexei Starovoitov
On 3/31/16 4:25 AM, Naveen N. Rao wrote: Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. I have fixed

[PATCH 4/4] samples/bpf: Enable powerpc support

2016-03-31 Thread Naveen N. Rao
Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. I have fixed this to work with x86_64 and arm64, but not

[PATCH 4/4] samples/bpf: Enable powerpc support

2016-03-31 Thread Naveen N. Rao
Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. I have fixed this to work with x86_64 and arm64, but not