mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
ktrace-CO-RE: ktrace01_kern.c print more info from SKB
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
@@ -35,11 +35,13 @@ SEC("kprobe/udp_send_skb")
|
||||
int BPF_KPROBE(udp_send_skb, struct sk_buff *skb)
|
||||
//int udp_send_skb(struct pt_regs *ctx)
|
||||
{
|
||||
unsigned int len;
|
||||
__u32 h;
|
||||
|
||||
BPF_CORE_READ_INTO(&h, skb, hash); /* skb->hash */
|
||||
BPF_CORE_READ_INTO(&h, skb, hash); /* skb->hash */
|
||||
BPF_CORE_READ_INTO(&len, skb, len); /* skb->len */
|
||||
|
||||
bpf_printk("skb->hash = 0x%x ", h);
|
||||
bpf_printk("skb->hash=0x%x len=%d", h, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user