• Kirill Smelkov's avatar
    tracing: Part 2 - gotrace utility · d89b1be1
    Kirill Smelkov authored
    As it was said in the previous patch here goes gotrace utility to
    process `//trace:event ...` and other tracing related directives.
    
    Related excerpt from the documentation:
    
    ---- 8< ----
    Gotrace
    
    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.
    ---- 8< ----
    
    Gotrace works by parsing and typechecking go sources via go/parse &
    go/types and then for special comments generating corresponding
    additional code that is supported by tracing runtime.
    d89b1be1
gotrace.go 28.9 KB