Skip to content

Commit 98617fd

Browse files
dolmengopherbot
authored andcommitted
runtime/trace: add godoc links
Change-Id: I6db8ce8d7e0a1cb3d955493fa49eb7dff372eb38 Reviewed-on: https://go-review.googlesource.com/c/go/+/504375 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent bc21d6a commit 98617fd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/runtime/trace/annotation.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type traceContextKey struct{}
2121
// like the Go execution tracer may assume there are only a bounded
2222
// number of unique task types in the system.
2323
//
24-
// The returned Task's End method is used to mark the task's end.
24+
// The returned Task's [Task.End] method is used to mark the task's end.
2525
// The trace tool measures task latency as the time between task creation
2626
// and when the End method is called, and provides the latency
2727
// distribution per task type.
@@ -75,7 +75,7 @@ type Task struct {
7575
// TODO(hyangah): record parent id?
7676
}
7777

78-
// End marks the end of the operation represented by the Task.
78+
// End marks the end of the operation represented by the [Task].
7979
func (t *Task) End() {
8080
userTaskEnd(t.id)
8181
}
@@ -97,7 +97,7 @@ func Log(ctx context.Context, category, message string) {
9797
userLog(id, category, message)
9898
}
9999

100-
// Logf is like Log, but the value is formatted using the specified format spec.
100+
// Logf is like [Log], but the value is formatted using the specified format spec.
101101
func Logf(ctx context.Context, category, format string, args ...any) {
102102
if IsEnabled() {
103103
// Ideally this should be just Log, but that will
@@ -142,7 +142,7 @@ func WithRegion(ctx context.Context, regionType string, fn func()) {
142142
}
143143

144144
// StartRegion starts a region and returns it.
145-
// The returned Region's End method must be called
145+
// The returned Region's [Region.End] method must be called
146146
// from the same goroutine where the region was started.
147147
// Within each goroutine, regions must nest. That is, regions started
148148
// after this region must be ended before this region can be ended.

src/runtime/trace/trace.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//
3434
// import _ "net/http/pprof"
3535
//
36-
// See the net/http/pprof package for more details about all of the
36+
// See the [net/http/pprof] package for more details about all of the
3737
// debug endpoints installed by this import.
3838
//
3939
// # User annotation
@@ -44,11 +44,11 @@
4444
// There are three types of user annotations: log messages, regions,
4545
// and tasks.
4646
//
47-
// Log emits a timestamped message to the execution trace along with
47+
// [Log] emits a timestamped message to the execution trace along with
4848
// additional information such as the category of the message and
49-
// which goroutine called Log. The execution tracer provides UIs to filter
49+
// which goroutine called [Log]. The execution tracer provides UIs to filter
5050
// and group goroutines using the log category and the message supplied
51-
// in Log.
51+
// in [Log].
5252
//
5353
// A region is for logging a time interval during a goroutine's execution.
5454
// By definition, a region starts and ends in the same goroutine.
@@ -72,10 +72,10 @@
7272
// operations such as an RPC request, an HTTP request, or an
7373
// interesting local operation which may require multiple goroutines
7474
// working together. Since tasks can involve multiple goroutines,
75-
// they are tracked via a context.Context object. NewTask creates
76-
// a new task and embeds it in the returned context.Context object.
75+
// they are tracked via a [context.Context] object. [NewTask] creates
76+
// a new task and embeds it in the returned [context.Context] object.
7777
// Log messages and regions are attached to the task, if any, in the
78-
// Context passed to Log and WithRegion.
78+
// Context passed to [Log] and [WithRegion].
7979
//
8080
// For example, assume that we decided to froth milk, extract coffee,
8181
// and mix milk and coffee in separate goroutines. With a task,

0 commit comments

Comments
 (0)