This is an archive of the discontinued LLVM Phabricator instance.

[trace][intelpt] Remove code smell when printing the raw trace size
ClosedPublic

Authored by wallace on Apr 7 2022, 9:00 PM.

Details

Summary

Something ugly I did was to report the trace buffer size to the DecodedThread,
which is later used as part of the dump info command. Instead of doing that,
we can just directly ask the trace for the raw buffer and print its size.

I thought about not asking for the entire trace but instead just for its size,
but in this case, as our traces as not extremely big, I prefer to ask for the
entire trace, ensuring it could be fetched, and then print its size.

Diff Detail

Event Timeline

wallace created this revision.Apr 7 2022, 9:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 9:00 PM
wallace requested review of this revision.Apr 7 2022, 9:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 9:00 PM
jj10306 accepted this revision.Apr 8 2022, 5:27 AM
This revision is now accepted and ready to land.Apr 8 2022, 5:27 AM

Looks good. Any reason not to have GetRawTraceSize() at the Trace interface level instead of being specific to TraceIntelPT?

Well, not all theoretical trace plugins might have raw trace sizes.