@@ -94,7 +94,7 @@ class DataAggregator : public DataReader {
9494
9595 // / Used for parsing specific pre-aggregated input files.
9696 struct AggregatedLBREntry {
97- enum Type : char { BRANCH = 0 , FT, FT_EXTERNAL_ORIGIN };
97+ enum Type : char { BRANCH = 0 , FT, FT_EXTERNAL_ORIGIN, TRACE };
9898 Location From;
9999 Location To;
100100 uint64_t Count;
@@ -197,6 +197,10 @@ class DataAggregator : public DataReader {
197197
198198 BoltAddressTranslation *BAT{nullptr };
199199
200+ // / Whether pre-aggregated profile needs to convert branch profile into call
201+ // / to continuation fallthrough profile.
202+ bool NeedsConvertRetProfileToCallCont{false };
203+
200204 // / Update function execution profile with a recorded trace.
201205 // / A trace is region of code executed between two LBR entries supplied in
202206 // / execution order.
@@ -268,8 +272,7 @@ class DataAggregator : public DataReader {
268272 uint64_t Mispreds);
269273
270274 // / Register a \p Branch.
271- bool doBranch (uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds,
272- bool IsPreagg);
275+ bool doBranch (uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds);
273276
274277 // / Register a trace between two LBR entries supplied in execution order.
275278 bool doTrace (const LBREntry &First, const LBREntry &Second,
@@ -298,7 +301,7 @@ class DataAggregator : public DataReader {
298301 ErrorOr<PerfMemSample> parseMemSample ();
299302
300303 // / Parse pre-aggregated LBR samples created by an external tool
301- ErrorOr<AggregatedLBREntry> parseAggregatedLBREntry ();
304+ std::error_code parseAggregatedLBREntry ();
302305
303306 // / Parse either buildid:offset or just offset, representing a location in the
304307 // / binary. Used exclusively for pre-aggregated LBR samples.
@@ -384,14 +387,15 @@ class DataAggregator : public DataReader {
384387 // / memory.
385388 // /
386389 // / File format syntax:
387- // / {B|F|f} [<start_id>:]<start_offset> [<end_id>:]<end_offset> <count>
388- // / [<mispred_count>]
390+ // / {B|F|f|T } [<start_id>:]<start_offset> [<end_id>:]<end_offset> [<ft_end>]
391+ // / <count> [<mispred_count>]
389392 // /
390393 // / B - indicates an aggregated branch
391394 // / F - an aggregated fall-through
392395 // / f - an aggregated fall-through with external origin - used to disambiguate
393396 // / between a return hitting a basic block head and a regular internal
394397 // / jump to the block
398+ // / T - an aggregated trace: branch with a fall-through (from, to, ft_end)
395399 // /
396400 // / <start_id> - build id of the object containing the start address. We can
397401 // / skip it for the main binary and use "X" for an unknown object. This will
@@ -402,6 +406,8 @@ class DataAggregator : public DataReader {
402406 // /
403407 // / <end_id>, <end_offset> - same for the end address.
404408 // /
409+ // / <ft_end> - same for the fallthrough_end address.
410+ // /
405411 // / <count> - total aggregated count of the branch or a fall-through.
406412 // /
407413 // / <mispred_count> - the number of times the branch was mispredicted.
0 commit comments