[all-commits] [llvm/llvm-project] fb19f1: [trace][intel-pt] Scaffold the 'thread trace start...

walter erquinigo via All-commits all-commits at lists.llvm.org
Wed Nov 18 18:24:54 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fb19f11ef47bc479d42c11450817c5e855a9830b
      https://github.com/llvm/llvm-project/commit/fb19f11ef47bc479d42c11450817c5e855a9830b
  Author: Walter Erquinigo <a20012251 at gmail.com>
  Date:   2020-11-18 (Wed, 18 Nov 2020)

  Changed paths:
    M lldb/include/lldb/Core/PluginManager.h
    M lldb/include/lldb/Interpreter/CommandObjectMultiword.h
    A lldb/include/lldb/Target/PostMortemProcess.h
    M lldb/include/lldb/Target/Process.h
    M lldb/include/lldb/Target/ProcessTrace.h
    M lldb/include/lldb/Target/Trace.h
    M lldb/include/lldb/lldb-enumerations.h
    M lldb/include/lldb/lldb-private-interfaces.h
    M lldb/source/Commands/CMakeLists.txt
    M lldb/source/Commands/CommandObjectMultiword.cpp
    M lldb/source/Commands/CommandObjectThread.cpp
    A lldb/source/Commands/CommandObjectThreadUtil.cpp
    A lldb/source/Commands/CommandObjectThreadUtil.h
    M lldb/source/Core/PluginManager.cpp
    M lldb/source/Interpreter/CommandObject.cpp
    M lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
    M lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
    M lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    M lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
    M lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
    M lldb/source/Plugins/Process/minidump/ProcessMinidump.h
    M lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt
    A lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
    A lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.h
    M lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
    A lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/ProcessTrace.cpp
    M lldb/test/API/commands/trace/TestTraceDumpInstructions.py
    A lldb/test/API/commands/trace/TestTraceStartStop.py

  Log Message:
  -----------
  [trace][intel-pt] Scaffold the 'thread trace start | stop' commands

Depends on D90490.

The stop command is simple and invokes the new method Trace::StopTracingThread(thread).

On the other hand, the start command works by delegating its implementation to a CommandObject provided by the Trace plugin. This is necessary because each trace plugin needs different options for this command. There's even the chance that a Trace plugin can't support live tracing, but instead supports offline decoding and analysis, which means that "thread trace dump instructions" works but "thread trace start" doest. Because of this and a few other reasons, it's better to have each plugin provide this implementation.

Besides, I'm using the GetSupportedTraceType method introduced in D90490 to quickly infer what's the trace plug-in that works for the current process.

As an implementation note, I moved CommandObjectIterateOverThreads to its header so that I can use it from the IntelPT plugin. Besides, the actual start and stop logic for intel-pt is not part of this diff.

Reviewed By: clayborg

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




More information about the All-commits mailing list