debug

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: LGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandHome

func ExpandHome(p string) (string, error)

ExpandHome expands home directory in file paths. ~someuser/tmp will not be expanded.

Types

type API

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

API is the collection of tracing APIs exposed over the private debugging endpoint.

func NewAPI

func NewAPI(
	ctx *server.Context,
	backend backend.EVMBackend,
) *API

NewAPI creates a new API definition for the tracing methods of the Ethereum service.

func (*API) BlockProfile

func (a *API) BlockProfile(file string, nsec uint) error

BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.

func (*API) CpuProfile

func (a *API) CpuProfile(file string, nsec uint) error

CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.

func (*API) FreeOSMemory

func (a *API) FreeOSMemory()

FreeOSMemory forces a garbage collection.

func (*API) GcStats

func (a *API) GcStats() *debug.GCStats

GcStats returns GC statistics.

func (*API) GetBlockRlp

func (a *API) GetBlockRlp(number uint64) (hexutil.Bytes, error)

GetBlockRlp retrieves the RLP encoded for of a single block.

func (*API) GetHeaderRlp

func (a *API) GetHeaderRlp(number uint64) (hexutil.Bytes, error)

GetHeaderRlp retrieves the RLP encoded for of a single header.

func (*API) GoTrace

func (a *API) GoTrace(file string, nsec uint) error

GoTrace turns on tracing for nsec seconds and writes trace data to file.

func (*API) IntermediateRoots

func (a *API) IntermediateRoots(hash common.Hash, _ *evmtypes.TraceConfig) ([]common.Hash, error)

IntermediateRoots executes a block, and returns a list of intermediate roots: the stateroot after each transaction.

func (*API) MemStats

func (a *API) MemStats() *runtime.MemStats

MemStats returns detailed runtime memory statistics.

func (*API) MutexProfile

func (a *API) MutexProfile(file string, nsec uint) error

MutexProfile turns on mutex profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.

func (*API) PrintBlock

func (a *API) PrintBlock(number uint64) (string, error)

PrintBlock retrieves a block and returns its pretty printed form.

func (*API) SeedHash

func (a *API) SeedHash(number uint64) (string, error)

SeedHash retrieves the seed hash of a block.

func (*API) SetBlockProfileRate

func (a *API) SetBlockProfileRate(rate int)

SetBlockProfileRate sets the rate of goroutine block profile data collection. rate 0 disables block profiling.

func (*API) SetGCPercent

func (a *API) SetGCPercent(v int) int

SetGCPercent sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.

func (*API) SetMutexProfileFraction

func (a *API) SetMutexProfileFraction(rate int)

SetMutexProfileFraction sets the rate of mutex profiling.

func (*API) Stacks

func (a *API) Stacks() string

Stacks returns a printed representation of the stacks of all goroutines.

func (*API) StartCPUProfile

func (a *API) StartCPUProfile(file string) error

StartCPUProfile turns on CPU profiling, writing to the given file.

func (*API) StartGoTrace

func (a *API) StartGoTrace(file string) error

StartGoTrace turns on tracing, writing to the given file.

func (*API) StopCPUProfile

func (a *API) StopCPUProfile() error

StopCPUProfile stops an ongoing CPU profile.

func (*API) StopGoTrace

func (a *API) StopGoTrace() error

StopGoTrace stops an ongoing trace.

func (*API) TraceBlockByHash

func (a *API) TraceBlockByHash(hash common.Hash, config *evmtypes.TraceConfig) ([]*evmtypes.TxTraceResult, error)

TraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*API) TraceBlockByNumber

func (a *API) TraceBlockByNumber(height rpctypes.BlockNumber, config *evmtypes.TraceConfig) ([]*evmtypes.TxTraceResult, error)

TraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*API) TraceTransaction

func (a *API) TraceTransaction(hash common.Hash, config *evmtypes.TraceConfig) (interface{}, error)

TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*API) WriteBlockProfile

func (a *API) WriteBlockProfile(file string) error

WriteBlockProfile writes a goroutine blocking profile to the given file.

func (*API) WriteMemProfile

func (a *API) WriteMemProfile(file string) error

WriteMemProfile writes an allocation profile to the given file. Note that the profiling rate cannot be set through the API, it must be set on the command line.

func (*API) WriteMutexProfile

func (a *API) WriteMutexProfile(file string) error

WriteMutexProfile writes a goroutine blocking profile to the given file.

type HandlerT

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

HandlerT keeps track of the cpu profiler and trace execution

Jump to

Keyboard shortcuts

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