tools: continue adding --ebpf support (#1986)
Use argparse in cachestat, add --ebpf support.
Add --ebpf support for u* tools, finalize language sorting.
Remove sole --ebpf string on usage line in tcpsubnet.
diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py
index 8419c88..fb306e3 100755
--- a/tools/lib/uflow.py
+++ b/tools/lib/uflow.py
@@ -39,6 +39,8 @@
help="trace only calls to classes starting with this prefix")
parser.add_argument("-v", "--verbose", action="store_true",
help="verbose mode: print the BPF program (for debugging purposes)")
+parser.add_argument("--ebpf", action="store_true",
+ help=argparse.SUPPRESS)
args = parser.parse_args()
usdt = USDT(pid=args.pid)
@@ -165,9 +167,12 @@
print("No language detected; use -l to trace a language.")
exit(1)
-if args.verbose:
- print(usdt.get_text())
+if args.ebpf or args.verbose:
+ if args.verbose:
+ print(usdt.get_text())
print(program)
+ if args.ebpf:
+ exit()
bpf = BPF(text=program, usdt_contexts=[usdt])
print("Tracing method calls in %s process %d... Ctrl-C to quit." %