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>

Public Types

enum class  Variant {
  Complete , HintedStart , HintedEnd , OnlyStart ,
  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.
 
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.
 

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 146 of file PerfContextSwitchDecoder.cpp.

References Complete, complete, cpu_id, end, pid, start, tid, tscs, and variant.

Referenced by RecoverExecutionsFromConsecutiveRecords().

◆ 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

◆ 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

◆ 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 176 of file PerfContextSwitchDecoder.cpp.

References cpu_id, end, only_end, OnlyEnd, pid, tid, tscs, and variant.

Referenced by RecoverExecutionsFromConsecutiveRecords().

◆ 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 184 of file PerfContextSwitchDecoder.cpp.

References cpu_id, only_start, OnlyStart, pid, start, tid, 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 131 of file PerfContextSwitchDecoder.cpp.

References Complete, HintedEnd, HintedStart, OnlyEnd, OnlyStart, tscs, and variant.

◆ GetLowestKnownTSC()

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

Definition at line 101 of file PerfContextSwitchDecoder.cpp.

References Complete, HintedEnd, HintedStart, OnlyEnd, OnlyStart, tscs, and variant.

◆ GetStartTSC()

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

Definition at line 116 of file PerfContextSwitchDecoder.cpp.

References Complete, HintedEnd, HintedStart, OnlyEnd, OnlyStart, tscs, and variant.

Member Data Documentation

◆ 

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

◆ end

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::end

◆ 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().

◆  [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().

◆  [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.

◆ 

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

Referenced by CreateOnlyEndExecution().

◆ 

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

◆ pid

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

◆ start

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::start

◆ tid

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

◆ 

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: