> > Remove use of ipv6_pinfo in favor of data in sock_common.
> >
> > Fixes: e086101b150a ("tcp: add a tracepoint for tcp retransmission")
> > Signed-off-by: David Ahern <dsah...@gmail.com>
> > ---
>
> Reviewed-by: Eric Dumazet <edum
;> Signed-off-by: David Ahern <dsah...@gmail.com>
>> ---
>
> Reviewed-by: Eric Dumazet <eduma...@google.com>
>
> Thanks !
>
Tested-by: Song Liu <songliubrav...@fb.com>
> 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
: 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
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
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.
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
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(+)
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
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.
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:
() 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
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.
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.
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
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
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
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.
) 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
, 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|
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
> 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
+{
> + 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>
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
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.
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.
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.
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
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
() 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
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.
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
> 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.
>>
>>
t access")
Signed-off-by: Song Liu <songliubrav...@fb.com>
Acked-by: Martin KaFai Lau <ka...@fb.com>
Cc: Daniel Borkmann <dan...@iogearbox.net>
Cc: Alexei Starovoitov <a...@kernel.org>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/
> 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
> 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
> 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
> 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
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
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
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
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.
-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
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
, 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|
) 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
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
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
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
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
, 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|
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
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.
) 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
ry 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/uapi
perf: implement kprobe support to PERF_TYPE_PROBE
perf: implement uprobe support to PERF_TYPE_PROBE
bpf:
-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
> 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,
> 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
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>
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
, 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|
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.
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
ub.com/liu-song-6/bcc/tree/new_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.
-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 | 33 ++-
kernel/trace/trace_probe.h | 4 ++
kernel/trace/trace_uprobe.c | 90 ++
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
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
) 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
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
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.
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
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.
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.
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.
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
() 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
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
CCing key audience of the patch.
Thanks,
Song
> On Oct 24, 2017, at 4:57 PM, Song Liu <songliubrav...@fb.com> wrote:
>
> This tracepoint can be used to trace synack retransmits. It maintains
> pointer to struct request_sock.
>
> We cannot simply reuse trace_tcp_retran
This tracepoint can be used to trace synack retransmits. It maintains
pointer to struct request_sock.
We cannot simply reuse trace_tcp_retransmit_skb() here, because the
sk here is the LISTEN socket. The IP addresses and ports should be
extracted from struct request_sock.
Signed-off-by: Song Liu
New tracepoint trace_tcp_send_reset is added and called from
tcp_v4_send_reset(), tcp_v6_send_reset() and tcp_send_active_reset().
Signed-off-by: Song Liu <songliubrav...@fb.com>
---
include/trace/events/tcp.h | 11 +++
net/ipv4/tcp_ipv4.c| 6 +-
net/ipv4/tcp_ou
Some functions that we plan to add trace points require const sk
and/or skb. So we mark these fields as const in the tracepoint.
Signed-off-by: Song Liu <songliubrav...@fb.com>
---
include/trace/events/tcp.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/i
This patch adds tracepoint trace_tcp_set_state. Besides usual fields
(s/d ports, IP addresses), old and new state of the socket is also
printed with TP_printk, with __print_symbolic().
Signed-off-by: Song Liu <songliubrav...@fb.com>
---
include/trace/events/tcp.
Introduce event class tcp_event_sk_skb for tcp tracepoints that
have arguments sk and skb.
Existing tracepoint trace_tcp_retransmit_skb() falls into this class.
This patch rewrites the definition of trace_tcp_retransmit_skb() with
tcp_event_sk_skb.
Signed-off-by: Song Liu <songliubrav...@fb.
New tracepoint trace_tcp_receive_reset is added and called from
tcp_reset(). This tracepoint is define with a new class tcp_event_sk.
Signed-off-by: Song Liu <songliubrav...@fb.com>
---
include/trace/events/tcp.h | 66 ++
net/ipv4/tcp_i
This patch adds trace event trace_tcp_destroy_sock.
Signed-off-by: Song Liu <songliubrav...@fb.com>
---
include/trace/events/tcp.h | 7 +++
net/ipv4/tcp_ipv4.c| 2 ++
2 files changed, 9 insertions(+)
diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index c
kprobe__tcp_v4_destroy_sock
int kprobe__tcp_set_state
int kprobe__tcp_retransmit_skb
These tracepoints will help us simplify this work.
Thanks,
Song
Song Liu (6):
tcp: add trace event class tcp_event_sk_skb
tcp: mark trace event arguments sk and skb as const
tcp: add tracepoint
017, at 2:20 PM, Song Liu <songliubrav...@fb.com> wrote:
>
> Resending the patch set as there were something wrong with my email
> server.
>
> These patches add the following tracepoints to tcp stack.
>
> tcp_send_reset
> tcp_receive_reset
> tcp_destroy_sock
> t
CCing key audience of the patch.
Thanks,
Song
> On Oct 30, 2017, at 2:41 PM, Song Liu <songliubrav...@fb.com> wrote:
>
> This tracepoint can be used to trace synack retransmits. It maintains
> pointer to struct request_sock.
>
> We cannot simply reuse trace_tcp_retran
Change from v1: Updated commit message to highlight potential sparse warning.
Song Liu (1):
tcp: add tracepoint trace_tcp_retransmit_synack()
include/trace/events/tcp.h | 56 ++
net/ipv4/tcp_output.c | 1 +
2 files changed, 57 insertions
these warnings. To the
best of our knowledge, these warnings are harmless.
Signed-off-by: Song Liu <songliubrav...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Martin KaFai Lau <ka...@fb.com>
---
include/trace/events/tcp.h | 56 ++
> 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
Thanks Tobin. I will fold these changes in.
> On May 3, 2018, at 12:19 AM, Tobin C. Harding <to...@apporbit.com> wrote:
>
> On Wed, May 02, 2018 at 04:20:30PM -0700, Song Liu wrote:
>> This new test captures stackmap with build_id with hardware event
>> PERF_COUNT_HW
int test_num)
> goto done;
> }
>
> - user_btf_size = (int)raw_btf_size + test->info_size_delta;
> + user_btf_size = (int)raw_btf_size + test->btf_size_delta;
> expected_nbytes = min(raw_btf_size, user_btf_size);
> if (raw_btf_size > expected_nbytes)
> memset(user_btf + expected_nbytes, 0xff,
> raw_btf_size - expected_nbytes);
>
> - err = bpf_obj_get_info_by_fd(btf_fd, user_btf, _btf_size);
> - if (CHECK(err || user_btf_size != raw_btf_size ||
> - memcmp(raw_btf, user_btf, expected_nbytes),
> - "err:%d(errno:%d) raw_btf_size:%u user_btf_size:%u
> expected_nbytes:%u memcmp:%d",
> - err, errno,
> - raw_btf_size, user_btf_size, expected_nbytes,
> - memcmp(raw_btf, user_btf, expected_nbytes))) {
> + info_len = sizeof(info);
> + info.btf = ptr_to_u64(user_btf);
> + info.btf_size = user_btf_size;
> +
> + ret = 0;
> + err = bpf_obj_get_info_by_fd(btf_fd, , _len);
> + if (CHECK(err || !info.id || info_len != sizeof(info) ||
> + info.btf_size != raw_btf_size ||
> + (ret = memcmp(raw_btf, user_btf, expected_nbytes)),
> + "err:%d errno:%d info.id:%u info_len:%u sizeof(info):%lu
> raw_btf_size:%u info.btf_size:%u expected_nbytes:%u memcmp:%d",
> + err, errno, info.id, info_len, sizeof(info),
> + raw_btf_size, info.btf_size, expected_nbytes, ret)) {
> err = -1;
> goto done;
> }
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
f(expected_line),
> + "expected_line is too long")) {
> err = -1;
> - fprintf(stderr, "expected_line is too long\n");
> goto done;
> }
>
> @@ -1535,15 +1524,15 @@ static int test_pprint(void)
> nread = getline(, _len, pin_file);
> } while (++key < test->max_entries && nread > 0);
>
> - if (key < test->max_entries) {
> + if (CHECK(key < test->max_entries,
> + "Unexpected EOF. key:%u test->max_entries:%u",
> + key, test->max_entries)) {
> err = -1;
> - fprintf(stderr, "Unexpected EOF\n");
> goto done;
> }
>
> - if (nread > 0) {
> + if (CHECK(nread > 0, "Unexpected extra pprint output: %s", line)) {
> err = -1;
> - fprintf(stderr, "Unexpected extra pprint output: %s\n", line);
> goto done;
> }
>
> @@ -1551,9 +1540,9 @@ static int test_pprint(void)
>
> done:
> if (!err)
> - fprintf(stderr, "OK\n");
> + fprintf(stderr, "OK");
> if (*btf_log_buf && (err || args.always_log))
> - fprintf(stderr, "%s\n", btf_log_buf);
> + fprintf(stderr, "\n%s", btf_log_buf);
> if (btf_fd != -1)
> close(btf_fd);
> if (map_fd != -1)
> @@ -1634,6 +1623,12 @@ static int parse_args(int argc, char **argv)
> return 0;
> }
>
> +static void print_summary(void)
> +{
> + fprintf(stderr, "PASS:%u SKIP:%u FAIL:%u\n",
> + pass_cnt - skip_cnt, skip_cnt, error_cnt);
> +}
> +
> int main(int argc, char **argv)
> {
> int err = 0;
> @@ -1655,15 +1650,17 @@ int main(int argc, char **argv)
> err |= test_file();
>
> if (args.pprint_test)
> - err |= test_pprint();
> + err |= count_result(test_pprint());
>
> if (args.raw_test || args.get_info_test || args.file_test ||
> args.pprint_test)
> - return err;
> + goto done;
>
> err |= test_raw();
> err |= test_get_info();
> err |= test_file();
>
> +done:
> + print_summary();
> return err;
> }
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
info.btf_value_id = map->btf_value_id;
> + }
> +
> if (bpf_map_is_dev_bound(map)) {
> err = bpf_map_offload_info_fill(, map);
> if (err)
> @@ -2057,6 +2063,19 @@ static int bpf_btf_load(const union bpf_attr *attr)
> return btf_new_fd(attr);
> }
>
> +#define BPF_BTF_GET_FD_BY_ID_LAST_FIELD btf_id
> +
> +static int bpf_btf_get_fd_by_id(const union bpf_attr *attr)
> +{
> + if (CHECK_ATTR(BPF_BTF_GET_FD_BY_ID))
> + return -EINVAL;
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
> + return btf_get_fd_by_id(attr->btf_id);
> +}
> +
> SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int,
> size)
> {
> union bpf_attr attr = {};
> @@ -2140,6 +2159,9 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *,
> uattr, unsigned int, siz
> case BPF_BTF_LOAD:
> err = bpf_btf_load();
> break;
> + case BPF_BTF_GET_FD_BY_ID:
> + err = bpf_btf_get_fd_by_id();
> + break;
> default:
> err = -EINVAL;
> break;
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
env_free(env);
> - btf_get(btf);
> + refcount_set(>refcnt, 1);
> return btf;
> }
>
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
r);
> +}
> +
> #define BPF_OBJ_GET_INFO_BY_FD_LAST_FIELD info.info
>
> static int bpf_obj_get_info_by_fd(const union bpf_attr *attr,
> @@ -2042,7 +2057,7 @@ static int bpf_obj_get_info_by_fd(const union bpf_attr
> *attr,
> err = bpf_map_get_info_by_fd(f.file->private_data, attr,
>uattr);
> else if (f.file->f_op == _fops)
> - err = btf_get_info_by_fd(f.file->private_data, attr, uattr);
> + err = bpf_btf_get_info_by_fd(f.file->private_data, attr, uattr);
> else
> err = -EINVAL;
>
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
ed_u64 btf;
> + __u32 btf_size;
> + __u32 id;
> } __attribute__((aligned(8)));
>
> /* User bpf_sock_addr struct to access socket fields and sockaddr struct
> passed
> --
> 2.9.5
>
Acked-by: Song Liu <songliubrav...@fb.com>
riable for the irq_work. As a result, only
one irq_work per cpu is allowed. If the irq_work is in-use, we
fallback to only report ips.
Cc: Alexei Starovoitov <a...@kernel.org>
Cc: Daniel Borkmann <dan...@iogearbox.net>
Cc: Peter Zijlstra <pet...@infradead.org>
Signed-off-by: Song Liu <songl
dd static to DEFINE_PER_CPU();
5. Remove pr_info() in stack_map_init().
Song Liu (2):
bpf: enable stackmap with build_id in nmi context
bpf: add selftest for stackmap with build_id in NMI context
init/Kconfig | 1 +
kernel/bpf/stackmap.c
1 - 100 of 360 matches
Mail list logo