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