LLDB  mainline
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
lldb_private::trace_intel_pt::ThreadContinuousExecution Struct Reference

This class indicates the time interval in which a thread was running continuously on a cpu core. More...

#include <PerfContextSwitchDecoder.h>

Collaboration diagram for lldb_private::trace_intel_pt::ThreadContinuousExecution:
Collaboration graph
[legend]

Public Types

enum  Variant {
  Variant::Complete, Variant::HintedStart, Variant::HintedEnd, Variant::OnlyStart,
  Variant::OnlyEnd
}
 In most cases both the start and end of a continuous execution can be accurately recovered from the context switch trace, but in some cases one of these endpoints might be guessed or not known at all, due to contention problems in the trace or because tracing was interrupted, e.g. More...
 

Public Member Functions

uint64_t GetLowestKnownTSC () const
 
uint64_t GetStartTSC () const
 
uint64_t GetEndTSC () const
 

Static Public Member Functions

static ThreadContinuousExecution CreateCompleteExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid, uint64_t start, uint64_t end)
 Constructors for the different variants of this object. More...
 
static ThreadContinuousExecution CreateHintedStartExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid, uint64_t hinted_start, uint64_t end)
 
static ThreadContinuousExecution CreateHintedEndExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid, uint64_t start, uint64_t hinted_end)
 
static ThreadContinuousExecution CreateOnlyEndExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid, uint64_t end)
 
static ThreadContinuousExecution CreateOnlyStartExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid, uint64_t start)
 

Public Attributes

enum lldb_private::trace_intel_pt::ThreadContinuousExecution::Variant variant
 
union {
   struct {
      uint64_t   start
 
      uint64_t   end
 
   }   complete
 
   struct {
      uint64_t   start
 
   }   only_start
 
   struct {
      uint64_t   end
 
   }   only_end
 
   struct {
      uint64_t   hinted_start
 
      uint64_t   end
 
   }   hinted_start
 The following 'hinted' structures are useful when there are contention problems in the trace. More...
 
   struct {
      uint64_t   start
 
      uint64_t   hinted_end
 
   }   hinted_end
 
tscs
 
lldb::cpu_id_t cpu_id
 
lldb::tid_t tid
 
lldb::pid_t pid
 

Private Member Functions

 ThreadContinuousExecution (lldb::cpu_id_t cpu_id, lldb::tid_t tid, lldb::pid_t pid)
 We keep this constructor private to force the usage of the static named constructors. More...
 

Detailed Description

This class indicates the time interval in which a thread was running continuously on a cpu core.

Definition at line 23 of file PerfContextSwitchDecoder.h.

Member Enumeration Documentation

◆ Variant

In most cases both the start and end of a continuous execution can be accurately recovered from the context switch trace, but in some cases one of these endpoints might be guessed or not known at all, due to contention problems in the trace or because tracing was interrupted, e.g.

with ioctl calls, which causes gaps in the trace. Because of that, we identify which situation we fall into with the following variants.

Enumerator
Complete 

Both endpoints are known.

HintedStart 

The end is known and we have a lower bound for the start, i.e.

the previous execution in the same cpu happens strictly before the hinted start.

HintedEnd 

The start is known and we have an upper bound for the end, i.e.

the next execution in the same cpu happens strictly after the hinted end.

OnlyStart 

We only know the start. This might be the last entry of a cpu trace.

OnlyEnd 

We only know the end. This might be the first entry or a cpu trace.

Definition at line 31 of file PerfContextSwitchDecoder.h.

Constructor & Destructor Documentation

◆ ThreadContinuousExecution()

lldb_private::trace_intel_pt::ThreadContinuousExecution::ThreadContinuousExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid 
)
inlineprivate

We keep this constructor private to force the usage of the static named constructors.

Definition at line 117 of file PerfContextSwitchDecoder.h.

Member Function Documentation

◆ CreateCompleteExecution()

ThreadContinuousExecution ThreadContinuousExecution::CreateCompleteExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid,
uint64_t  start,
uint64_t  end 
)
static

Constructors for the different variants of this object.

Definition at line 145 of file PerfContextSwitchDecoder.cpp.

References complete, tscs, and variant.

◆ CreateHintedEndExecution()

ThreadContinuousExecution ThreadContinuousExecution::CreateHintedEndExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid,
uint64_t  start,
uint64_t  hinted_end 
)
static

Definition at line 165 of file PerfContextSwitchDecoder.cpp.

References hinted_end, tscs, and variant.

◆ CreateHintedStartExecution()

ThreadContinuousExecution ThreadContinuousExecution::CreateHintedStartExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid,
uint64_t  hinted_start,
uint64_t  end 
)
static

Definition at line 155 of file PerfContextSwitchDecoder.cpp.

References hinted_start, tscs, and variant.

◆ CreateOnlyEndExecution()

ThreadContinuousExecution ThreadContinuousExecution::CreateOnlyEndExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid,
uint64_t  end 
)
static

Definition at line 175 of file PerfContextSwitchDecoder.cpp.

References only_end, tscs, and variant.

◆ CreateOnlyStartExecution()

ThreadContinuousExecution ThreadContinuousExecution::CreateOnlyStartExecution ( lldb::cpu_id_t  cpu_id,
lldb::tid_t  tid,
lldb::pid_t  pid,
uint64_t  start 
)
static

Definition at line 183 of file PerfContextSwitchDecoder.cpp.

References only_start, tscs, and variant.

◆ GetEndTSC()

uint64_t ThreadContinuousExecution::GetEndTSC ( ) const
Returns
The known or hinted end tsc, or max uint64_t if the variant is OnlyStart.

Definition at line 130 of file PerfContextSwitchDecoder.cpp.

◆ GetLowestKnownTSC()

uint64_t ThreadContinuousExecution::GetLowestKnownTSC ( ) const
Returns
The lowest tsc that we are sure of, i.e. not hinted.

Definition at line 100 of file PerfContextSwitchDecoder.cpp.

◆ GetStartTSC()

uint64_t ThreadContinuousExecution::GetStartTSC ( ) const
Returns
The known or hinted start tsc, or 0 if the variant is OnlyEnd.

Definition at line 115 of file PerfContextSwitchDecoder.cpp.

Member Data Documentation

◆ complete

struct { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::complete

Referenced by CreateCompleteExecution().

◆ cpu_id

lldb::cpu_id_t lldb_private::trace_intel_pt::ThreadContinuousExecution::cpu_id

Definition at line 110 of file PerfContextSwitchDecoder.h.

◆ end

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::end

Definition at line 90 of file PerfContextSwitchDecoder.h.

◆ hinted_end [1/2]

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::hinted_end

Definition at line 106 of file PerfContextSwitchDecoder.h.

Referenced by CreateHintedEndExecution().

◆ hinted_end [2/2]

struct { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::hinted_end

◆ hinted_start [1/2]

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::hinted_start

Definition at line 101 of file PerfContextSwitchDecoder.h.

Referenced by CreateHintedStartExecution().

◆ hinted_start [2/2]

struct { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::hinted_start

The following 'hinted' structures are useful when there are contention problems in the trace.

◆ only_end

struct { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::only_end

Referenced by CreateOnlyEndExecution().

◆ only_start

struct { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::only_start

◆ pid

lldb::pid_t lldb_private::trace_intel_pt::ThreadContinuousExecution::pid

Definition at line 112 of file PerfContextSwitchDecoder.h.

◆ start

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::start

Definition at line 89 of file PerfContextSwitchDecoder.h.

◆ tid

lldb::tid_t lldb_private::trace_intel_pt::ThreadContinuousExecution::tid

Definition at line 111 of file PerfContextSwitchDecoder.h.

◆ tscs

union { ... } lldb_private::trace_intel_pt::ThreadContinuousExecution::tscs

◆ variant

enum lldb_private::trace_intel_pt::ThreadContinuousExecution::Variant lldb_private::trace_intel_pt::ThreadContinuousExecution::variant

The documentation for this struct was generated from the following files: