LLDB  mainline
Enumerations | Functions | Variables
IntelPTManager.cpp File Reference
#include <algorithm>
#include <fstream>
#include <sstream>
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
#include "IntelPTManager.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "lldb/Host/linux/Support.h"
#include "lldb/Utility/StreamString.h"
#include <sys/ioctl.h>
#include <sys/syscall.h>
Include dependency graph for IntelPTManager.cpp:

Go to the source code of this file.

Enumerations

enum  IntelPTConfigFileType { Hex = 0, ZeroOne, Decimal, BitOffset }
 

Functions

static Expected< uint32_tReadIntelPTConfigFile (const char *file, IntelPTConfigFileType type)
 
static Expected< uint32_tGetOSEventType ()
 Return the Linux perf event type for Intel PT. More...
 
static Error CheckPsbPeriod (size_t psb_period)
 
static Expected< uint64_t > GeneratePerfEventConfigValue (bool enable_tsc, Optional< size_t > psb_period)
 

Variables

const char * kOSEventIntelPTTypeFile
 
const char * kPSBPeriodCapFile
 
const char * kPSBPeriodValidValuesFile
 
const char * kTSCBitOffsetFile
 
const char * kPSBPeriodBitOffsetFile
 

Enumeration Type Documentation

◆ IntelPTConfigFileType

Enumerator
Hex 
ZeroOne 
Decimal 
BitOffset 

Definition at line 45 of file IntelPTManager.cpp.

Function Documentation

◆ CheckPsbPeriod()

static Error CheckPsbPeriod ( size_t  psb_period)
static

◆ GeneratePerfEventConfigValue()

static Expected<uint64_t> GeneratePerfEventConfigValue ( bool  enable_tsc,
Optional< size_t >  psb_period 
)
static

◆ GetOSEventType()

static Expected<uint32_t> GetOSEventType ( )
static

◆ ReadIntelPTConfigFile()

static Expected<uint32_t> ReadIntelPTConfigFile ( const char *  file,
IntelPTConfigFileType  type 
)
static

Definition at line 56 of file IntelPTManager.cpp.

References BitOffset, Decimal, Hex, and ZeroOne.

Referenced by CheckPsbPeriod(), GeneratePerfEventConfigValue(), and GetOSEventType().

Variable Documentation

◆ kOSEventIntelPTTypeFile

const char* kOSEventIntelPTTypeFile
Initial value:
=
"/sys/bus/event_source/devices/intel_pt/type"

Definition at line 30 of file IntelPTManager.cpp.

Referenced by GetOSEventType().

◆ kPSBPeriodBitOffsetFile

const char* kPSBPeriodBitOffsetFile
Initial value:
=
"/sys/bus/event_source/devices/intel_pt/format/psb_period"

Definition at line 42 of file IntelPTManager.cpp.

Referenced by GeneratePerfEventConfigValue().

◆ kPSBPeriodCapFile

const char* kPSBPeriodCapFile
Initial value:
=
"/sys/bus/event_source/devices/intel_pt/caps/psb_cyc"

Definition at line 33 of file IntelPTManager.cpp.

Referenced by CheckPsbPeriod().

◆ kPSBPeriodValidValuesFile

const char* kPSBPeriodValidValuesFile
Initial value:
=
"/sys/bus/event_source/devices/intel_pt/caps/psb_periods"

Definition at line 36 of file IntelPTManager.cpp.

Referenced by CheckPsbPeriod().

◆ kTSCBitOffsetFile

const char* kTSCBitOffsetFile
Initial value:
=
"/sys/bus/event_source/devices/intel_pt/format/tsc"

Definition at line 39 of file IntelPTManager.cpp.

Referenced by GeneratePerfEventConfigValue().