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

Synchronise probe start times #3128

Open
ajor opened this issue Apr 18, 2024 · 0 comments
Open

Synchronise probe start times #3128

ajor opened this issue Apr 18, 2024 · 0 comments
Labels
difficulty: medium enhancement New feature or request, changes on existing features priority: medium reliability Correctness and polish work

Comments

@ajor
Copy link
Member

ajor commented Apr 18, 2024

Problem

Probes are currently attached one-at-a-time, roughly in the order that they're declared in a script (with some extra ordering logic that I'm not sure is 100% correct).

That means that this script may print many lines of "a" before a single "b" appears:

tracepoint:syscalls:sys_enter_read { print("a") }
tracepoint:syscalls:sys_exit_read { print("b"); exit() }
Attaching 2 probes...
a
a
a
a
b

Reversing the order of the probes, the script would always print "b" then exit without printing a single "a":

tracepoint:syscalls:sys_exit_read { print("b"); exit() }
tracepoint:syscalls:sys_enter_read { print("a") }

These staggered start times can be confusing for users.

Solution

It would be nice to provide the option to synchronise probe start times.

We don't have any way to attach them all at the same time, so one alternative solution is to add an implicit predicate to every probe which references a global variable:

/ is_started == true /

Then just toggle the variable to true from userspace once all probes are attached and ready to go.

There is some small overhead to adding a predicate to every probe, so we could make this a configurable setting.

@ajor ajor added enhancement New feature or request, changes on existing features priority: medium difficulty: medium labels Apr 18, 2024
@ajor ajor added the reliability Correctness and polish work label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium enhancement New feature or request, changes on existing features priority: medium reliability Correctness and polish work
Projects
None yet
Development

No branches or pull requests

1 participant