From c41837842baf3e26878f50255cf009b0a85702ca Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Tue, 7 Jun 2022 11:50:12 -0700 Subject: [PATCH] wasm: drop pprof dependency We can use the browser tools to profile, pprof adds 200K to the binary size. Updates #3157 Signed-off-by: Mihai Parparita --- log/logheap/logheap.go | 3 +++ log/logheap/logheap_js.go | 8 ++++++++ wgengine/watchdog.go | 3 +++ wgengine/watchdog_js.go | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 log/logheap/logheap_js.go create mode 100644 wgengine/watchdog_js.go diff --git a/log/logheap/logheap.go b/log/logheap/logheap.go index f4a30bf69..2eb6a4924 100644 --- a/log/logheap/logheap.go +++ b/log/logheap/logheap.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !js +// +build !js + // Package logheap logs a heap pprof profile. package logheap diff --git a/log/logheap/logheap_js.go b/log/logheap/logheap_js.go new file mode 100644 index 000000000..9a6aab6b0 --- /dev/null +++ b/log/logheap/logheap_js.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package logheap + +func LogHeap(postURL string) { +} diff --git a/wgengine/watchdog.go b/wgengine/watchdog.go index 523cfda8d..a0c94797c 100644 --- a/wgengine/watchdog.go +++ b/wgengine/watchdog.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !js +// +build !js + package wgengine import ( diff --git a/wgengine/watchdog_js.go b/wgengine/watchdog_js.go new file mode 100644 index 000000000..1270c2e25 --- /dev/null +++ b/wgengine/watchdog_js.go @@ -0,0 +1,18 @@ +// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build js + +package wgengine + +import "tailscale.com/net/dns/resolver" + +type watchdogEngine struct { + Engine + wrap Engine +} + +func (e *watchdogEngine) GetResolver() (r *resolver.Resolver, ok bool) { + return nil, false +}