From 5639fc1ff86b99d164de73babbb3e685d6b73d7a Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Sat, 13 May 2023 00:52:10 +0100 Subject: [PATCH] Update wzprof. --- go.mod | 2 +- go.sum | 4 ++-- sqlite3vfs/tests/speedtest1/speedtest1_test.go | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 2f2745c..0bf3dd5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ncruces/julianday v0.1.5 github.com/psanford/httpreadat v0.1.0 - github.com/stealthrocket/wzprof v0.1.1 + github.com/stealthrocket/wzprof v0.1.3 github.com/tetratelabs/wazero v1.1.1-0.20230511035210-78c35acd6e1c golang.org/x/sync v0.2.0 golang.org/x/sys v0.8.0 diff --git a/go.sum b/go.sum index 84b4285..2289ab7 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/ncruces/julianday v0.1.5 h1:hDJ9ejiMp3DHsoZ5KW4c1lwfMjbARS7u/gbYcd0FB github.com/ncruces/julianday v0.1.5/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/psanford/httpreadat v0.1.0 h1:VleW1HS2zO7/4c7c7zNl33fO6oYACSagjJIyMIwZLUE= github.com/psanford/httpreadat v0.1.0/go.mod h1:Zg7P+TlBm3bYbyHTKv/EdtSJZn3qwbPwpfZ/I9GKCRE= -github.com/stealthrocket/wzprof v0.1.1 h1:/qhSauOzXda4W5rEm+Gj2o2cKRZQqtGBPAulPflRwWk= -github.com/stealthrocket/wzprof v0.1.1/go.mod h1:UxCYAWsxjUKpIzJV8Pl5Yyo2QkQwsL29GdaoA38cXKU= +github.com/stealthrocket/wzprof v0.1.3 h1:zG1W2AuyvKHe+0YGYS8o9WNYsaaadZhQYHGbFrgfYAs= +github.com/stealthrocket/wzprof v0.1.3/go.mod h1:UxCYAWsxjUKpIzJV8Pl5Yyo2QkQwsL29GdaoA38cXKU= github.com/tetratelabs/wazero v1.1.1-0.20230511035210-78c35acd6e1c h1:3vKw5AyUv+16qm9tIVfvm205aDIpDmrjxPydJ87GBKY= github.com/tetratelabs/wazero v1.1.1-0.20230511035210-78c35acd6e1c/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= diff --git a/sqlite3vfs/tests/speedtest1/speedtest1_test.go b/sqlite3vfs/tests/speedtest1/speedtest1_test.go index 575c6f6..ea13fff 100644 --- a/sqlite3vfs/tests/speedtest1/speedtest1_test.go +++ b/sqlite3vfs/tests/speedtest1/speedtest1_test.go @@ -35,8 +35,6 @@ var ( memprof string ) -const defaultSampleRate = 1.0 / 19 - func TestMain(m *testing.M) { initFlags() @@ -101,12 +99,12 @@ func setupProfiling(ctx context.Context) (context.Context, *wzprof.CPUProfiler, var listeners []experimental.FunctionListenerFactory if cpuprof != "" { cpu = wzprof.NewCPUProfiler() - listeners = append(listeners, wzprof.Sample(defaultSampleRate, cpu)) + listeners = append(listeners, cpu) cpu.StartProfile() } if memprof != "" { mem = wzprof.NewMemoryProfiler() - listeners = append(listeners, wzprof.Sample(defaultSampleRate, mem)) + listeners = append(listeners, mem) } if listeners != nil { ctx = context.WithValue(ctx, @@ -127,7 +125,7 @@ func saveProfiles(module wazero.CompiledModule, cpu *wzprof.CPUProfiler, mem *wz } if cpu != nil { - prof := cpu.StopProfile(defaultSampleRate, symbols) + prof := cpu.StopProfile(1, symbols) err := wzprof.WriteProfile(cpuprof, prof) if err != nil { panic(err) @@ -135,7 +133,7 @@ func saveProfiles(module wazero.CompiledModule, cpu *wzprof.CPUProfiler, mem *wz } if mem != nil { - prof := mem.NewProfile(defaultSampleRate, symbols) + prof := mem.NewProfile(1, symbols) err := wzprof.WriteProfile(memprof, prof) if err != nil { panic(err)