[Lldb-commits] [PATCH] D126990: [trace][intelpt] Support system-wide tracing [15] - Make triple optional
walter erquinigo via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 3 12:03:31 PDT 2022
wallace created this revision.
wallace added a reviewer: jj10306.
Herald added a project: All.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
The process triple should only be needed when LLDB can't identify the correct
triple on its own. Examples could be universal mach-o binaries. But in any case,
at least for most of ELF files, LLDB should be able to do the job without having
the user specify the triple manually.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126990
Files:
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
lldb/test/API/commands/trace/TestTraceLoad.py
lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
Index: lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
===================================================================
--- lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
+++ lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
@@ -2,14 +2,13 @@
"type": "intel-pt",
"cpuInfo": {
"vendor": "GenuineIntel",
- "family": 6,
+ "family": "123",
"model": 79,
"stepping": 1
},
"processes": [
{
"pid": 1234,
- "triple": "x86_64-*-linux",
"threads": [
{
"tid": 5678,
Index: lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
===================================================================
--- lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
+++ lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
@@ -38,8 +38,7 @@
{
"tid": 3497497
}
- ],
- "triple": "x86_64-unknown-linux-gnu"
+ ]
}
],
"tscPerfZeroConversion": {
Index: lldb/test/API/commands/trace/TestTraceLoad.py
===================================================================
--- lldb/test/API/commands/trace/TestTraceLoad.py
+++ lldb/test/API/commands/trace/TestTraceLoad.py
@@ -94,9 +94,9 @@
"stepping": integer
},'''])
- # Now we test a missing field in the global session file
+ # Now we test a wrong cpu family field in the global session file
self.expect("trace load -v " + os.path.join(src_dir, "intelpt-trace", "trace_bad2.json"), error=True,
- substrs=['error: missing value at traceSession.processes[1].triple', "Context", "Schema"])
+ substrs=['error: expected uint64_t at traceSession.cpuInfo.family', "Context", "Schema"])
# Now we test a missing field in the intel-pt settings
self.expect("trace load -v " + os.path.join(src_dir, "intelpt-trace", "trace_bad4.json"), error=True,
Index: lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
===================================================================
--- lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
+++ lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
@@ -88,7 +88,7 @@
TraceIntelPTSessionFileParser::ParseProcess(const JSONProcess &process) {
TargetSP target_sp;
Status error = m_debugger.GetTargetList().CreateTarget(
- m_debugger, /*user_exe_path*/ StringRef(), process.triple,
+ m_debugger, /*user_exe_path*/ StringRef(), process.triple.getValueOr(""),
eLoadDependentsNo,
/*platform_options*/ nullptr, target_sp);
@@ -161,8 +161,8 @@
"processes": [
{
"pid": integer,
- "triple": string,
- // clang/llvm target triple.
+ "triple"?: string,
+ // Optional clang/llvm target triple.
"threads": [
{
"tid": integer,
Index: lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
===================================================================
--- lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
+++ lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
@@ -36,7 +36,7 @@
struct JSONProcess {
int64_t pid;
- std::string triple;
+ llvm::Optional<std::string> triple;
std::vector<JSONThread> threads;
std::vector<JSONModule> modules;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126990.434100.patch
Type: text/x-patch
Size: 3346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220603/4ac64da1/attachment.bin>
More information about the lldb-commits
mailing list