bcc icon indicating copy to clipboard operation
bcc copied to clipboard

libbpf javagc fails when no PID is provided

Open jeromemarchand opened this issue 1 year ago • 1 comments

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.

jeromemarchand avatar Apr 30 '24 13:04 jeromemarchand

@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?

chentao-kernel avatar Sep 11 '24 02:09 chentao-kernel

That was fixed by commit ebcc7a72 ("libbpf-tools: javagc: Hints for more information (#5154)")

jeromemarchand avatar Oct 07 '25 14:10 jeromemarchand