This is an archive of the discontinued LLVM Phabricator instance.

[trace][intelpt] Support system-wide tracing [21] - Support long numbers in JSON
ClosedPublic

Authored by wallace on Jun 14 2022, 7:15 PM.

Details

Summary

llvm's JSON parser supports 64 bit integers, but other tools like the
ones written in JS don't support numbers that big, so we need to
represent these possibly big numbers as a string. This diff uses that to
represent addresses and tsc zero. The former is printed in hex for and
the latter in decimal string form. The schema was updated mentioning
that.

Besides that, I fixed some remaining issues and now all test pass. Before I wasn't running all tests because for some reason my computer reverted perf_paranoid to 1.

Diff Detail

Event Timeline

wallace created this revision.Jun 14 2022, 7:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 7:15 PM
wallace requested review of this revision.Jun 14 2022, 7:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 7:15 PM
jj10306 accepted this revision.Jun 15 2022, 10:15 AM
jj10306 added inline comments.
lldb/source/Utility/TraceIntelPTGDBRemotePackets.cpp
25

should there be an option to write it as an integer or would the user just be expected to use a raw u64 in that case?

This revision is now accepted and ready to land.Jun 15 2022, 10:15 AM
wallace added inline comments.Jun 15 2022, 10:57 AM
lldb/source/Utility/TraceIntelPTGDBRemotePackets.cpp
25

I'd prefer us to emit only string numbers, but to leave the option for external tools to emit non-string decimals