mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 13:06:40 +00:00
error on minus evm time
This commit is contained in:
parent
0fc0b407f7
commit
01649de12e
1 changed files with 8 additions and 2 deletions
|
|
@ -28,10 +28,11 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/core/tracing"
|
"github.com/ethereum/go-ethereum/core/tracing"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/eth/tracers"
|
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||||
|
"github.com/ethereum/go-ethereum/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
tracers.LiveDirectory.Register("perfTracer", newPerfTracer)
|
tracers.LiveDirectory.Register("perf", newPerfTracer)
|
||||||
}
|
}
|
||||||
|
|
||||||
type perfTracerConfig struct {
|
type perfTracerConfig struct {
|
||||||
|
|
@ -127,8 +128,13 @@ func (t *perfTracer) OnTxEnd(receipt *types.Receipt, err error) {
|
||||||
accumulatedIO = t.statedb.GetAccumulatedIOMeasurements()
|
accumulatedIO = t.statedb.GetAccumulatedIOMeasurements()
|
||||||
ioTime = (accumulatedIO.AccountReads - t.prevAccountReads) +
|
ioTime = (accumulatedIO.AccountReads - t.prevAccountReads) +
|
||||||
(accumulatedIO.StorageReads - t.prevStorageReads)
|
(accumulatedIO.StorageReads - t.prevStorageReads)
|
||||||
evmTime = totalTime - ioTime
|
evmTime time.Duration
|
||||||
)
|
)
|
||||||
|
if ioTime > totalTime {
|
||||||
|
log.Error("PerfTracer: IO time exceeds total time", "ioTime", ioTime, "totalTime", totalTime)
|
||||||
|
} else {
|
||||||
|
evmTime = totalTime - ioTime
|
||||||
|
}
|
||||||
|
|
||||||
row := []string{
|
row := []string{
|
||||||
t.currentBlock.Number().String(),
|
t.currentBlock.Number().String(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue