integrations-core icon indicating copy to clipboard operation
integrations-core copied to clipboard

Add collection of ethtool queue stats

Open bonnefoa opened this issue 3 years ago • 1 comments

What does this PR do?

This PR was previously applied in https://github.com/DataDog/integrations-core/pull/11056 However, this triggered segfault as the buffer's size was incorrect as _u32 element was only counted as one byte.

1 + 32 + 32 + 32 + 32 + 32 + 12 + 5
178

While the correct size should have been

4 + 32 + 32 + 32 + 32 + 32 + 12 + 5 * 4
196

A sizeof confirms it

#include <linux/ethtool.h>
#include <stdio.h>

int main (int argc, char *argv[])
{
    printf("%zu\n", sizeof(struct ethtool_drvinfo));
    return 0;
}

gcc test.c && ./a.out 
196

Motivation

This will provide per queue stats.

Additional Notes

Review checklist (to be filled by reviewers)

  • [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • [ ] PR title must be written as a CHANGELOG entry (see why)
  • [ ] Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • [ ] PR must have changelog/ and integration/ labels attached

bonnefoa avatar May 13 '22 15:05 bonnefoa

Codecov Report

Merging #12023 (5d478cd) into master (54ef7cf) will increase coverage by 0.04%. The diff coverage is 95.21%.

Flag Coverage Δ
network 84.63% <95.21%> (+6.74%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar May 13 '22 15:05 codecov[bot]

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

github-actions[bot] avatar Aug 16 '22 13:08 github-actions[bot]