Documentation
¶
Index ¶
- func AtomicUpdateMaxUint32(store *atomic.Uint32, newValue uint32)
- func DecToUint64(str string) uint64
- func HashString(s string) uint64
- func HexToUint64(str string) uint64
- func IsValidString(s string) bool
- func NextPowerOfTwo(v uint32) uint32
- func VersionUint(major, minor, patch uint32) uint32
- type KTime
- type OnDiskFileIdentifier
- type PID
- type Range
- type SourceLineno
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicUpdateMaxUint32 ¶
AtomicUpdateMaxUint32 updates the value in store using atomic memory primitives. newValue will only be placed in store if newValue is larger than the current value in store. To avoid inconsistency parallel updates to store should be avoided.
func DecToUint64 ¶
DecToUint64 is a convenience function to extract a decimal string to a uint64 and not worry about errors. Essentially a "mustConvertDecToUint64".
func HexToUint64 ¶
HexToUint64 is a convenience function to extract a hex string to a uint64 and not worry about errors. Essentially a "mustConvertHexToUint64".
func IsValidString ¶
IsValidString checks if string is UTF-8-encoded and only contains expected characters.
func NextPowerOfTwo ¶
NextPowerOfTwo returns the next highest power of 2 for a given value v or v, if v is a power of 2.
func VersionUint ¶
VersionUint returns a single integer composed of major, minor, patch.
Types ¶
type KTime ¶
type KTime int64
KTime stores a time value, retrieved from a monotonic clock, in nanoseconds
func GetKTime ¶
func GetKTime() KTime
GetKTime gets the current time in same nanosecond format as bpf_ktime_get_ns() eBPF call This relies runtime.nanotime to use CLOCK_MONOTONIC. If this changes, this needs to be adjusted accordingly. Using this internal is superior in performance, as it is able to use the vDSO to query the time without syscall.
type OnDiskFileIdentifier ¶
type OnDiskFileIdentifier struct {
DeviceID uint64 // dev_t as reported by stat.
InodeNum uint64 // ino_t should fit into 64 bits
}
OnDiskFileIdentifier can be used as unique identifier for a file. It is a structure to identify a particular file on disk by deviceID and inode number.
func (OnDiskFileIdentifier) Hash32 ¶
func (odfi OnDiskFileIdentifier) Hash32() uint32
type SourceLineno ¶
type SourceLineno uint64
SourceLineno represents a line number within a source file. It is intended to be used for the source line numbers associated with offsets in native code, or for source line numbers in interpreted code.