Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1566263 > unrolled thread
| Started by | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| First post | 2017-01-25 02:30 +0100 |
| Last post | 2017-01-25 19:20 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/3] BPF tracepoints Daniel Borkmann <daniel@iogearbox.net> - 2017-01-25 02:30 +0100
[PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq Daniel Borkmann <daniel@iogearbox.net> - 2017-01-25 02:30 +0100
Re: [PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-01-26 21:00 +0100
Re: [PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq Daniel Borkmann <daniel@iogearbox.net> - 2017-01-26 21:50 +0100
Re: [PATCH net-next 0/3] BPF tracepoints David Miller <davem@davemloft.net> - 2017-01-25 19:20 +0100
| From | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| Date | 2017-01-25 02:30 +0100 |
| Subject | [PATCH net-next 0/3] BPF tracepoints |
| Message-ID | <t3kzn-3xe-3@gated-at.bofh.it> |
This set adds tracepoints to BPF for better introspection and debugging. The first two patches are prerequisite for the actual third patch that adds the tracepoints. I think the first two are small and straight forward enough that they could ideally go via net-next, but I'm also open to other suggestions on how to route them in case that's not applicable (it would reduce potential merge conflicts on BPF side, though). For details, please see individual patches. Thanks a lot! Daniel Borkmann (3): trace: add variant without spacing in trace_print_hex_seq lib, traceevent: add PRINT_HEX_STR variant bpf: add initial bpf tracepoints drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 + drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 12 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 15 +- drivers/net/ethernet/qlogic/qede/qede_fp.c | 4 + drivers/net/virtio_net.c | 12 +- include/linux/bpf_trace.h | 7 + include/linux/trace_events.h | 3 +- include/trace/events/bpf.h | 347 +++++++++++++++++++++ include/trace/events/xdp.h | 53 ++++ include/trace/trace_events.h | 8 +- kernel/bpf/core.c | 9 + kernel/bpf/inode.c | 17 +- kernel/bpf/syscall.c | 19 +- kernel/trace/trace_output.c | 7 +- tools/lib/traceevent/event-parse.c | 34 +- tools/lib/traceevent/event-parse.h | 1 + .../perf/util/scripting-engines/trace-event-perl.c | 1 + .../util/scripting-engines/trace-event-python.c | 1 + 18 files changed, 530 insertions(+), 23 deletions(-) create mode 100644 include/linux/bpf_trace.h create mode 100644 include/trace/events/bpf.h create mode 100644 include/trace/events/xdp.h -- 1.9.3
[toc] | [next] | [standalone]
| From | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| Date | 2017-01-25 02:30 +0100 |
| Subject | [PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq |
| Message-ID | <t3kzn-3xe-15@gated-at.bofh.it> |
| In reply to | #1566263 |
For upcoming tracepoint support for BPF, we want to dump the program's
tag. Format should be similar to __print_hex(), but without spacing.
Add a __print_hex_str() variant for exactly that purpose that reuses
trace_print_hex_seq().
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
include/linux/trace_events.h | 3 ++-
include/trace/trace_events.h | 8 +++++++-
kernel/trace/trace_output.c | 7 ++++---
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index be00761..cfa475a 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -33,7 +33,8 @@ const char *trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr,
unsigned int bitmask_size);
const char *trace_print_hex_seq(struct trace_seq *p,
- const unsigned char *buf, int len);
+ const unsigned char *buf, int len,
+ bool spacing);
const char *trace_print_array_seq(struct trace_seq *p,
const void *buf, int count,
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index 467e12f..9f68462 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -297,7 +297,12 @@
#endif
#undef __print_hex
-#define __print_hex(buf, buf_len) trace_print_hex_seq(p, buf, buf_len)
+#define __print_hex(buf, buf_len) \
+ trace_print_hex_seq(p, buf, buf_len, true)
+
+#undef __print_hex_str
+#define __print_hex_str(buf, buf_len) \
+ trace_print_hex_seq(p, buf, buf_len, false)
#undef __print_array
#define __print_array(array, count, el_size) \
@@ -711,6 +716,7 @@
#undef __print_flags
#undef __print_symbolic
#undef __print_hex
+#undef __print_hex_str
#undef __get_dynamic_array
#undef __get_dynamic_array_len
#undef __get_str
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 5d33a73..30a144b1 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -163,14 +163,15 @@ enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter)
EXPORT_SYMBOL_GPL(trace_print_bitmask_seq);
const char *
-trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
+trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len,
+ bool spacing)
{
int i;
const char *ret = trace_seq_buffer_ptr(p);
for (i = 0; i < buf_len; i++)
- trace_seq_printf(p, "%s%2.2x", i == 0 ? "" : " ", buf[i]);
-
+ trace_seq_printf(p, "%s%2.2x", !spacing || i == 0 ? "" : " ",
+ buf[i]);
trace_seq_putc(p, 0);
return ret;
--
1.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-01-26 21:00 +0100 |
| Subject | Re: [PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq |
| Message-ID | <t3Yn8-30B-7@gated-at.bofh.it> |
| In reply to | #1566264 |
Em Wed, Jan 25, 2017 at 02:28:16AM +0100, Daniel Borkmann escreveu:
> For upcoming tracepoint support for BPF, we want to dump the program's
> tag. Format should be similar to __print_hex(), but without spacing.
> Add a __print_hex_str() variant for exactly that purpose that reuses
> trace_print_hex_seq().
Steven should be back to his side of the wall soon, will wait for his
Ack, ok?
- Arnaldo
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> include/linux/trace_events.h | 3 ++-
> include/trace/trace_events.h | 8 +++++++-
> kernel/trace/trace_output.c | 7 ++++---
> 3 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index be00761..cfa475a 100644
> --- a/include/linux/trace_events.h
> +++ b/include/linux/trace_events.h
> @@ -33,7 +33,8 @@ const char *trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr,
> unsigned int bitmask_size);
>
> const char *trace_print_hex_seq(struct trace_seq *p,
> - const unsigned char *buf, int len);
> + const unsigned char *buf, int len,
> + bool spacing);
>
> const char *trace_print_array_seq(struct trace_seq *p,
> const void *buf, int count,
> diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
> index 467e12f..9f68462 100644
> --- a/include/trace/trace_events.h
> +++ b/include/trace/trace_events.h
> @@ -297,7 +297,12 @@
> #endif
>
> #undef __print_hex
> -#define __print_hex(buf, buf_len) trace_print_hex_seq(p, buf, buf_len)
> +#define __print_hex(buf, buf_len) \
> + trace_print_hex_seq(p, buf, buf_len, true)
> +
> +#undef __print_hex_str
> +#define __print_hex_str(buf, buf_len) \
> + trace_print_hex_seq(p, buf, buf_len, false)
>
> #undef __print_array
> #define __print_array(array, count, el_size) \
> @@ -711,6 +716,7 @@
> #undef __print_flags
> #undef __print_symbolic
> #undef __print_hex
> +#undef __print_hex_str
> #undef __get_dynamic_array
> #undef __get_dynamic_array_len
> #undef __get_str
> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> index 5d33a73..30a144b1 100644
> --- a/kernel/trace/trace_output.c
> +++ b/kernel/trace/trace_output.c
> @@ -163,14 +163,15 @@ enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter)
> EXPORT_SYMBOL_GPL(trace_print_bitmask_seq);
>
> const char *
> -trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
> +trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len,
> + bool spacing)
> {
> int i;
> const char *ret = trace_seq_buffer_ptr(p);
>
> for (i = 0; i < buf_len; i++)
> - trace_seq_printf(p, "%s%2.2x", i == 0 ? "" : " ", buf[i]);
> -
> + trace_seq_printf(p, "%s%2.2x", !spacing || i == 0 ? "" : " ",
> + buf[i]);
> trace_seq_putc(p, 0);
>
> return ret;
> --
> 1.9.3
[toc] | [prev] | [next] | [standalone]
| From | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| Date | 2017-01-26 21:50 +0100 |
| Subject | Re: [PATCH net-next 1/3] trace: add variant without spacing in trace_print_hex_seq |
| Message-ID | <t3Z9w-3wx-15@gated-at.bofh.it> |
| In reply to | #1567673 |
On 01/26/2017 08:53 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Jan 25, 2017 at 02:28:16AM +0100, Daniel Borkmann escreveu: >> For upcoming tracepoint support for BPF, we want to dump the program's >> tag. Format should be similar to __print_hex(), but without spacing. >> Add a __print_hex_str() variant for exactly that purpose that reuses >> trace_print_hex_seq(). > > Steven should be back to his side of the wall soon, will wait for his > Ack, ok? Ok, seems this set got applied already to net-next in the meantime, so if there are any objections on this, I will follow up with a patch of course. Thanks, Daniel > - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-01-25 19:20 +0100 |
| Message-ID | <t3AkN-5aQ-9@gated-at.bofh.it> |
| In reply to | #1566263 |
From: Daniel Borkmann <daniel@iogearbox.net> Date: Wed, 25 Jan 2017 02:28:15 +0100 > This set adds tracepoints to BPF for better introspection and > debugging. The first two patches are prerequisite for the actual > third patch that adds the tracepoints. I think the first two are > small and straight forward enough that they could ideally go via > net-next, but I'm also open to other suggestions on how to route > them in case that's not applicable (it would reduce potential > merge conflicts on BPF side, though). For details, please see > individual patches. Looks great, series applied, thanks Daniel.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web