From 73fe5bffafcd1ed39706a7618b52780a625112ce Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 4 Dec 2023 07:48:48 -0800 Subject: [PATCH] gvisor: update traceBlockReason for new runtime tracer The definition for the new constant values lives upstream at: https://cs.opensource.google/go/go/+/master:src/runtime/trace2runtime.go;l=77-102;drc=b6b72c775ab562c632abf5d93e8c541385edfffc PiperOrigin-RevId: 587718645 --- pkg/sync/BUILD | 1 + pkg/sync/runtime_exectracer1.go | 2 ++ pkg/sync/runtime_exectracer2.go | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 pkg/sync/runtime_exectracer2.go diff --git a/pkg/sync/BUILD b/pkg/sync/BUILD index ad01e913e..262a91a23 100644 --- a/pkg/sync/BUILD +++ b/pkg/sync/BUILD @@ -28,6 +28,7 @@ go_library( "runtime_amd64.go", "runtime_constants.go", "runtime_exectracer1.go", + "runtime_exectracer2.go", "runtime_go121_unsafe.go", "runtime_not_go121_unsafe.go", "runtime_other.go", diff --git a/pkg/sync/runtime_exectracer1.go b/pkg/sync/runtime_exectracer1.go index 33af525bd..e35e5cf85 100644 --- a/pkg/sync/runtime_exectracer1.go +++ b/pkg/sync/runtime_exectracer1.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !goexperiment.exectracer2 + package sync // TraceBlockReason constants, from Go's src/runtime/trace.go. diff --git a/pkg/sync/runtime_exectracer2.go b/pkg/sync/runtime_exectracer2.go new file mode 100644 index 000000000..4ec3baf97 --- /dev/null +++ b/pkg/sync/runtime_exectracer2.go @@ -0,0 +1,23 @@ +// Copyright 2023 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build goexperiment.exectracer2 + +package sync + +// TraceBlockReason constants, from Go's src/runtime/trace2runtime.go. +const ( + TraceBlockSelect TraceBlockReason = 3 // +checkconst runtime traceBlockSelect + TraceBlockSync = 5 // +checkconst runtime traceBlockSync +)