This is an archive of the discontinued LLVM Phabricator instance.

[trace][intelpt] Support system-wide tracing [10] - Return warnings and tsc information from lldb-server.
ClosedPublic

Authored by wallace on May 18 2022, 3:29 PM.

Details

Summary
  • Add a warnings field in the jLLDBGetState response, for warnings to be delivered to the client for troubleshooting. This removes the need to silently log lldb-server's llvm::Errors and not expose them easily to the user
  • Simplify the tscPerfZeroConversion struct and schema. It used to extend a base abstract class, but I'm doubting that we'll ever add other conversion mechanisms because all modern kernels support perf zero. It is also the one who is supposed to work with the timestamps produced by the context switch trace, so expecting it is imperative.
  • Force tsc collection for cpu tracing.
  • Add a test checking that tscPerfZeroConversion is returned by the GetState request
  • Add a pre-check for cpu tracing that makes sure that perf zero values are available.

Diff Detail

Event Timeline

wallace created this revision.May 18 2022, 3:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 3:29 PM
wallace requested review of this revision.May 18 2022, 3:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 3:29 PM
jj10306 added inline comments.May 27 2022, 12:45 PM
lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
40

Don't we want to always reload the parameters here (ie not do this check) since they could potentially change or is that not the case?
We had discussions about this when I initially added the tsc conversion logic but I can't remember so maybe you can help refresh my memory:

wallace added inline comments.Jun 8 2022, 11:15 AM
lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
40

ahh, that's a good point. We should favor the most recent instructions, which means favoring the most recent conversion params

jj10306 requested changes to this revision.Jun 15 2022, 9:04 AM

sending this back to you based on the one minor thing we discussed related to reloading. If this is addressed in one of the cleanup diffs, lmk and I'll accept this.

This revision now requires changes to proceed.Jun 15 2022, 9:04 AM
wallace requested review of this revision.Jun 15 2022, 9:26 AM
jj10306 accepted this revision.Jun 15 2022, 9:34 AM
This revision is now accepted and ready to land.Jun 15 2022, 9:34 AM