Repository navigation
trace-summary: record message bytes per entry method per interval (reviewed line, twin of #3937) - #4020
Merged
ritvikrao merged 2 commits intoOct 1, 2026
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
Oct 1, 2026
lvkale
added a commit
that referenced
this pull request
Oct 9, 2026
Brings in #4016 (PR 0, squash-merged there; this branch had the original commits), #4014 CkTreeCacheManager, #4020 trace-summary message bytes, and the 2026-09-30 triage documents. The three conflicts were PR 0 text that PR 1a (#4017) had already rewritten; the objid-redesign side is kept in each, so the 1a files are unchanged by this merge. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Reviewed-line twin of #3937 (same commit, cherry-picked onto reviewed-with-reconverse; #3937 stays for classic
mainand was approved there by ritvikrao and ericjbohm). Original description follows, then the reconverse test.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.
Tested on reconverse (2026-09-30)
Built
reconverse-darwin-arm8with--enable-tracing --with-production, linked a program with-tracemode summarythat sends 100 messages to each of two marshalled entry methods, the second carrying 1024 bytes more, and ran it with+pe 1 +sumDetail. The.sumdfile gained the line113,600 and 216,000 bytes for the two entry methods: a difference of 102,400 = 100 x 1024, and the same totals the classic test produced (112 bytes of envelope per message on both runtimes). Note that on reconverse the trace modules exist only in a build made with
--enable-tracing; a plain production build reports "No such tracemode summary".Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code