mirror of https://github.com/k3s-io/k3s
30 lines
607 B
Go
30 lines
607 B
Go
package etw
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
type eventDataDescriptorType uint8
|
|
|
|
const (
|
|
eventDataDescriptorTypeUserData eventDataDescriptorType = iota
|
|
eventDataDescriptorTypeEventMetadata
|
|
eventDataDescriptorTypeProviderMetadata
|
|
)
|
|
|
|
type eventDataDescriptor struct {
|
|
ptr ptr64
|
|
size uint32
|
|
dataType eventDataDescriptorType
|
|
reserved1 uint8
|
|
reserved2 uint16
|
|
}
|
|
|
|
func newEventDataDescriptor(dataType eventDataDescriptorType, buffer []byte) eventDataDescriptor {
|
|
return eventDataDescriptor{
|
|
ptr: ptr64{ptr: unsafe.Pointer(&buffer[0])},
|
|
size: uint32(len(buffer)),
|
|
dataType: dataType,
|
|
}
|
|
}
|