Commit 79928d00 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a87dac1b
......@@ -148,9 +148,9 @@ func (p *Package) parseTraceEvent(srcfile *ast.File, pos token.Position, text st
// now parse/typecheck
filename := fmt.Sprintf("%v:%v+trace:event %v", pos.Filename, pos.Line, text)
println("---- 8< ----", filename)
println(buf.String())
println("---- 8< ----")
//println("---- 8< ----", filename)
//println(buf.String())
//println("---- 8< ----")
tf, err := parser.ParseFile(p.traceFset, filename, buf.String(), 0)
fmt.Println("parse:", err)
if err != nil {
......@@ -218,7 +218,6 @@ func packageTrace(prog *loader.Program, pkgi *loader.PackageInfo) (*Package, err
}
// preload original package files into tracing package
fmt.Println("FFF", p.Pkgi.Files)
err := p.traceChecker.Files(p.Pkgi.Files)
if err != nil {
// must not happen
......
......@@ -50,6 +50,9 @@ func prepareTestTree(src, dst string, mode TreePrepareMode) error {
return err
}
// NOTE since files are walked in lexical order <f>.ok or
// <f>.rm is always guaranteed to go after <f>.
var isOk, isRm bool
if strings.HasSuffix(srcpath, ".ok") {
isOk = true
......
......@@ -45,4 +45,5 @@ func DoSomething(topic string) {
// XXX do we need vvv ?
// package-local non-exported tracepoint
//trace:event tracedoSomethingLocal(topic string)
//type t struct {}
////trace:event tracedoSomethingLocal(arg *t)
// Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT.
package pkg1
// code generated for tracepoints
import (
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
"net/url"
)
// traceevent: traceDoSomething(topic string) XXX better raw .Text (e.g. comments)
type _t_traceDoSomething struct {
tracing.Probe
probefunc func(topic string)
}
var _traceDoSomething *_t_traceDoSomething
func traceDoSomething(topic string) {
if _traceDoSomething != nil {
_traceDoSomething_run(topic)
}
}
func _traceDoSomething_run(topic string) {
for p := _traceDoSomething; p != nil; p = (*_t_traceDoSomething)(unsafe.Pointer(p.Next())) {
p.probefunc(topic)
}
}
func traceDoSomething_Attach(pg *tracing.ProbeGroup, probe func(topic string)) *tracing.Probe {
p := _t_traceDoSomething{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceDoSomething)), &p.Probe)
return &p.Probe
}
// traceevent: traceNewT(t *T) XXX better raw .Text (e.g. comments)
type _t_traceNewT struct {
tracing.Probe
probefunc func(t *T)
}
var _traceNewT *_t_traceNewT
func traceNewT(t *T) {
if _traceNewT != nil {
_traceNewT_run(t)
}
}
func _traceNewT_run(t *T) {
for p := _traceNewT; p != nil; p = (*_t_traceNewT)(unsafe.Pointer(p.Next())) {
p.probefunc(t)
}
}
func traceNewT_Attach(pg *tracing.ProbeGroup, probe func(t *T)) *tracing.Probe {
p := _t_traceNewT{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceNewT)), &p.Probe)
return &p.Probe
}
// traceevent: traceNewTPre() XXX better raw .Text (e.g. comments)
type _t_traceNewTPre struct {
tracing.Probe
probefunc func()
}
var _traceNewTPre *_t_traceNewTPre
func traceNewTPre() {
if _traceNewTPre != nil {
_traceNewTPre_run()
}
}
func _traceNewTPre_run() {
for p := _traceNewTPre; p != nil; p = (*_t_traceNewTPre)(unsafe.Pointer(p.Next())) {
p.probefunc()
}
}
func traceNewTPre_Attach(pg *tracing.ProbeGroup, probe func()) *tracing.Probe {
p := _t_traceNewTPre{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceNewTPre)), &p.Probe)
return &p.Probe
}
// traceevent: traceURLParsed(u *url.URL) XXX better raw .Text (e.g. comments)
type _t_traceURLParsed struct {
tracing.Probe
probefunc func(u *url.URL)
}
var _traceURLParsed *_t_traceURLParsed
func traceURLParsed(u *url.URL) {
if _traceURLParsed != nil {
_traceURLParsed_run(u)
}
}
func _traceURLParsed_run(u *url.URL) {
for p := _traceURLParsed; p != nil; p = (*_t_traceURLParsed)(unsafe.Pointer(p.Next())) {
p.probefunc(u)
}
}
func traceURLParsed_Attach(pg *tracing.ProbeGroup, probe func(u *url.URL)) *tracing.Probe {
p := _t_traceURLParsed{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceURLParsed)), &p.Probe)
return &p.Probe
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment