Re: [PATCH] checkpatch: Add TP_printk to list of logging functions

2017-10-18 Thread Song Liu
> On Oct 17, 2017, at 4:29 PM, Joe Perches <j...@perches.com> wrote: > > So the line length check can be bypassed by its callers. > > Reported-by: Song Liu <songliubrav...@fb.com> > Signed-off-by: Joe Perches <j...@perches.com> > --- > scripts/checkpa

Re: [PATCH 1/6] perf: Add new type PERF_TYPE_PROBE

2017-11-29 Thread Song Liu
> On Nov 23, 2017, at 2:22 AM, Peter Zijlstra <pet...@infradead.org> wrote: > > On Wed, Nov 15, 2017 at 09:23:33AM -0800, Song Liu wrote: >> A new perf type PERF_TYPE_PROBE is added to allow creating [k,u]probe >> with perf_event_open. These [k,u]probe are associated

[PATCH v2 5/6] bpf: add option for bpf_load.c to use PERF_TYPE_KPROBE

2017-11-29 Thread Song Liu
Function load_and_attach() is updated to be able to create kprobes with either old text based API, or the new PERF_TYPE_KPROBE API. A global flag use_perf_type_probe is added to select between the two APIs. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Josef Bacik <jba.

[PATCH v2 0/6] enable creating [k,u]probe with perf_event_open

2017-11-29 Thread Song Liu
: add type PERF_TYPE_KPROBE and PERF_TYPE_UPROBE bcc patch: bcc: Try use new API to create [k,u]probe with perf_event_open kernel patches: Song Liu (6): perf: Add new types PERF_TYPE_KPROBE and PERF_TYPE_UPROBE perf: copy new perf_event.h to tools/include/uapi perf: implement support of PERF_TYPE_KPR

[PATCH v3 3/6] perf: implement pmu perf_kprobe

2017-11-30 Thread Song Liu
() and destroy_local_trace_kprobe() are added to created and destroy these local trace_kprobe. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- include/linux/trace_events.h| 2 + kernel/events/core

[PATCH v3 0/6] enable creating [k,u]probe with perf_event_open

2017-11-30 Thread Song Liu
c: Try use new API to create [k,u]probe with perf_event_open kernel patches: Song Liu (6): perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe perf: copy new perf_event.h to tools/include/uapi perf: implement pmu perf_kprobe perf: implement pmu perf_uprobe bpf:

[PATCH v3 2/6] perf: copy new perf_event.h to tools/include/uapi

2017-11-30 Thread Song Liu
perf_event.h is updated in previous patch, this patch applies same changes to the tools/ version. This is part is put in a separate patch in case the two files are back ported separately. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Review

[PATCH v3 4/6] perf: implement pmu perf_uprobe

2017-11-30 Thread Song Liu
This patch adds perf_uprobe support with similar pattern as previous patch (for kprobe). Two functions, create_local_trace_uprobe() and destroy_local_trace_uprobe(), are created so a uprobe can be created and attached to the file descriptor created by perf_event_open(). Signed-off-by: Song Liu

[PATCH v3] bcc: Try use new API to create [k,u]probe with perf_event_open

2017-11-30 Thread Song Liu
New kernel API allows creating [k,u]probe with perf_event_open. This patch tries to use the new API. If the new API doesn't work, we fall back to old API. bpf_detach_probe() looks up the event being removed. If the event is not found, we skip the clean up procedure. Signed-off-by: Song Liu

[PATCH v3] perf_event_open.2: add type kprobe and uprobe

2017-11-30 Thread Song Liu
Two new types kprobe and uprobe are being added to perf_event_open, which allow creating kprobe or uprobe with perf_event_open. This patch adds information about these types. Signed-off-by: Song Liu <songliubrav...@fb.com> --- man2/perf_event_open.

[PATCH v3 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe

2017-11-30 Thread Song Liu
to union config1 for pointers to function name for kprobe or binary path for uprobe. kprobe_addr and probe_offset are added to union config2 for kernel address (when kprobe_func is NULL), or [k,u]probe offset. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y.

[PATCH v3 6/6] bpf: add new test test_many_kprobe

2017-11-30 Thread Song Liu
5.077558 seconds Cleaning 1000 kprobes with perf_kprobe (function name) takes 81.241354 seconds Creating 1000 kprobes with perf_kprobe (function addr) takes 5.218255 seconds Cleaning 1000 kprobes with perf_kprobe (function addr) takes 80.010731 seconds Signed-off-by: Song Liu <songliubrav...@fb.

[PATCH v3 5/6] bpf: add option for bpf_load.c to use perf_kprobe

2017-11-30 Thread Song Liu
Function load_and_attach() is updated to be able to create kprobes with either old text based API, or the new perf_event_open API. A global flag use_perf_kprobe is added to select between the two APIs. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Josef Bacik <jba.

[PATCH v2 1/6] perf: Add new types PERF_TYPE_KPROBE and PERF_TYPE_UPROBE

2017-11-29 Thread Song Liu
are added to union config1 for pointers to function name for kprobe or binary path for uprobe. kprobe_addr and probe_offset are added to union config2 for kernel address (when kprobe_func is NULL), or [k,u]probe offset. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong S

[PATCH v2] bcc: Try use new API to create [k,u]probe with perf_event_open

2017-11-29 Thread Song Liu
New kernel API allows creating [k,u]probe with perf_event_open. This patch tries to use the new API. If the new API doesn't work, we fall back to old API. bpf_detach_probe() looks up the event being removed. If the event is not found, we skip the clean up procedure. Signed-off-by: Song Liu

[PATCH v2 2/6] perf: copy new perf_event.h to tools/include/uapi

2017-11-29 Thread Song Liu
perf_event.h is updated in previous patch, this patch applies same changes to the tools/ version. This is part is put in a separate patch in case the two files are back ported separately. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Review

[PATCH v2 3/6] perf: implement support of PERF_TYPE_KPROBE

2017-11-29 Thread Song Liu
, create_local_trace_kprobe() and destroy_local_trace_kprobe() are added to created and destroy these local trace_kprobe. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- include/linux/trace_events.h|

[PATCH v2 4/6] perf: implement support of PERF_TYPE_UPROBE

2017-11-29 Thread Song Liu
This patch adds perf_uprobe support with similar pattern as previous patch (for kprobe). Two functions, create_local_trace_uprobe() and destroy_local_trace_uprobe(), are created so a uprobe can be created and attached to the file descriptor created by perf_event_open(). Signed-off-by: Song Liu

[PATCH v2 6/6] bpf: add new test test_many_kprobe

2017-11-29 Thread Song Liu
) takes 5.077558 seconds Cleaning 1000 kprobes with PERF_TYPE_KPROBE (function name) takes 81.241354 seconds Creating 1000 kprobes with PERF_TYPE_KPROBE (function addr) takes 5.218255 seconds Cleaning 1000 kprobes with PERF_TYPE_KPROBE (function addr) takes 80.010731 seconds Signed-off-by: Song

[PATCH v2] perf_event_open.2: add type PERF_TYPE_KPROBE and PERF_TYPE_UPROBE

2017-11-29 Thread Song Liu
Two new types PERF_TYPE_KPROBE and PERF_TYPE_UPROBE are being added to perf_event_attr. This patch adds information about this type. Signed-off-by: Song Liu <songliubrav...@fb.com> --- man2/perf_event_open.2 | 42 ++ 1 file changed, 42 insertions(+)

Re: [PATCH v3 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe

2017-12-04 Thread Song Liu
> On Dec 3, 2017, at 9:03 AM, Alexei Starovoitov <alexei.starovoi...@gmail.com> > wrote: > > On Thu, Nov 30, 2017 at 03:50:18PM -0800, Song Liu wrote: >> Two new perf types, perf_kprobe and perf_uprobe, will be added to allow >> creating [k,u]probe with per

Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-04 Thread Song Liu
+{ > + trace_tcp_set_state(sk, sk->sk_state, newstate); > + sk_state_store(sk, newstate); > +} > + > +void __tcp_set_state(struct sock *sk, int state) > +{ > + trace_tcp_set_state(sk, sk->sk_state, state); > + sk->sk_state = state; > +} > + > void tcp_set_state(struct sock *sk, int state) > { > int oldstate = sk->sk_state; > -- > 1.8.3.1 > Asked-by: Song Liu <songliubrav...@fb.com>

[PATCH v4 5/6] bpf: add option for bpf_load.c to use perf_kprobe

2017-12-04 Thread Song Liu
Function load_and_attach() is updated to be able to create kprobes with either old text based API, or the new perf_event_open API. A global flag use_perf_kprobe is added to select between the two APIs. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Josef Bacik <jba.

[PATCH v4 2/6] perf: copy new perf_event.h to tools/include/uapi

2017-12-04 Thread Song Liu
perf_event.h is updated in previous patch, this patch applies same changes to the tools/ version. This is part is put in a separate patch in case the two files are back ported separately. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Review

[PATCH v4] bcc: Try use new API to create [k,u]probe with perf_event_open

2017-12-04 Thread Song Liu
New kernel API allows creating [k,u]probe with perf_event_open. This patch tries to use the new API. If the new API doesn't work, we fall back to old API. bpf_detach_probe() looks up the event being removed. If the event is not found, we skip the clean up procedure. Signed-off-by: Song Liu

[PATCH v4 4/6] perf: implement pmu perf_uprobe

2017-12-04 Thread Song Liu
This patch adds perf_uprobe support with similar pattern as previous patch (for kprobe). Two functions, create_local_trace_uprobe() and destroy_local_trace_uprobe(), are created so a uprobe can be created and attached to the file descriptor created by perf_event_open(). Signed-off-by: Song Liu

[PATCH v4] perf_event_open.2: add type kprobe and uprobe

2017-12-04 Thread Song Liu
Two new types kprobe and uprobe are being added to perf_event_open, which allow creating kprobe or uprobe with perf_event_open. This patch adds information about these types. Signed-off-by: Song Liu <songliubrav...@fb.com> --- man2/perf_event_open.

[PATCH v4 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe

2017-12-04 Thread Song Liu
to union config1 for pointers to function name for kprobe or binary path for uprobe. kprobe_addr and probe_offset are added to union config2 for kernel address (when kprobe_func is NULL), or [k,u]probe offset. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y.

[PATCH v4 3/6] perf: implement pmu perf_kprobe

2017-12-04 Thread Song Liu
() and destroy_local_trace_kprobe() are added to created and destroy these local trace_kprobe. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- include/linux/trace_events.h| 4 ++ kernel/events/core

[PATCH v4 6/6] bpf: add new test test_many_kprobe

2017-12-04 Thread Song Liu
5.077558 seconds Cleaning 1000 kprobes with perf_kprobe (function name) takes 81.241354 seconds Creating 1000 kprobes with perf_kprobe (function addr) takes 5.218255 seconds Cleaning 1000 kprobes with perf_kprobe (function addr) takes 80.010731 seconds Signed-off-by: Song Liu <songliubrav...@fb.

[PATCH v4 0/6] enable creating [k,u]probe with perf_event_open

2017-12-04 Thread Song Liu
probe bcc patch: bcc: Try use new API to create [k,u]probe with perf_event_open kernel patches: Song Liu (6): perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe perf: copy new perf_event.h to tools/include/uapi perf: implement pmu perf_kprobe perf: implement pmu perf_up

Re: [PATCH net-next 1/3] net:tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-12 Thread Song Liu
> On Dec 10, 2017, at 7:31 AM, Yafang Shao wrote: > > As sk_state is a common field for struct sock, so the state > transition should not be a TCP specific feature. > So I rename tcp_set_state tracepoint to sock_set_state tracepoint with > some minor changes and move it

Re: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open

2017-12-19 Thread Song Liu
> On Dec 8, 2017, at 11:57 AM, Daniel Borkmann <dan...@iogearbox.net> wrote: > > On 12/06/2017 11:45 PM, Song Liu wrote: >> Changes PATCH v4 to PATCH v5: >> Remove PERF_PROBE_CONFIG_IS_RETPROBE from uapi, use PMU_FORMAT_ATTR >> instead. >> >>

Re: [PATCH v2 net-next 2/4] net: tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-15 Thread Song Liu
> On Dec 15, 2017, at 9:56 AM, Yafang Shao wrote: > > As sk_state is a common field for struct sock, so the state > transition should not be a TCP specific feature. > So I rename tcp_set_state tracepoint to sock_set_state tracepoint with > some minor changes and move it

Re: [PATCH] tcp: Export to userspace the TCP state names for the trace events

2017-11-10 Thread Song Liu
> On Nov 10, 2017, at 7:07 AM, Steven Rostedt wrote: > > On Fri, 10 Nov 2017 12:56:06 +0800 > Yafang Shao wrote: > >> Could the macro tcp_state_name() be renamed ? >> If is included in include/net/tcp.h, it will > > Ideally, you don't want to

Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-11-18 Thread Song Liu
> On Nov 18, 2017, at 7:32 AM, Yafang Shao wrote: > > The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other > transitions are not traced with tcp_set_state tracepoint. > > In order to trace the whole tcp lifespans, two helpers are introduced, > void

Re: [RFC v2 0/6] enable creating [k,u]probe with perf_event_open

2017-11-13 Thread Song Liu
> On Nov 12, 2017, at 3:40 PM, Song Liu <songliubrav...@fb.com> wrote: > > Changes v1 to v2: > Fix build issue reported by kbuild test bot by adding ifdef of > CONFIG_KPROBE_EVENTS, and CONFIG_UPROBE_EVENTS. > > v1 cover letter: > > This is to follow up th

[PATCH 6/6] bpf: add new test test_many_kprobe

2017-11-15 Thread Song Liu
) takes 5.077558 seconds Cleaning 1000 kprobes with PERF_TYPE_PROBE (function name) takes 81.241354 seconds Creating 1000 kprobes with PERF_TYPE_PROBE (function addr) takes 5.218255 seconds Cleaning 1000 kprobes with PERF_TYPE_PROBE (function addr) takes 80.010731 seconds Signed-off-by: Song Liu

[PATCH 1/6] perf: Add new type PERF_TYPE_PROBE

2017-11-15 Thread Song Liu
with the pointer, we will (in the following patches) copy probe_desc to __aligned_u64 before using it as pointer. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> Acked-by: Alexei Starovoitov <a...@kernel.o

[PATCH] perf_event_open.2: add new type PERF_TYPE_PROBE

2017-11-15 Thread Song Liu
are not included in this patch. write_backward : 1 namespaces : 1 Signed-off-by: Song Liu <songliubrav...@fb.com> --- man2/perf_event_open.2 | 82 -- 1 file changed, 80 insertions(+), 2 deletions(-) diff --git

[PATCH 4/6] perf: implement uprobe support to PERF_TYPE_PROBE

2017-11-15 Thread Song Liu
-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- kernel/trace/trace_event_perf.c | 48 +- kernel/trace/trace_probe.h | 4 ++ kernel/trace/trace

[PATCH 5/6] bpf: add option for bpf_load.c to use PERF_TYPE_PROBE

2017-11-15 Thread Song Liu
Function load_and_attach() is updated to be able to create kprobes with either old text based API, or the new PERF_TYPE_PROBE API. A global flag use_perf_type_probe is added to select between the two APIs. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Josef Bacik <jba.

[PATCH 0/6] enable creating [k,u]probe with perf_event_open

2017-11-15 Thread Song Liu
6/bcc/tree/perf_event_opn Thanks, Song man-pages patch: perf_event_open.2: add new type PERF_TYPE_PROBE bcc patch: bcc: Try use new API to create [k,u]probe with perf_event_open kernel patches: Song Liu (6): perf: Add new type PERF_TYPE_PROBE perf: copy new perf_event.h to tools/include/u

[PATCH 2/6] perf: copy new perf_event.h to tools/include/uapi

2017-11-15 Thread Song Liu
perf_event.h is updated in previous patch, this patch applies same changes to the tools/ version. This is part is put in a separate patch in case the two files are back ported separately. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Review

[PATCH 3/6] perf: implement kprobe support to PERF_TYPE_PROBE

2017-11-15 Thread Song Liu
, create_local_trace_kprobe() and destroy_local_trace_kprobe() are added to created and destroy these local trace_kprobe. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- include/linux/trace_events.h|

[PATCH] bcc: Try use new API to create [k,u]probe with perf_event_open

2017-11-15 Thread Song Liu
New kernel API allows creating [k,u]probe with perf_event_open. This patch tries to use the new API. If the new API doesn't work, we fall back to old API. bpf_detach_probe() looks up the event being removed. If the event is not found, we skip the clean up procedure. Signed-off-by: Song Liu

[PATCH] tracing/probe: fix typo in pr_fmt in trace_uprobe.c

2017-11-13 Thread Song Liu
pr_fmt in trace_uprobe.c should say "trace_uprobe" instead of "trace_kprobe". Cc: Masami Hiramatsu <mhira...@kernel.org> Cc: Steven Rostedt <rost...@goodmis.org> Signed-off-by: Song Liu <songliubrav...@fb.com> --- kernel/trace/trace_uprobe.c | 2 +- 1 fi

Re: [PATCH] net/tcp: introduce TRACE_EVENT for TCP/IPv4 state transition

2017-11-09 Thread Song Liu
> On Nov 9, 2017, at 10:18 AM, Steven Rostedt wrote: > > On Thu, 9 Nov 2017 15:43:29 +0900 > Alexei Starovoitov wrote: > >>> +TRACE_EVENT(tcp_set_state, >>> + TP_PROTO(struct sock *sk, int oldstate, int newstate), >>> + TP_ARGS(sk,

Re: [PATCH] net/tcp: introduce TRACE_EVENT for TCP/IPv4 state transition

2017-11-09 Thread Song Liu
> On Nov 9, 2017, at 10:34 AM, Song Liu <songliubrav...@fb.com> wrote: > >> >> On Nov 9, 2017, at 10:18 AM, Steven Rostedt <rost...@goodmis.org> wrote: >> >> On Thu, 9 Nov 2017 15:43:29 +0900 >> Alexei Starovoitov <alexei.starovoi...@gm

Re: [PATCH] tcp: Export to userspace the TCP state names for the trace events

2017-11-09 Thread Song Liu
ate_name(TCP_SYN_RECV), \ > - tcp_state_name(TCP_FIN_WAIT1), \ > - tcp_state_name(TCP_FIN_WAIT2), \ > - tcp_state_name(TCP_TIME_WAIT), \ > - tcp_state_name(TCP_CLOSE), \ > - tcp_state_name(TCP_CLOSE_WAIT), \ > - tcp_state_name(TCP_LAST_ACK), \ > - tcp_state_name(TCP_LISTEN), \ > - tcp_state_name(TCP_CLOSING),\ > - tcp_state_name(TCP_NEW_SYN_RECV)) > + __print_symbolic(val, tcp_state_names) > > /* > * tcp event with arguments sk and skb > -- > 2.13.6 > Reviewed-and-tested-by: Song Liu <songliubrav...@fb.com>

[PATCH v5] perf_event_open.2: add type kprobe and uprobe

2017-12-06 Thread Song Liu
Two new types kprobe and uprobe are being added to perf_event_open, which allow creating kprobe or uprobe with perf_event_open. This patch adds information about these types. Signed-off-by: Song Liu <songliubrav...@fb.com> --- man2/perf_event_open.

[PATCH v5 2/6] perf: copy new perf_event.h to tools/include/uapi

2017-12-06 Thread Song Liu
perf_event.h is updated in previous patch, this patch applies same changes to the tools/ version. This is part is put in a separate patch in case the two files are back ported separately. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Review

[PATCH v5 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe

2017-12-06 Thread Song Liu
to union config1 for pointers to function name for kprobe or binary path for uprobe. kprobe_addr and probe_offset are added to union config2 for kernel address (when kprobe_func is NULL), or [k,u]probe offset. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y.

[PATCH v5 6/6] bpf: add new test test_many_kprobe

2017-12-06 Thread Song Liu
5.077558 seconds Cleaning 1000 kprobes with perf_kprobe (function name) takes 81.241354 seconds Creating 1000 kprobes with perf_kprobe (function addr) takes 5.218255 seconds Cleaning 1000 kprobes with perf_kprobe (function addr) takes 80.010731 seconds Signed-off-by: Song Liu <songliubrav...@fb.

[PATCH v5 3/6] perf: implement pmu perf_kprobe

2017-12-06 Thread Song Liu
() and destroy_local_trace_kprobe() are added to created and destroy these local trace_kprobe. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Yonghong Song <y...@fb.com> Reviewed-by: Josef Bacik <jba...@fb.com> --- include/linux/trace_events.h| 4 ++ kernel/events/core

[PATCH v5 5/6] bpf: add option for bpf_load.c to use perf_kprobe

2017-12-06 Thread Song Liu
Function load_and_attach() is updated to be able to create kprobes with either old text based API, or the new perf_event_open API. A global flag use_perf_kprobe is added to select between the two APIs. Signed-off-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Josef Bacik <jba.

[PATCH v5 0/6] enable creating [k,u]probe with perf_event_open

2017-12-06 Thread Song Liu
m/liu-song-6/bcc/tree/perf_event_open Thanks, Song man-pages patch: perf_event_open.2: add type kprobe and uprobe bcc patch: bcc: Try use new API to create [k,u]probe with perf_event_open kernel patches: Song Liu (6): perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe

[PATCH v5 4/6] perf: implement pmu perf_uprobe

2017-12-06 Thread Song Liu
This patch adds perf_uprobe support with similar pattern as previous patch (for kprobe). Two functions, create_local_trace_uprobe() and destroy_local_trace_uprobe(), are created so a uprobe can be created and attached to the file descriptor created by perf_event_open(). Signed-off-by: Song Liu

[PATCH v5] bcc: Try use new API to create [k,u]probe with perf_event_open

2017-12-06 Thread Song Liu
New kernel API allows creating [k,u]probe with perf_event_open. This patch tries to use the new API. If the new API doesn't work, we fall back to old API. bpf_detach_probe() looks up the event being removed. If the event is not found, we skip the clean up procedure. Signed-off-by: Song Liu

Re: [PATCH v5 3/6] perf: implement pmu perf_kprobe

2017-12-20 Thread Song Liu
> On Dec 20, 2017, at 2:14 AM, Peter Zijlstra <pet...@infradead.org> wrote: > > On Wed, Dec 20, 2017 at 11:03:01AM +0100, Peter Zijlstra wrote: >> On Wed, Dec 06, 2017 at 02:45:15PM -0800, Song Liu wrote: >>> @@ -8537,7 +8620,7 @@ static int perf_event_set_filter

[RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-04 Thread Song Liu
This patch tries to enable PMU sharing. To make perf event scheduling fast, we use special data structures. An array of "struct perf_event_dup" is added to the cpuctx, to remember all the duplicated events under this cpuctx. All the events under this cpuctx has a "dup_id" pointing to its

[RFC 0/2] perf: Sharing PMU counters across compatible events

2018-05-04 Thread Song Liu
direction of PMU counter sharing? Thanks in advance. Song Song Liu (2): perf: add move_dup() for PMU sharing. perf: Sharing PMU counters across compatible events arch/x86/events/core.c | 8 ++ include/linux/perf_event.h | 57 + include/linux/trace_events.h| 3

[RFC 1/2] perf: add move_dup() for PMU sharing.

2018-05-04 Thread Song Liu
To share PMU across different counters, we need a "master event" that handles interaction with hardware or other software parts. It is necessary to switch master event to another event. To make this move compatible with the PMU, it is necessary to move connection or data from one perf_event to

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-20 Thread Song Liu
On Thu, May 17, 2018 at 10:31 AM, William Kucharski wrote: > > >> On May 17, 2018, at 9:23 AM, Matthew Wilcox wrote: >> >> I'm certain it is. The other thing I believe is true that we should be >> able to share page tables (my motivation is

[PATCH] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-21 Thread Song Liu
l not call khugepaged_enter(). This patch fixes these problems by reusing hugepage_vma_check() in khugepaged_enter_vma_merge(). Signed-off-by: Song Liu <songliubrav...@fb.com> --- mm/khugepaged.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mm/khugepaged.c b

[PATCH v2] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-22 Thread Song Liu
ge(). vma->vm_flags is not yet updated in khugepaged_enter_vma_merge(), so we need to pass the new vm_flags to hugepage_vma_check() through a separate argument. Signed-off-by: Song Liu <songliubrav...@fb.com> --- mm/khugepaged.c | 26 -- 1 file changed, 12 inserti

Re: [PATCH] perf: fix group with mixed hw and sw events

2018-05-22 Thread Song Liu
Dear Peter, Could you please share your comments on this minor fix? Best, Song > On May 3, 2018, at 12:47 PM, Song Liu <songliubrav...@fb.com> wrote: > > When hw and sw events are mixed in the same group, they are all attached > to the hw perf_event_context. This sometim

Re: [PATCH] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-22 Thread Song Liu
On May 22, 2018, at 5:13 AM, Michal Hocko <mho...@kernel.org> wrote: > > [CC Kirill] > > On Mon 21-05-18 12:38:53, Song Liu wrote: >> khugepaged_enter_vma_merge() is using a different approach to check >> whether a vma is valid for khugepaged_enter()

Re: [PATCH 2/2] perf/core: fix bad use of igrab in kernel/event/core.c

2018-05-22 Thread Song Liu
> On Apr 18, 2018, at 11:17 PM, Alexander Shishkin > <alexander.shish...@linux.intel.com> wrote: > > On Tue, Apr 17, 2018 at 11:29:07PM -0700, Song Liu wrote: >> As Miklos reported and suggested: >> >> This pattern repeats two times in trace_uprobe.c and

Re: WARNING and PANIC in irq_matrix_free

2018-05-25 Thread Song Liu
Hi, We are seeing something probably related. We run ethtool on a system with Broadcom NIC to increase number of combined queues. [root@ ~]# ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 9 TX: 8 Other: 0

Re: WARNING and PANIC in irq_matrix_free

2018-05-25 Thread Song Liu
Adding Broadcom developers to the thread. Hi Michael, Vasundhara, and Andy, Could you please help look into the case I found? ethtool crashes the system for both net/master and net-next/master. Thanks, Song On Fri, May 25, 2018 at 1:10 PM, Song Liu <liu.song@gmail.com> wrote: > H

Re: [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning

2018-05-25 Thread Song Liu
olve_sink(const struct > btf_verifier_env *env, > !btf_type_is_array(next_type) && > !btf_type_is_struct(next_type); > default: > - BUG_ON(1); > + BUG(); > } > } > > -- > 2.9.0 > Acked-by: Song Liu <songliubrav...@fb.com>

Re: [PATCH, net-next 2/2] bpf: avoid -Wmaybe-uninitialized warning

2018-05-25 Thread Song Liu
ILD_ID_VALID; > } > > - if (!in_nmi_ctx) { > + if (!work) { > up_read(>mm->mmap_sem); > } else { > work->sem = >mm->mmap_sem; > -- > 2.9.0 > Acked-by: Song Liu <songliubrav...@fb.com>

Re: [PATCH v2 net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-25 Thread Song Liu
> On May 25, 2018, at 3:14 AM, Yafang Shao <laoar.s...@gmail.com> wrote: > > skb->len is meaningless to user. > data length could be more helpful, with which we can easily filter out > the packet without payload. > > Signed-off-by: Yafang Shao <laoar.s.

Re: [PATCH net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-24 Thread Song Liu
> On May 24, 2018, at 5:48 AM, Yafang Shao wrote: > > skb->len is meaningless to user. > data length could be more helpful, with which we can easily filter out > the packet without payload. > > Signed-off-by: Yafang Shao > --- >

[PATCH] perf: Sharing PMU counters across compatible events

2018-06-08 Thread Song Liu
vent_dup. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 ++ kernel/events/core.c | 284 +++-- 2 files changed, 335 insertions(+), 10 deletions(-) diff -

[PATCH] perf: Sharing PMU counters across compatible events

2018-06-08 Thread Song Liu
cleaner. This version has been stable in my tests. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Song Liu (1): perf: Sharing PMU counters across compatible events include/linux/perf_event.h | 61 ++ kernel/events/core.c | 284

Re: WARNING and PANIC in irq_matrix_free

2018-05-28 Thread Song Liu
> On May 28, 2018, at 7:27 AM, Thomas Gleixner wrote: > > On Mon, 28 May 2018, Tariq Toukan wrote: >> On 28/05/2018 1:53 PM, Thomas Gleixner wrote: >>> On Fri, 25 May 2018, Song Liu wrote: >>>> On Wed, May 23, 2018 at 1:49 AM, Thomas Gleixner >>

[PATCH v3] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-28 Thread Song Liu
ge(). vma->vm_flags is not yet updated in khugepaged_enter_vma_merge(), so we need to pass the new vm_flags to hugepage_vma_check() through a separate argument. Signed-off-by: Song Liu --- mm/khugepaged.c | 53 - 1 file changed, 24 inse

Re: [RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-28 Thread Song Liu
> On May 28, 2018, at 4:15 AM, Peter Zijlstra wrote: > > On Fri, May 04, 2018 at 04:11:02PM -0700, Song Liu wrote: >> Connection among perf_event and perf_event_dup are built with function >> rebuild_event_dup_list(cpuctx). This function is only called when events >>

Re: [PATCH v2] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-28 Thread Song Liu
> On May 28, 2018, at 3:57 AM, Kirill A. Shutemov wrote: > > On Tue, May 22, 2018 at 12:44:30PM -0700, Song Liu wrote: >> khugepaged_enter_vma_merge() is using a different approach to check >> whether a vma is valid for khugepaged_enter(): >>

Re: [RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-28 Thread Song Liu
On May 28, 2018, at 4:24 AM, Peter Zijlstra wrote: > > On Fri, May 04, 2018 at 04:11:02PM -0700, Song Liu wrote: >> On the critical paths, perf_events are added to/removed from the >> active_dup list of the perf_event. The first event added to the list >> will be the ma

Re: WARNING and PANIC in irq_matrix_free

2018-05-28 Thread Song Liu
> On May 28, 2018, at 3:53 AM, Thomas Gleixner wrote: > > On Fri, 25 May 2018, Song Liu wrote: >> On Wed, May 23, 2018 at 1:49 AM, Thomas Gleixner wrote: >>> On Wed, 23 May 2018, Tariq Toukan wrote: >>>> I have your patch merged into my inte

Re: [PATCH bpf 2/2] bpf: enforce usage of __aligned_u64 in the UAPI header

2018-05-29 Thread Song Liu
On Sun, May 27, 2018 at 4:28 AM, Eugene Syromiatnikov wrote: > Use __aligned_u64 instead of __u64 everywhere in the UAPI header, > similarly to v4.17-rc1~94^2~58^2 "RDMA: Change all uapi headers to use > __aligned_u64 instead of __u64". > > This commit doesn't change structure layouts, but

Re: [patch 3/8] x86/apic: Provide apic_ack_irq()

2018-06-05 Thread Song Liu
. > > Reuse the new function in apic_ack_edge(). > > Preparatory change for the real fix > > Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup") > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org Tested-by: Song Liu > --- > arch/x86/i

Re: [patch 6/8] x86/platform/uv: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 5/8] x86/ioapic: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 4/8] irq_remapping: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 7/8] genirq/affinity: Defer affinity setting if irq chip is busy

2018-06-05 Thread Song Liu
cfe3147b42 ("x86/vector: Simplify vector move cleanup") > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org Tested-by: Song Liu > --- > kernel/irq/manage.c | 37 +++-- > 1 file changed, 35 insertions(+), 2 deletions(-) > &g

Re: [patch 2/8] genirq/generic_pending: Do not lose pending affinity update

2018-06-05 Thread Song Liu
t; > Check the return value of irq_do_set_affinity() for -EBUSY, which indicates > a pending cleanup, and rearm the pending move in the irq dexcriptor so it's > tried again when the next interrupt arrives. > > Fixes: 996c591227d9 ("x86/irq: Plug vector cleanup race") > Signed-off-by: Thomas

Re: [patch 1/8] x86/apic/vector: Prevent hlist corruption and leaks

2018-06-05 Thread Song Liu
llow up patches. > > Fixes: 69cde0004a4b ("x86/vector: Use matrix allocator for vector assignment") > Reported-by: Dmitry Safonov <0x7f454...@gmail.com> > Reported-by: Tariq Toukan > Reported-by: Song Liu > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org

Re: WARNING and PANIC in irq_matrix_free

2018-05-29 Thread Song Liu
> On May 29, 2018, at 1:35 AM, Thomas Gleixner wrote: > > On Mon, 28 May 2018, Song Liu wrote: >>> On May 28, 2018, at 1:09 PM, Thomas Gleixner wrote: >>> >>> On Mon, 28 May 2018, Song Liu wrote: >>>> This doesn't fix the issue with bnxt.

Re: [PATCH] x86,switch_mm: skip atomic operations for init_mm

2018-06-02 Thread Song Liu
> On Jun 2, 2018, at 1:14 PM, Andy Lutomirski wrote: > > On Fri, Jun 1, 2018 at 10:04 PM Rik van Riel wrote: >> >> On Fri, 2018-06-01 at 20:35 -0700, Andy Lutomirski wrote: >>> On Fri, Jun 1, 2018 at 3:13 PM Rik van Riel wrote: On Fri, 1 Jun 2018 14:21:58 -0700 Andy

Re: [PATCH] perf: Sharing PMU counters across compatible events

2018-06-25 Thread Song Liu
Dear Peter, Could you please share you feedbacks/comments on this work? Thanks, Song On Fri, Jun 8, 2018 at 3:47 PM, Song Liu wrote: > This patch tries to enable PMU sharing. To make perf event scheduling > fast, we use special data structures. > > An array of "struct perf_ev

Re: linux-next: manual merge of the bpf-next tree with the bpf tree

2018-05-02 Thread Song Liu
> On May 1, 2018, at 10:50 PM, Stephen Rothwell <s...@canb.auug.org.au> wrote: > > Hi Song, > > On Wed, 2 May 2018 04:40:20 + Song Liu <songliubrav...@fb.com> wrote: >> >>> - CHECK(build_id_matches < 1, "build id match", >

Re: linux-next: manual merge of the bpf-next tree with the bpf tree

2018-05-01 Thread Song Liu
> On May 1, 2018, at 7:09 PM, Stephen Rothwell wrote: > > Hi all, > > Today's linux-next merge of the bpf-next tree got a conflict in: > > tools/testing/selftests/bpf/test_progs.c > > between commit: > > a4e21ff8d9a3 ("bpf: minor fix to selftest

[PATCH] perf: fix group with mixed hw and sw events

2018-05-03 Thread Song Liu
r Zijlstra <pet...@infradead.org> Signed-off-by: Song Liu <songliubrav...@fb.com> --- include/linux/perf_event.h | 8 kernel/events/core.c | 21 +++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/linux/perf_event.h b/incl

Re: [PATCH net-next] net: tracepoint: adding new tracepoint arguments in inet_sock_set_state

2018-01-06 Thread Song Liu
> On Jan 5, 2018, at 12:09 AM, Yafang Shao <laoar.s...@gmail.com> wrote: > > On Fri, Jan 5, 2018 at 3:21 PM, Song Liu <songliubrav...@fb.com> wrote: >> >>> On Jan 4, 2018, at 10:42 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >>> >>>

Re: [PATCH v2 net-next] net: tracepoint: exposing sk_faimily in tracepoint inet_sock_set_state

2018-01-07 Thread Song Liu
do the filter. > > Both sk_family and sk_protocol are showed in the printk message, so we need > not expose them as tracepoint arguments. > > Suggested-by: Brendan Gregg <brendan.d.gr...@gmail.com> > Suggested-by: Song Liu <songliubrav...@fb.com> > Signed-off-by: Yafang

Re: [PATCH net-next] net: tracepoint: adding new tracepoint arguments in inet_sock_set_state

2018-01-04 Thread Song Liu
> On Jan 4, 2018, at 10:42 PM, Yafang Shao wrote: > > sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments. > Then we can conveniently use these two arguments to do the filter. > > Suggested-by: Brendan Gregg > Signed-off-by:

  1   2   3   4   5   6   7   8   9   10   >