Documentation ¶
Index ¶
- Constants
- func ClockTicksToNsSinceBootTime(ticks int64) uint64
- func GetBootTime(clockID int32) time.Time
- func GetBootTimeNS(clockID int32) int64
- func GetStartTimeNS(clockID int32) int64
- func GetSystemHZ() int
- func GetUserHZ() int64
- func NsSinceBootTimeToTime(clockID int32, ns uint64) time.Time
- func NsSinceEpochToTime(ns uint64) time.Time
- type AbsoluteTimeNormalizer
- type RelativeTimeNormalizer
- type TimeNormalizer
Constants ¶
const ( CLOCK_MONOTONIC = unix.CLOCK_MONOTONIC // Time since a boot (not including time spent in suspend) CLOCK_BOOTTIME = unix.CLOCK_BOOTTIME // Time since a boot (including time spent in suspend) )
Common clock IDs
Variables ¶
This section is empty.
Functions ¶
func ClockTicksToNsSinceBootTime ¶
ClockTicksToNsSinceBootTime converts kernel clock ticks to nanoseconds.
func GetBootTime ¶
func GetBootTimeNS ¶
GetBootTimeNS returns the boot time of the system in nanoseconds.
func GetStartTimeNS ¶
GetStartTimeNS returns the elapsed time since system start in nanoseconds. Possible to retrieve from two differents clocks: CLOCK_MONOTONIC or CLOCK_BOOTTIME.
func GetSystemHZ ¶
func GetSystemHZ() int
GetSystemHZ returns an approximation of CONFIG_HZ (the kernel timer interrupt).
func GetUserHZ ¶
func GetUserHZ() int64
GetUserHZ returns USER_HZ (the user-space timer interrupt), the system clock tick rate.
func NsSinceBootTimeToTime ¶
NsSinceBootTimeToTime converts nanoseconds timestamp (since boot) to a time.Time object.
func NsSinceEpochToTime ¶
Types ¶
type AbsoluteTimeNormalizer ¶
type AbsoluteTimeNormalizer struct {
// contains filtered or unexported fields
}
AbsoluteTimeNormalizer normalize the time to be absolute time since epoch
func NewAbsoluteTimeNormalizer ¶
func NewAbsoluteTimeNormalizer(bootTime int) *AbsoluteTimeNormalizer
func (*AbsoluteTimeNormalizer) GetOriginalTime ¶
func (rn *AbsoluteTimeNormalizer) GetOriginalTime(timeNs int) int
func (*AbsoluteTimeNormalizer) NormalizeTime ¶
func (rn *AbsoluteTimeNormalizer) NormalizeTime(timeNs int) int
type RelativeTimeNormalizer ¶
type RelativeTimeNormalizer struct {
// contains filtered or unexported fields
}
RelativeTimeNormalizer normalize the time to be relative to Tracee start time
func NewRelativeTimeNormalizer ¶
func NewRelativeTimeNormalizer(startTime int) *RelativeTimeNormalizer
func (*RelativeTimeNormalizer) GetOriginalTime ¶
func (rn *RelativeTimeNormalizer) GetOriginalTime(timeNs int) int
func (*RelativeTimeNormalizer) NormalizeTime ¶
func (rn *RelativeTimeNormalizer) NormalizeTime(timeNs int) int
type TimeNormalizer ¶
TimeNormalizer normalizes the time to be relative to tracee start time or current time in nanoseconds.
func CreateTimeNormalizerByConfig ¶
func CreateTimeNormalizerByConfig(relative bool, startTime uint64, bootTime uint64) TimeNormalizer
CreateTimeNormalizerByConfig create a TimeNormalizer according to given configuration using runtime functions.