[all-commits] [llvm/llvm-project] 6fb744: [trace][intel pt] Support a new kernel section in ...

walter erquinigo via All-commits all-commits at lists.llvm.org
Thu Aug 4 17:15:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fb744be76704f075a4edc753916e0e475d10f20
      https://github.com/llvm/llvm-project/commit/6fb744be76704f075a4edc753916e0e475d10f20
  Author: Walter Erquinigo <wallace at fb.com>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.h
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
    M lldb/test/API/commands/trace/TestTraceLoad.py
    M lldb/test/API/commands/trace/TestTraceSave.py
    A lldb/test/API/commands/trace/intelpt-kernel-trace/trace.json
    A lldb/test/API/commands/trace/intelpt-kernel-trace/trace_kernel_with_process.json
    A lldb/test/API/commands/trace/intelpt-kernel-trace/trace_kernel_wo_cpus.json
    A lldb/test/API/commands/trace/intelpt-kernel-trace/trace_with_loadAddress.json

  Log Message:
  -----------
  [trace][intel pt] Support a new kernel section in LLDB’s trace bundle schema

Add a new "kernel" section with following schema.

```
"kernel": {
  "loadAddress"?: decimal | hex string | string decimal
  # This is optional. If it's not specified, use default address 0xffffffff81000000.
  "file": string
  # path to the kernel image
}
```

Here's more details of the diff:
- If "kernel" section exist, it means current tracing mode is //KernelMode//.
- If tracing mode is //KernelMode//, the "processes" section must be empty and the "kernel" and "cpus" section must be provided. This is tested with `TestTraceLoad`.
- "kernel" section is parsed and turned into a new process with a single module which is the kernel image. The kernel process has N fake threads, one for each cpu.

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D130805




More information about the All-commits mailing list