Bug 497432 - Feature Request: Automated Snapshot Generation in Callgrind on Process Termination
Summary: Feature Request: Automated Snapshot Generation in Callgrind on Process Termin...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: callgrind (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Josef Weidendorfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-13 21:48 UTC by Elie
Modified: 2025-05-23 05:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elie 2024-12-13 21:48:37 UTC
Dear Valgrind Development Team,

I hope this message finds you well. I am a frequent user of Callgrind for performance profiling and greatly appreciate the tool’s flexibility and robustness. However, I have encountered a scenario where I believe a new feature could significantly enhance its usability.

Proposed Feature:
I propose adding an optional capability for Callgrind to automatically save a snapshot of profiling data upon the monitored process’s termination (normal or abnormal). This feature could be controlled via a command-line option or environment variable, such as --auto-dump-on-exit, and applied selectively using existing NPID control mechanisms.

Use Case:
In workflows where applications may terminate unexpectedly (e.g., due to crashes or external signals), the current manual invocation of CALLGRIND_DUMP_STATS can result in missed profiling opportunities. Automating this step would ensure critical profiling data is captured without requiring changes to the application code or extensive wrapper scripts.

Feasibility:
Given that Callgrind already supports NPID-based control, implementing this feature seems feasible by extending its termination handling logic. Users could opt-in to this behavior only for specific processes of interest to avoid unnecessary data generation.

Benefits:
-Ensures profiling data is not lost due to unforeseen process terminations.
-Reduces the need for custom instrumentation or external monitoring scripts.
-Enhances user control while maintaining Callgrind’s efficiency.
I would be happy to discuss this further or provide additional examples and use cases. If this feature aligns with the tool’s development goals.

Thank you for considering this request, and I look forward to your feedback.

Best regards,
Elie
Expert Performance Test Engineer
Comment 1 Elie 2025-05-23 05:37:07 UTC
hi Mr Josef,

Did you have time to read my request in this ticket?
We will be more than happy if you can give us an ETA to develop this feature.

Thank you.
Regards,
Elie