LLDB mainline
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.

References cpu_id, pid, and tid.

Referenced by CreateCompleteExecution(), CreateHintedEndExecution(), CreateHintedStartExecution(), CreateOnlyEndExecution(), and CreateOnlyStartExecution().

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, ThreadContinuousExecution(), 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

◆ CreateOnlyStartExecution()

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

◆ 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]

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

Referenced by CreateCompleteExecution().

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

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

◆ [struct] [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]

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

Referenced by CreateOnlyEndExecution().

◆ [struct]

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

◆ pid

◆ start

uint64_t lldb_private::trace_intel_pt::ThreadContinuousExecution::start

◆ tid

◆ [union]

◆ variant


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