Source File
doc.go
Belonging Package
internal/trace/raw
// Copyright 2023 The Go 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 raw provides an interface to interpret and emit Go execution traces.It can interpret and emit execution traces in its wire format as well as abespoke but simple text format.The readers and writers in this package perform no validation on or ordering ofthe input, and so are generally unsuitable for analysis. However, they're veryuseful for testing and debugging the tracer in the runtime and more sophisticatedtrace parsers.# Text format specificationThe trace text format produced and consumed by this package is a line-orientedformat.The first line in each text trace is the header line.Trace Go1.XXFollowing that is a series of event lines. Each event begins with anevent name, followed by zero or more named unsigned integer arguments.Names are separated from their integer values by an '=' sign. Names canconsist of any UTF-8 character except '='.For example:EventName arg1=23 arg2=55 arg3=53Any amount of whitespace is allowed to separate each token. Whitespaceis identified via unicode.IsSpace.Some events have additional data on following lines. There are two suchspecial cases.The first special case consists of events with trailing byte-oriented data.The trailer begins on the following line from the event. That line consistsof a single argument 'data' and a Go-quoted string representing the byte datawithin. Note: an explicit argument for the length is elided, because it'sjust the length of the unquoted string.For example:String id=5data="hello world\x00"These events are identified in their spec by the HasData flag.The second special case consists of stack events. These events are identifiedby the IsStack flag. These events also have a trailing unsigned integer argumentdescribing the number of stack frame descriptors that follow. Each stack framedescriptor is on its own line following the event, consisting of four signedinteger arguments: the PC, an integer describing the function name, an integerdescribing the file name, and the line number in that file that function was atat the time the stack trace was taken.For example:Stack id=5 n=2pc=1241251 func=3 file=6 line=124pc=7534345 func=6 file=3 line=64*/package raw
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |