Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
f7aac8bf
Commit
f7aac8bf
authored
Jul 05, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
137a5964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
go/xcommon/tracing/tracing.go
go/xcommon/tracing/tracing.go
+41
-3
No files found.
go/xcommon/tracing/tracing.go
View file @
f7aac8bf
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
/*
/*
Package tracing provides runtime and usage support for Go tracing facilities.
Package tracing provides runtime and usage support for Go tracing facilities.
Trace events
Trace events
A Go package can define several events of interest to trace via special
A Go package can define several events of interest to trace via special
...
@@ -93,7 +92,32 @@ all at once using ProbeGroup:
...
@@ -93,7 +92,32 @@ all at once using ProbeGroup:
// when probes needs to be detached (no explicit tracing.Lock needed):
// when probes needs to be detached (no explicit tracing.Lock needed):
pg.Done()
pg.Done()
Probes is general mechanism which allows various kind of usage of trace events.
Probes is general mechanism which allows various kinds of trace events usage.
Three ways particularly are well-established and handy:
- profiling
- non-blocking tracing
- synchronous tracing
Profiling
A Profile is a collection of stack traces showing the call sequences that led
to instances of a particular event. One could create runtime/pprof.Profile and
use Profile.Add in a probe attached to particular event. The profile can be
later analyzed and visualised with go pprof tool.
Please see runtime/pprof package documentation for details.
XXX BUG not working?
BUG(kirr): should tracing provide more tight integration with runtime/pprof.Profile?
Non-blocking tracing XXX name
TODO
Synchronous tracing
TODO
Cross package tracing
Cross package tracing
...
@@ -120,7 +144,21 @@ available as regular functions prefixed with imported package name:
...
@@ -120,7 +144,21 @@ available as regular functions prefixed with imported package name:
Gotrace
Gotrace
TODO document `gotrace gen` + `gotrace list`
The way //trace:event and //trace:import works is via additional code being
generated for them. Whenever a package uses any //trace: directive,
it has to organize to run `gotrace gen` on its sources for them to work,
usually with the help of //go:generate. For example:
package hello
//go:generate gotrace gen .
//trace:event ...
Besides `gotrace gen` gotrace has other subcommands also related to tracing,
for example `gotrace list` lists trace events a package provides.
Please see TODO link for gotrace documentation.
--------
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment