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

Add callback to the Tracker API to post-process the capture file #599

Closed
1 task done
sarahmonod opened this issue May 20, 2024 · 3 comments
Closed
1 task done

Add callback to the Tracker API to post-process the capture file #599

sarahmonod opened this issue May 20, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sarahmonod
Copy link
Contributor

Is there an existing proposal for this?

  • I have searched the existing proposals

Is your feature request related to a problem?

It is a fairly common thing for people to want to post-process the capture file, especially when running in a container (for example to send it to a different location over the network for later analysis).

Even though it wouldn't work when a process runs out of memory, it could still be useful to have a way to do this for all other cases of memory tracing.

Describe the solution you'd like

Add a way to provide a callback that would get a path to the capture file so that users can run any arbitrary post-processing on the file, for example sending the file to another location over the network.

Alternatives you considered

No response

@sarahmonod sarahmonod added enhancement New feature or request good first issue Good for newcomers labels May 20, 2024
@micheleAlberto
Copy link
Contributor

@gusmonod can I pick this up?

@micheleAlberto
Copy link
Contributor

We reflected and wondered if this really makes sense.

We could support a workflow like this where a callback is called passing the output path on exit

output ="my/path/to/capture.bin"
callback = lambda capture_path : do_post_processing(capture_path)
with Tracker(output, post_processing_callback=callback):
    run_my_program()

but this would be fairly equivalent to

output ="my/path/to/capture.bin"
callback = lambda capture_path : do_post_processing(capture_path)
with Tracker(output):
    run_my_program()
callback(output)

@sarahmonod
Copy link
Contributor Author

Closing as per the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants