Re: [PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread xiakaixu
于 2015/10/20 10:14, Alexei Starovoitov 写道: > On 10/19/15 3:37 AM, Kaixu Xia wrote: >> +/* flags for PERF_EVENT_ARRAY maps*/ >> +enum { >> +BPF_EVENT_CTL_BIT_CUR = 0, >> +BPF_EVENT_CTL_BIT_ALL = 1, >> +__NR_BPF_EVENT_CTL_BITS, >> +}; >> + >> +#defineBPF_CTL_BIT_FLAG_MASK \ >> +

Re: [PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Alexei Starovoitov
On 10/19/15 3:37 AM, Kaixu Xia wrote: +/* flags for PERF_EVENT_ARRAY maps*/ +enum { + BPF_EVENT_CTL_BIT_CUR = 0, + BPF_EVENT_CTL_BIT_ALL = 1, + __NR_BPF_EVENT_CTL_BITS, +}; + +#defineBPF_CTL_BIT_FLAG_MASK \ + ((1ULL << __NR_BPF_EVENT_CTL_BITS) - 1) +#define

[PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Kaixu Xia
This patch adds the flag soft_enable to control the trace data output process when perf sampling. By setting this flag and integrating with ebpf, we can control the data output process and get the samples we are most interested in. The bpf helper bpf_perf_event_control() can control either the

[PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Kaixu Xia
This patch adds the flag soft_enable to control the trace data output process when perf sampling. By setting this flag and integrating with ebpf, we can control the data output process and get the samples we are most interested in. The bpf helper bpf_perf_event_control() can control either the

Re: [PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread xiakaixu
于 2015/10/20 10:14, Alexei Starovoitov 写道: > On 10/19/15 3:37 AM, Kaixu Xia wrote: >> +/* flags for PERF_EVENT_ARRAY maps*/ >> +enum { >> +BPF_EVENT_CTL_BIT_CUR = 0, >> +BPF_EVENT_CTL_BIT_ALL = 1, >> +__NR_BPF_EVENT_CTL_BITS, >> +}; >> + >> +#defineBPF_CTL_BIT_FLAG_MASK \ >> +

Re: [PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Alexei Starovoitov
On 10/19/15 3:37 AM, Kaixu Xia wrote: +/* flags for PERF_EVENT_ARRAY maps*/ +enum { + BPF_EVENT_CTL_BIT_CUR = 0, + BPF_EVENT_CTL_BIT_ALL = 1, + __NR_BPF_EVENT_CTL_BITS, +}; + +#defineBPF_CTL_BIT_FLAG_MASK \ + ((1ULL << __NR_BPF_EVENT_CTL_BITS) - 1) +#define