Documentation ¶
Index ¶
Constants ¶
const ( Unspec int = iota TSDBase TSDElementBase TSDIndex TSDValue TSDConstant )
Variables ¶
This section is empty.
Functions ¶
func AnalyzeAoutDumpDebugregs ¶
AnalyzeAoutDumpDebugregs looks at the assembly of the `aout_dump_debugregs` function in the kernel in order to compute the offset of `fsbase` into `task_struct`.
func AnalyzeTLSSetARM64 ¶
AnalyzeTLSSet looks at the assembly of the `tls_set` function in the kernel in order to compute the offset of `tp_value` into `task_struct`.
func AnalyzeX86fsbaseWriteTask ¶
AnalyzeX86fsbaseWriteTask looks at the assembly of the function x86_fsbase_write_task which is ideal because it only writes the argument to the fsbase function. We can get the fsbase offset directly from the assembly here. Available since kernel version 4.20.
func IsPotentialTSDDSO ¶
IsPotentialTSDDSO determines if the DSO filename potentially contains pthread code
Types ¶
type Analyzer ¶
type Analyzer struct { // FunctionName is the kernel function which can be analyzed FunctionName string // Analyze can inspect the kernel function mentioned above for the Thread Pointer Base Analyze func([]byte) (uint32, error) }
func GetAnalyzers ¶
func GetAnalyzers() []Analyzer
type TSDInfo ¶
type TSDInfo struct { // Offset is the pointer difference from "tpbase" pointer to the C-library // specific struct pthread's member containing the thread specific data: // .tsd (musl) or .specific (glibc). // Note: on x86_64 it's positive value, and arm64 it is negative value as // "tpbase" register has different purpose and pointer value per platform ABI. Offset int16 // Multiplier is the TSD specific value array element size. // Typically 8 bytes on 64bit musl and 16 bytes on 64bit glibc Multiplier uint8 // Indirect is a flag indicating if the "tpbase + Offset" points to a member // which is a pointer the array (musl) and not the array itself (glibc). Indirect uint8 }
TSDInfo contains information to access C-library's Thread Specific Data from eBPF
func ExtractTSDInfo ¶
ExtractTSDInfo extracts the introspection data for pthread thread specific data.