twitter / rezolus

Systems performance telemetry
Apache License 2.0
1.55k stars 115 forks source link

richer error logs for failed probes attachment #265

Closed WUMUXIAN closed 2 years ago

WUMUXIAN commented 2 years ago

Problem

In fault tolerant mode, we now allow BPF initialisation to continue and skip the failed probes. But in the error message, it does not show what probes are failed to attach.

Solution

Added logging for the error message for failed probes.

Result

Before: no information about which probe(s) fail 2022-01-05 11:33:10.054 DEBUG [rezolus::rezolus::samplers::tcp] initializing bpf cannot attach kprobe, probe entry may not exist

After: with information about which probe(s) fail 2022-01-05 11:33:10.054 DEBUG [rezolus::rezolus::samplers::tcp] initializing bpf cannot attach kprobe, probe entry may not exist 2022-01-05 11:33:12.153 WARN [rezolus::rezolus::samplers::tcp] skipping tcp_drop with error: failed to attach kprobe: (p_tcp_drop)

brayniac commented 2 years ago

Minor grammar fix needed for all the times that error is printed. Otherwise looks good, this will be a nice improvement.