Open emil14 opened 1 month ago
trace
which is a []runtime.PortAddr
Trace
(probably runtime.Trace
or even debug.Trace
) that
import { runtime }
component Main(start) (stop) {
nodes { runtime.Trace, Println, Foo }
net { :start -> foo -> trace -> println -> :stop }
}
component Foo(sig) (sig) {
nodes { Bar }
net { :sig -> bar -> :sig }
}
component Bar(sig) (sig) {
nodes { Baz }
net { :sig -> baz -> :sig }
}
component Baz(sig) (sig) { :sig -> :sig }
├─ in:start[0]
│ ├─ foo/in:sig[0]
│ │ ├─ foo/bar/in:sig[0]
│ │ │ └─ foo/bar/baz/in:sig[0]
│ │ │ └─ foo/bar/baz/out:sig[0]
│ │ └─ foo/bar/out:sig[0]
└─ foo/out:sig[0]
It won't work with nested messages like struct
, map
, list
and their combinations.
This is the implementation - when message is send runtime.Connector
appends to it's trace current port-address (where it was sent from).
The problem is that to apply that to the trace of any message inside we need to do that recursively.
Now given that how much of a load is on that connector's part we have, it will definitely be a bottle-neck.
We just need to waste more memory on that. Each message will carry a slice of structures that will only get bigger as it moves from one place to another. That is especially the case for looped networks
panic
? In Go we see a stack-trace of the goroutine that panickeddebug.PrintStack()
fromruntime/debug
? How should it work?