iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

libbpf javagc fails when no PID is provided #4980

Open jeromemarchand opened 5 months ago

jeromemarchand commented 5 months ago

The libbpf javagc tool fails with no useful error message when no PID is provided even though the "-p" option is described as optional. A quick look at the code let me think that the tool is only meant to trace one PID only and thus the option should have been made mandatory, and the tool should have failed at the parsing stage, with a proper error message. As a side note, the tool help message is lacking compared to the equivalent bcc tool.

chentao-kernel commented 3 weeks ago

@jeromemarchand hi jeromemarchand, you are right,i did not consider it so carefully at the time,when no pid input, the default value is -1, and the pid of no task is -1 in kernel,as a result, no event output from kernel. Can you fix it?