k8snetworkplumbingwg / sriov-network-operator

Operator for provisioning and configuring SR-IOV CNI plugin and device plugin
Apache License 2.0
85 stars 114 forks source link

logging: Reduce device discovering verbosity #793

Closed zeeke closed 1 month ago

zeeke commented 1 month ago

The DiscoverSriovDevices routine produces a huge amount of log entries, making debugging problems hard.

Remove log entries that can produce a log line for each configured VF and which does not produce any change in the environment.

The following data comes from a lab I debugged recently:

Analysing a 51 Megabytes rotated log file:

$ ls -lh config-daemon.log
-rw-r--r--. 1 apanatto apanatto 51M Oct 18 12:26 config-daemon.log

$ wc -l config-daemon.log
267148 config-daemon.log

for 2h32m of idle application

$ tail -n 1 config-daemon.log
2024-09-23T12:40:30.620250456Z     INFO    daemon/writer.go:147    setNodeStateStatus(): status    {"sync-status": "Succeeded", "last-sync-error": ""}

$ head -n 1 config-daemon.log
2024-09-23T10:08:47.308287975Z     LEVEL(-2)       daemon/daemon.go:220    get item from queue     {"item": 2}
$ grep "DiscoverVDPAType() discover device type" config-daemon.log | wc -l
84736

$ grep "DiscoverVDPAType(): VDPA device for VF not found" config-daemon.log | wc -l
84736

grep "sriov/sriov.go:127     TryGetInterfaceName()" config-daemon.log | wc -l
84736

Which is 95% of the whole file.

github-actions[bot] commented 1 month ago

Thanks for your PR, To run vendors CIs, Maintainers can use one of:

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 11402676883

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/host/internal/network/network.go 0 1 0.0%
<!-- Total: 0 1 0.0% -->
Totals Coverage Status
Change from base Build 11294509064: -0.007%
Covered Lines: 6661
Relevant Lines: 14799

💛 - Coveralls