veyron/tools/debug: Add debug command-line tool
This change adds a command-line tool to interact with the debug server
that's built into all IPC servers. We can access log files, inspect
stats, and run pprof.
$ export NAMESPACE_ROOT=/proxy.envyor.com:8101
$ ./debug glob tunnel/hostname/rpi001/__debug/*
tunnel/hostname/rpi001/__debug/logs
tunnel/hostname/rpi001/__debug/pprof
tunnel/hostname/rpi001/__debug/stats
$ ./debug glob tunnel/hostname/rpi001/__debug/logs/*INFO
tunnel/hostname/rpi001/__debug/logs/tunneld.INFO
$ ./debug logs read tunnel/hostname/rpi001/__debug/logs/tunneld.INFO
[...]
$ ./debug pprof run tunnel/hostname/rpi001/__debug/pprof heap -text
[...]
$ ./debug stats watchglob tunnel/hostname/rpi001/__debug/stats/...
[...]
etc.
Change-Id: I36dc6d8b77b97a76548589b1d215e952f5541714
diff --git a/tools/debug/main.go b/tools/debug/main.go
new file mode 100644
index 0000000..bc021ef
--- /dev/null
+++ b/tools/debug/main.go
@@ -0,0 +1,12 @@
+// A command-line tool to interface with the debug server.
+package main
+
+import (
+ "veyron.io/veyron/veyron/tools/debug/impl"
+ "veyron.io/veyron/veyron2/rt"
+)
+
+func main() {
+ defer rt.Init().Cleanup()
+ impl.Root().Main()
+}