Skip to content

Commit 942010a

Browse files
authored
Merge pull request #35 from LakshK98/fix-generation
size print fix
2 parents 9eafa38 + 79d14c9 commit 942010a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/e2e/tools/event-writer/bpf_event_writer.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ event_writer(xdp_md_t* ctx) {
309309
struct pktmon_notify* pkt_drp_elm;
310310
struct drop_notify* drp_elm;
311311

312+
uint64_t pktmon_size = sizeof(struct pktmon_notify);
313+
uint64_t drop_size = sizeof(struct drop_notify);
312314

313-
314315
//Create a Mock Drop Event
315316
drp_elm = (struct drop_notify *) bpf_map_lookup_elem(&drp_buffer, &buf_key);
316317
if (drp_elm == NULL) {
@@ -334,7 +335,7 @@ event_writer(xdp_md_t* ctx) {
334335
memset(pkt_drp_elm->data, 0, sizeof(pkt_drp_elm->data));
335336
memcpy(pkt_drp_elm->data, ctx->data, size_to_copy);
336337

337-
bpf_printk("PKTMON_NOTIFY_DROP event: reason=%d, size_to_copy=%d, pktmon_struct_size=%d, drop_struct_size=%d \n", reason, size_to_copy, sizeof(struct pktmon_notify), sizeof(struct drop_notify));
338+
bpf_printk("PKTMON_NOTIFY_DROP event: reason=%d, size_to_copy=%d, pktmon_struct_size=%llu, drop_struct_size=%llu \n", reason, size_to_copy, pktmon_size, drop_size);
338339
// memcpy(drp_elm->data, ctx->data, size_to_copy);
339340
bpf_perf_event_output(ctx, &cilium_events, EBPF_MAP_FLAG_CURRENT_CPU , pkt_drp_elm, sizeof(struct pktmon_notify));
340341
}

0 commit comments

Comments
 (0)