Skip to content

Commit

Permalink
fix(driver/kmod): do not count preemptions in n_evts
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
  • Loading branch information
Andreagit97 authored and poiana committed Aug 8, 2024
1 parent 78d7312 commit 124428f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,6 @@ static int record_event_consumer(struct ppm_consumer_t *consumer,
ASSERT(ring);

ring_info = ring->info;
ring_info->n_evts++;
if (event_datap->category == PPMC_CONTEXT_SWITCH && event_datap->event_info.context_data.sched_prev != NULL) {
if (event_type != PPME_SCAPEVENT_E && event_type != PPME_CPU_HOTPLUG_E) {
ASSERT(event_datap->event_info.context_data.sched_prev != NULL);
Expand All @@ -1851,13 +1850,14 @@ static int record_event_consumer(struct ppm_consumer_t *consumer,
* This means that effectively those events would be lost.
*/
if (event_type != PPME_PAGE_FAULT_E) {
ring_info->n_preemptions++;
ASSERT(false);
}
ring_info->n_preemptions++;
atomic_dec(&ring->preempt_count);
put_cpu();
return res;
}
ring_info->n_evts++;

/*
* Calculate the space currently available in the buffer
Expand Down

0 comments on commit 124428f

Please sign in to comment.