Skip to content

Comments

Show multiple user PF's in the output#3

Open
damiandcoherent wants to merge 1 commit intoDispatchCode:mainfrom
damiandcoherent:main
Open

Show multiple user PF's in the output#3
damiandcoherent wants to merge 1 commit intoDispatchCode:mainfrom
damiandcoherent:main

Conversation

@damiandcoherent
Copy link

No description provided.

event->cr2_tai[i] = stat->tai;

++event->cr2_userpf_entry_count;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we perhaps break the loop if stat == NULL?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should never be the case, it is there just for the verifier. If something horribly wrong happens, shouldn't we be printing as much as we can?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my point was that the ring buffer get function returns NULL if you're past the write end (and the buffer is not full yet). Unfortunately, I don't know how to view my comment on the original code in GitHub :/

cr2 = ctx->address;
stat.cr2 = ctx->address;
stat.err = ctx->error_code;
stat.tai = bpf_ktime_get_tai_ns();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you measured the performance impact when executing lots of page faults?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did not see any drastic change in the performance. Time per page fault appears to be in the range 0.75-1.1µs

@damiandcoherent damiandcoherent force-pushed the main branch 2 times, most recently from 9e2dde9 to adb47a7 Compare February 24, 2026 13:28
@damiandcoherent damiandcoherent marked this pull request as ready for review February 24, 2026 13:39
@damiandcoherent damiandcoherent force-pushed the main branch 4 times, most recently from 2c96b30 to dbd19c0 Compare February 24, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants