asyncprofiler

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFdtransfer

func RunFdtransfer(fdtransferPath string, pid int) error

RunFdtransfer runs the fdtransfer command to start the fdtransfer server. Note that the client is part of the libasyncprofielr.so binary. The client connects to the fdtransfer server using a Unix domain socket and sends a request to the server for a file descriptor, specifying the type of the request (e.g., PERF_FD for perf_event_open()). The server processes the request, opens the file descriptor, and sends it back to the client using Unix domain socket with ancillary data (SCM_RIGHTS). The client receives the file descriptor and can use it for further operations.

Types

type Action

type Action string

Action represents the various actions available for AsyncProfiler.

type AsyncProfiler

type AsyncProfiler struct {
	// contains filtered or unexported fields
}

func NewAsyncProfiler

func NewAsyncProfiler(jattachPath, libasyncPath string, pid int, opts ...func(*AsyncProfiler)) *AsyncProfiler

TODO: Move this to profiler package NewAsyncProfiler initializes a new AsyncProfiler instance with the given paths, process ID, event type, and duration.

func (*AsyncProfiler) BuildCommand

func (p *AsyncProfiler) BuildCommand(ctx context.Context) (*exec.Cmd, error)

BuildCommand builds the command to be executed to run AsyncProfiler.

func (*AsyncProfiler) SetAction

func (p *AsyncProfiler) SetAction(action string, options ...ProfilerOptions) error

type ProfilerOption

type ProfilerOption func(*AsyncProfiler)

func WithDuration

func WithDuration(duration string) ProfilerOption

func WithEventType

func WithEventType(eventType string) ProfilerOption

func WithOutputFile

func WithOutputFile(outputFile string) ProfilerOption

type ProfilerOptions

type ProfilerOptions map[string]string

Jump to

Keyboard shortcuts

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