ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.82k stars 402 forks source link

Doesn't check the call to the imported modules #106

Open Shuanglu opened 2 years ago

Shuanglu commented 2 years ago

I'm not sure if this is my go env issue or I ran the incorrect command. I pulled k8s repo and ran 'go-callvis -group pkg,type -debug -format=png -file=/tmp/kubeadm k8s.io/kubernetes/cmd/kubeadm | dot -Tpng -o /tmp/kubeadm.png'. It returned below. Whether this is by design or I did something wrong. Thanks!

image

13:22:21.212161 focusing: k8s.io/kubernetes/cmd/kubeadm 13:22:21.277171 0 limit prefixes: [] 13:22:21.277198 0 ignore prefixes: [] 13:22:21.277200 0 include prefixes: [] 13:22:21.277213 no std packages: false 13:22:21.336210 call node: package k8s.io/kubernetes/cmd/kubeadm -> package k8s.io/kubernetes/cmd/kubeadm/app (n4:k8s.io/kubernetes/cmd/kubeadm.main -> n5:k8s.io/kubernetes/cmd/kubeadm/app.Run) kubeadm.go 13:22:22.177090 call node: package k8s.io/kubernetes/cmd/kubeadm -> package k8s.io/kubernetes/cmd/kubeadm/app/util (n4:k8s.io/kubernetes/cmd/kubeadm.main -> n6:k8s.io/kubernetes/cmd/kubeadm/app/util.CheckErr) kubeadm.go 13:22:22.348082 2/164102 edges 13:22:22.349114 writing dot output.. 13:22:22.349765 converting dot to png..

ondrajz commented 1 year ago

You need to set -focus to the specific package you are focusing on. Or you might try to set it to empty string -focus="" to generate graph for entire program (-nostd flag recommended), but this might be too much data to render so additional flags might be needed: -limit=.., -ignore=....

Shuanglu commented 1 year ago

You need to set -focus to the specific package you are focusing on. Or you might try to set it to empty string -focus="" to generate graph for entire program (-nostd flag recommended), but this might be too much data to render so additional flags might be needed: -limit=.., -ignore=....

thanks! let me try