Re: bpf_trace_printk isn't working

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

 



Maybe *data is not a printable character?

On Fri, Jun 30, 2017 at 12:54 PM, MD I. Islam <tamim@xxxxxxxxxxx> wrote:
> Hi
>
> I have following code attached to an interface:
>
> SEC("simple")
> int handle_ingress(struct __sk_buff *skb)
> {
>         unsigned char *data = (unsigned char *)(long)skb->data;
>         char fmt[] = "%u\n";
>         bpf_trace_printk(fmt, sizeof(fmt), *data);
>         return 0;
> }
>
> When packets pass through the interface, it does not print anything at
> /sys/kernel/debug/tracing/trace_pipe. However if I do
> bpf_trace_printk(fmt, sizeof(fmt), data), it prints the pointer. Could
> you please advise what is wrong here?
>
> Many thanks
> Tamim



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

  Powered by Linux