Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
9e1c11d to
225e92a
Compare
225e92a to
8e61271
Compare
7c0205b to
bdc715e
Compare
bdc715e to
83410fc
Compare
not-matthias
left a comment
There was a problem hiding this comment.
Looks good, just very minor comments.
| /* from dump.c */ | ||
| void CLG_(init_dumps)(void); | ||
| /* Queue a "desc:" line for the header of the next dumped part. */ | ||
| void CLG_(register_part_desc)(const HChar* desc); |
There was a problem hiding this comment.
nit: maybe queue_desc might fit better. i associate "register" more with registering a callback. wdyt? 🤔
other options: dump_desc, emit_desc, add_desc, etc.
There was a problem hiding this comment.
I agree, add_desc is probably the clearest name, I'll update
A client had no way to attach information to a dump part other than the trigger string of CALLGRIND_DUMP_STATS_AT, and every such dump creates a part of its own. CALLGRIND_REGISTER_DESC(desc) queues a "desc: <desc>" line for the header of the next dumped part without dumping. Like the spawned pids, the lines are written in every section of that part, then dropped. Line breaks in desc are written as spaces so they cannot corrupt the header, and a fork child drops the lines its parent queued for its own part. Closes COD-3722 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2d88534 to
fa48853
Compare
Add a
CALLGRIND_REGISTER_DESC(desc)client request that attaches adesc: <desc>line to the header of the next dumped part, without dumping.A client can currently only label a part through the trigger string of
CALLGRIND_DUMP_STATS_AT, and every such call creates a part of its own. Here, lines are queued, written in every section of the next part (per thread under--separate-threads=yes), then cleared. This is the same lifecycle as the existingdesc: Spawned pid:lines.The first user is instrument-hooks. It declares the pid a benchmark ran in when that is not the dumping process, so a launcher's own cost can be told apart from the benchmark's:
Notes for review:
descare written as spaces, so a client string cannot corrupt the header.Warning: unknown callgrind client request codeand carry on.Ships as
0codspeed8. instrument-hooks syncscallgrind.hfrom this repo'smaster, so this has to merge first.Stacked on #44, which fixes the
inline-crossfilefailure on ubuntu-22.04 this change exposed: it was caused by the tool binary's layout, not by this change.Closes COD-3722