Re: bpf_debug output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ethy,

Correct. The output is available via file
`/sys/kernel/debug/tracing/trace_pipe`. There are other helper
programs that can also read it, like `bpftool prog tracelog` or `tc
exec bpf dbg`.

But you need to pay attention, what you're trying to print, since
`bpf_printk()` supports much fewer formats than usual `printk()`. I.e.
only  `%d %i %u %x %ld %li %lu %lx %lld %lli %llu %llx %p %s`
conversion specifiers are allowed. If an unsupported specifier is
spotted, the string is silently dropped and never appears in trace
log.

Here you can find some examples:
https://github.com/xdp-project/xdp-tutorial/tree/master/tracing03-xdp-debug-print


Best regards,
Ivan Koveshnikov

On Wed, 14 Jul 2021 at 08:08, Ethy H. Brito <ethy.brito@xxxxxxxxxxxx> wrote:
>
>
> Hi!
>
> I am working on some minor modifications in xdp-cpumap-tc to accommodate NAT at WAN side.
> But the things are not working as expected.
>
> How can bpf_debug be used to help debugging?
>
> I read that its output ends-up in /sys/kernel/debug/tracing/trace_pipe.
> But how can it be read?
> I tried "cat trace_pipe" but this produced no output whatsoever.
>
> Any hints will be appreciated.
>
> Thanx
>
> Regards
>
> Ethy



[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux