go-ethereum/libevm/debug/api.go
Stephen Buttolph a13de95b66
feat: expose internal debug API handler (#255)
## Why this should be merged

This allows exposing a number of APIs exposed by Geth's [`debug`
namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).
Specifically:
-
[debug_blockProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugblockprofile)
- [debug_cpuProfile
](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugcpuprofile)
- [debug_freeOSMemory
](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugfreeosmemory)
-
[debug_gcStats](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debuggcstats)
- [debug_goTrace
](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debuggotrace)
-
[debug_memStats](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugmemstats)
-
[debug_mutexProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugmutexprofile)
-
[debug_setBlockProfileRate](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugsetblockprofilerate)
-
[debug_setGCPercent](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugsetgcpercent)
-
[debug_setMutexProfileFraction](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugsetmutexprofilefraction)
-
[debug_stacks](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugstacks)
-
[debug_startCPUProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugstartcpuprofile)
-
[debug_startGoTrace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugstartgotrace)
-
[debug_stopCPUProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugstopcpuprofile)
-
[debug_stopGoTrace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugstopgotrace)
-
[debug_verbosity](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugverbosity)
-
[debug_vmodule](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugvmodule)
-
[debug_writeBlockProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugwriteblockprofile)
-
[debug_writeMemProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugwritememprofile)
-
[debug_writeMutexProfile](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugwritemutexprofile)

Note: This is _not_ the full debug namespace.

## How this works

Simply re-exports the API, similarly to how the `ethapi`s are
re-exported.

## How this was tested

N/A
2026-01-04 10:22:16 -05:00

23 lines
983 B
Go

// Copyright 2026 the libevm authors.
//
// The libevm additions to go-ethereum are free software: you can redistribute
// them and/or modify them under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// The libevm additions are distributed in the hope that they will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see
// <http://www.gnu.org/licenses/>.
// Package debug exposes the internal debug package.
package debug
import "github.com/ava-labs/libevm/internal/debug"
// Handler is the debug API handler for tracking process level statistics.
var Handler = debug.Handler