trace-summary: record message bytes per entry method per interval - #3937
Open
lvkale wants to merge 1 commit into
Open
trace-summary: record message bytes per entry method per interval#3937lvkale wants to merge 1 commit into
lvkale wants to merge 1 commit into
Conversation
A summary detail trace says how much time each entry method spent in an interval and how many times it ran there, which is how many messages it processed, but not how much data those messages carried. The size is already handed to the tracer and thrown away: TraceSummary::beginExecute takes an mlen argument it never reads, and the envelope form drops the length before calling it. Pass the envelope's total size through, remember it for the matching endExecute the way the entry method index is remembered, and accumulate it into a msgBytes array beside numExecutions, in the same bin the run is counted in. The .sumd file gains a MsgBytesPerEPperInterval line in the same run length encoding as the two arrays already written. Only messages delivered to an entry method contribute. Packing and unpacking, which numExecutions also counts because updateSummaryDetail is called for them too, add no bytes. Costs one 8 byte counter per bin per entry method while tracing, next to the 8 byte time and 4 byte count already kept, and one more line per processor in the .sumd file. Readers that do not know the new line are unaffected: Projections' SumDetailReader ignores labels it does not recognise by design, so an older Projections reads a newer .sumd unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ritvikrao
approved these changes
Aug 12, 2026
lvkale
enabled auto-merge (squash)
August 12, 2026 19:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A summary detail trace says how much time each entry method spent in an interval and how many times it ran there — which is how many messages it processed — but not how much data those messages carried. Projections can therefore show message counts over time for a summary trace but nothing about volume, while a
.logtrace gives both.The size is already handed to the tracer and thrown away.
TraceSummary::beginExecute(int event, int msgType, int ep, int srcPe, int mlen, ...)takes a length it never reads, and the envelope form drops it before calling that one:What this does
endExecutethe wayexecEpis remembered;msgBytesarray besidenumExecutions, in the same bin the run is counted in, with the same allocation,shrink()and teardown;MsgBytesPerEPperIntervalline into the.sumdfile in the same run length encoding as the two arrays already there.Only messages delivered to an entry method contribute. Packing and unpacking, which
numExecutionsalso counts becauseupdateSummaryDetailis called for them fromendPack/endUnpack, add no bytes.The quantity recorded is
envelope::getTotalsize(), which is exactly whattrace-projectionsrecords as a message length, so byte figures from a summary trace and from a.logtrace mean the same thing.Cost and compatibility
One 8 byte counter per bin per entry method while tracing, beside the 8 byte time and 4 byte count already kept, and one more line per processor in the
.sumdfile. Nothing changes when+sumDetailis off.Readers that predate the new line are unaffected: Projections'
SumDetailReaderignores labels it does not recognise, by explicit design ("this allows new formats to be implemented without immediately rendering this tool useless"), so an older Projections reads a newer.sumdunchanged. No file version bump is therefore needed. The Projections side that displays the new data is charmplusplus/projections#166.Testing
Built
netlrts-darwin-arm8with-DTRACING=1on macOS (Apple clang 16) and ran a program that sends 100 messages to each of two entry methods, the second carrying twice the payload of the first. Envelope overhead is the same for both, so the difference between their recorded byte totals must be exactly 100 x payload:(The payload has to be a multiple of the message alignment for that identity to hold — with a 1000 byte payload the two messages round to different padding and the difference is 800 short, which is alignment rather than accounting.)
Projections then read the same trace back and reported 113,600 bytes over 100 messages for one entry method and 216,000 over 100 for the other, matching the file. An existing 1920 processor trace written before this change still loads, with sizes reading zero throughout.
Not yet tested on a machine other than this laptop, or with reconverse.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code