This is an archive of the discontinued LLVM Phabricator instance.

[trace][intelpt] Support system-wide tracing [16] - Create threads automatically from context switch data in the post-mortem case
ClosedPublic

Authored by wallace on Jun 3 2022, 1:31 PM.

Details

Summary

For some context, The context switch data contains information of which threads were
executed by each traced process, therefore it's not necessary to specify
them in the trace file.

So this diffs adds support for that automatic feature. Eventually we
could include it to live processes as well.

Diff Detail

Event Timeline

wallace created this revision.Jun 3 2022, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 1:31 PM
wallace requested review of this revision.Jun 3 2022, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 1:31 PM
jj10306 requested changes to this revision.Jun 9 2022, 4:48 AM
jj10306 added inline comments.
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
167–170

So should this be an empty list or will the key not exist at all in the case that context switches are provided?

212–215

is this necessary? can't this be inferred by if the threads key isn't present/the list is empty?
also, is this even being used rn? It appears to me that you always invoke CreateThreadsFromContextSwitches() if session.cores is present?

lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json
32–36

shouldn't this be gone or just an empty list depending on how we want to implement it?

This revision now requires changes to proceed.Jun 9 2022, 4:48 AM
wallace added inline comments.Jun 14 2022, 3:34 PM
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
167–170

this should be an empty list. I've improved this documentaiton a bit

212–215

lol, i forgot to delete this

lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json
32–36

i want to here here the hybrid situation of having some explicit threads here and others inferred

wallace requested review of this revision.Jun 15 2022, 9:28 AM
jj10306 accepted this revision.Jun 15 2022, 9:36 AM
This revision is now accepted and ready to land.Jun 15 2022, 9:36 AM
This revision was landed with ongoing or failed builds.Jun 16 2022, 11:23 AM
This revision was automatically updated to reflect the committed changes.