Re: [PATCH net-next 2/2] samples/bpf: add samples for HW_CACHE / RAW events

2017-05-22 Thread David Miller
From: Alexei Starovoitov Date: Mon, 22 May 2017 16:35:07 -0700 > yet perf_event_read() is least documented. hmm. > * u64 bpf_perf_event_read(&map, index) > * Return: Number events read or error code > > that needs to be fixed. That's exactly what I was talking about :-)

Re: [PATCH net-next 2/2] samples/bpf: add samples for HW_CACHE / RAW events

2017-05-22 Thread Alexei Starovoitov
On 5/22/17 4:26 PM, David Miller wrote: From: Alexei Starovoitov Date: Mon, 22 May 2017 15:48:40 -0700 @@ -31,7 +31,7 @@ static unsigned long long (*bpf_get_current_uid_gid)(void) = (void *) BPF_FUNC_get_current_uid_gid; static int (*bpf_get_current_comm)(void *buf, int buf_size) =

Re: [PATCH net-next 2/2] samples/bpf: add samples for HW_CACHE / RAW events

2017-05-22 Thread David Miller
From: Alexei Starovoitov Date: Mon, 22 May 2017 15:48:40 -0700 > @@ -31,7 +31,7 @@ static unsigned long long (*bpf_get_current_uid_gid)(void) = > (void *) BPF_FUNC_get_current_uid_gid; > static int (*bpf_get_current_comm)(void *buf, int buf_size) = > (void *) BPF_FUNC_get_current_com

[PATCH net-next 2/2] samples/bpf: add samples for HW_CACHE / RAW events

2017-05-22 Thread Alexei Starovoitov
From: Teng Qin This commit adds sample to test attach BPF to HW_CACHE and RAW type events into the trace_event sample. The test outputs a lot of things to screen, therefore make sure it aborts on error so it's easier to see if everything works. Also update clean-up logic to disable the perf event