diff --git a/pkg/kv/db.go b/pkg/kv/db.go index a0d193fc5ae1..cb3376eae96a 100644 --- a/pkg/kv/db.go +++ b/pkg/kv/db.go @@ -24,7 +24,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/cockroach/pkg/util/retry" "github.com/cockroachdb/cockroach/pkg/util/stop" - "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" ) @@ -792,7 +791,6 @@ func (db *DB) sendUsingSender( ba.UserPriority = db.ctx.UserPriority } - tracing.AnnotateTrace() br, pErr := sender.Send(ctx, ba) if pErr != nil { if log.V(1) { diff --git a/pkg/kv/kvclient/kvcoord/dist_sender.go b/pkg/kv/kvclient/kvcoord/dist_sender.go index 1b02bf571174..96b52914b685 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender.go @@ -717,7 +717,6 @@ func unsetCanForwardReadTimestampFlag(ctx context.Context, ba *roachpb.BatchRequ func (ds *DistSender) Send( ctx context.Context, ba roachpb.BatchRequest, ) (*roachpb.BatchResponse, *roachpb.Error) { - tracing.AnnotateTrace() ds.incrementBatchCounters(&ba) // TODO(nvanbenschoten): This causes ba to escape to the heap. Either diff --git a/pkg/kv/txn.go b/pkg/kv/txn.go index 460d44a125c3..fc6357bfbf50 100644 --- a/pkg/kv/txn.go +++ b/pkg/kv/txn.go @@ -22,7 +22,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/cockroach/pkg/util/syncutil" - "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/errors" ) @@ -582,8 +581,6 @@ func (txn *Txn) DelRange(ctx context.Context, begin, end interface{}) error { // operation. The order of the results matches the order the operations were // added to the batch. func (txn *Txn) Run(ctx context.Context, b *Batch) error { - tracing.AnnotateTrace() - defer tracing.AnnotateTrace() if err := b.prepare(); err != nil { return err } diff --git a/pkg/sql/delete.go b/pkg/sql/delete.go index 2917bc1bc737..26a73ba2537d 100644 --- a/pkg/sql/delete.go +++ b/pkg/sql/delete.go @@ -18,7 +18,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/row" "github.com/cockroachdb/cockroach/pkg/sql/rowcontainer" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" - "github.com/cockroachdb/cockroach/pkg/util/tracing" ) var deleteNodePool = sync.Pool{ @@ -91,8 +90,6 @@ func (d *deleteNode) BatchedNext(params runParams) (bool, error) { return false, nil } - tracing.AnnotateTrace() - // Advance one batch. First, clear the last batch. d.run.td.clearLastBatch(params.ctx) // Now consume/accumulate the rows for this batch. diff --git a/pkg/sql/insert.go b/pkg/sql/insert.go index 5e8d5a45e44d..47b6521502b0 100644 --- a/pkg/sql/insert.go +++ b/pkg/sql/insert.go @@ -19,7 +19,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/row" "github.com/cockroachdb/cockroach/pkg/sql/rowcontainer" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" - "github.com/cockroachdb/cockroach/pkg/util/tracing" ) var insertNodePool = sync.Pool{ @@ -206,8 +205,6 @@ func (n *insertNode) BatchedNext(params runParams) (bool, error) { return false, nil } - tracing.AnnotateTrace() - // Advance one batch. First, clear the last batch. n.run.ti.clearLastBatch(params.ctx) diff --git a/pkg/sql/insert_fast_path.go b/pkg/sql/insert_fast_path.go index 3c7878786877..f1e0015d182c 100644 --- a/pkg/sql/insert_fast_path.go +++ b/pkg/sql/insert_fast_path.go @@ -27,7 +27,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/span" "github.com/cockroachdb/cockroach/pkg/util/log" - "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" ) @@ -268,8 +267,6 @@ func (n *insertFastPathNode) BatchedNext(params runParams) (bool, error) { return false, nil } - tracing.AnnotateTrace() - // The fast path node does everything in one batch. for rowIdx, tupleRow := range n.input { diff --git a/pkg/sql/pgwire/BUILD.bazel b/pkg/sql/pgwire/BUILD.bazel index 02e54caf8432..ffcd2656804a 100644 --- a/pkg/sql/pgwire/BUILD.bazel +++ b/pkg/sql/pgwire/BUILD.bazel @@ -50,7 +50,6 @@ go_library( "//pkg/util/timeofday", "//pkg/util/timetz", "//pkg/util/timeutil", - "//pkg/util/tracing", "@com_github_cockroachdb_apd_v2//:apd", "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_logtags//:logtags", diff --git a/pkg/sql/pgwire/conn.go b/pkg/sql/pgwire/conn.go index ffd449294356..cc2c09319d3a 100644 --- a/pkg/sql/pgwire/conn.go +++ b/pkg/sql/pgwire/conn.go @@ -37,7 +37,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/mon" "github.com/cockroachdb/cockroach/pkg/util/timeutil" - "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" "github.com/cockroachdb/logtags" "github.com/lib/pq/oid" @@ -705,8 +704,6 @@ func (c *conn) handleSimpleQuery( return c.stmtBuf.Push(ctx, sql.SendError{Err: err}) } - tracing.AnnotateTrace() - startParse := timeutil.Now() stmts, err := c.parser.ParseWithInt(query, unqualifiedIntSize) if err != nil { diff --git a/pkg/sql/update.go b/pkg/sql/update.go index bfce38bda461..2a6097e253a6 100644 --- a/pkg/sql/update.go +++ b/pkg/sql/update.go @@ -22,7 +22,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/rowcontainer" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlerrors" - "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" ) @@ -149,8 +148,6 @@ func (u *updateNode) BatchedNext(params runParams) (bool, error) { return false, nil } - tracing.AnnotateTrace() - // Advance one batch. First, clear the last batch. u.run.tu.clearLastBatch(params.ctx) diff --git a/pkg/sql/upsert.go b/pkg/sql/upsert.go index 57987f58c2b2..cc2741e8ec23 100644 --- a/pkg/sql/upsert.go +++ b/pkg/sql/upsert.go @@ -18,7 +18,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/row" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" - "github.com/cockroachdb/cockroach/pkg/util/tracing" ) var upsertNodePool = sync.Pool{ @@ -77,8 +76,6 @@ func (n *upsertNode) BatchedNext(params runParams) (bool, error) { return false, nil } - tracing.AnnotateTrace() - // Advance one batch. First, clear the last batch. n.run.tw.clearLastBatch(params.ctx) diff --git a/pkg/util/tracing/BUILD.bazel b/pkg/util/tracing/BUILD.bazel index 903a9b080407..333f2c2632be 100644 --- a/pkg/util/tracing/BUILD.bazel +++ b/pkg/util/tracing/BUILD.bazel @@ -3,8 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "tracing", srcs = [ - "annotate.go", - "annotate_nocgo.go", "context.go", "grpc_interceptor.go", "recording.go", @@ -15,7 +13,6 @@ go_library( "test_utils.go", "tracer.go", ], - cgo = True, importpath = "github.com/cockroachdb/cockroach/pkg/util/tracing", visibility = ["//visibility:public"], deps = [ diff --git a/pkg/util/tracing/annotate.go b/pkg/util/tracing/annotate.go deleted file mode 100644 index 5457ecb84542..000000000000 --- a/pkg/util/tracing/annotate.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package tracing - -// static void annotateTrace() { -// } -import "C" - -import "github.com/cockroachdb/cockroach/pkg/util/envutil" - -var annotationEnabled = envutil.EnvOrDefaultBool("COCKROACH_ANNOTATE_TRACES", false) - -// AnnotateTrace adds an annotation to the golang executation tracer by calling -// a no-op cgo function. -func AnnotateTrace() { - if annotationEnabled { - C.annotateTrace() - } -} diff --git a/pkg/util/tracing/annotate_nocgo.go b/pkg/util/tracing/annotate_nocgo.go deleted file mode 100644 index f13b50bbcc72..000000000000 --- a/pkg/util/tracing/annotate_nocgo.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -// +build !cgo - -package tracing - -// AnnotateTrace adds an annotation to the golang executation tracer by calling -// a no-op cgo function. -func AnnotateTrace() { -}