hrlog

package
v0.0.0-...-1e60831 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 15 Imported by: 0

README

ndn-dpdk/app/hrlog

This package implements a high resolution logger for per-packet tracing.

Activation

User should invoke NewWriter function or GraphQL createHrlogWriter mutation to start collecting log entries to a file, and invoke writer.Close function or GraphQL delete mutation to stop. Only one collection can run at any moment. Log entries posted when collection is not running are lost.

Log File Format

The log file starts with a 16-byte header, followed by 8-byte entries.

The header has three fields:

  1. 32-bit magic number 0x35f0498a, written in native endianness. If this number appears endian-swapped, the reader shall swap all other multi-byte numbers.
  2. 32-bit version number. See entry.h. This is incremented whenever action types have a backwards incompatible change.
  3. 64-bit TSCHZ. This is "1 second" represented in TSC duration unit.

Each entry has three fields:

  1. 48-bit value. If this is a duration, it is in TSC unit.
  2. 8-bit lcore id.
  3. 8-bit action type. See entry.h.

Documentation

Overview

Package hrlog writes high resolution tracing logs.

Index

Constants

View Source
const Role = "HRLOG"

Role is writer thread role name.

Variables

View Source
var (
	ErrDisabled  = errors.New("hrlog module disabled")
	ErrQueueFull = errors.New("too many pending tasks")
	ErrWriter    = errors.New("writer failed")
)

Error conditions.

View Source
var (
	// GqlLCore is the LCore used for writer created via GraphQL.
	GqlLCore eal.LCore
)
View Source
var (
	GqlWriterType *gqlserver.NodeType[*Writer]
)

GraphQL types.

Functions

func Post

func Post(rs *urcu.ReadSide, entries []uint64)

Post posts entries to the hrlog collector.

Types

type Writer

type Writer struct {
	ealthread.ThreadWithCtrl
	// contains filtered or unexported fields
}

Writer is a hrlog writer thread.

var TheWriter *Writer

TheWriter is the current Writer instance.

func NewWriter

func NewWriter(cfg WriterConfig) (w *Writer, e error)

NewWriter creates a hrlog writer thread.

func (*Writer) Close

func (w *Writer) Close() error

Close releases resources.

func (Writer) ThreadRole

func (Writer) ThreadRole() string

ThreadRole implements ealthread.ThreadWithRole interface.

type WriterConfig

type WriterConfig struct {
	Filename     string
	Count        int
	RingCapacity int
	Socket       eal.NumaSocket
}

WriterConfig contains writer configuration.

Directories

Path Synopsis
Package hrlogreader reads high resolution tracing logs.
Package hrlogreader reads high resolution tracing logs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL