Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unify dropping management in modern bpf probe #802

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions driver/modern_bpf/helpers/store/auxmap_store_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ static __always_inline void auxmap__submit_event(struct auxiliary_map *auxmap)
return;
}

/* This counts the event seen by the drivers even if they are dropped because the buffer is full. */
counter->n_evts++;

if(auxmap->payload_pos > MAX_EVENT_SIZE)
{
counter->n_drops_max_event_size++;
Expand All @@ -209,10 +212,6 @@ static __always_inline void auxmap__submit_event(struct auxiliary_map *auxmap)
{
counter->n_drops_buffer++;
}
else
{
counter->n_evts++;
}
}

/////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion driver/modern_bpf/helpers/store/ringbuf_store_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static __always_inline u32 ringbuf__reserve_space(struct ringbuf_struct *ringbuf
return 0;
}

/* This counts the event seen by the drivers even if they are dropped because the buffer is full. */
counter->n_evts++;

/* If we are not able to reserve space we stop here
* the event collection.
*/
Expand All @@ -109,7 +112,6 @@ static __always_inline u32 ringbuf__reserve_space(struct ringbuf_struct *ringbuf
return 0;
}

counter->n_evts++;
ringbuf->data = space;
ringbuf->reserved_event_size = event_size;
return 1;
Expand Down
1 change: 1 addition & 0 deletions userspace/libpman/src/capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ int pman_get_scap_stats(void *scap_stats_struct)
stats->n_evts += cnt_map.n_evts;
stats->n_drops_buffer += cnt_map.n_drops_buffer;
stats->n_drops_scratch_map += cnt_map.n_drops_max_event_size;
stats->n_drops += (cnt_map.n_drops_buffer + cnt_map.n_drops_max_event_size);
}
return 0;

Expand Down