Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing of v2 blkio stat broken #57

Open
flxo opened this issue Sep 17, 2021 · 3 comments
Open

Parsing of v2 blkio stat broken #57

flxo opened this issue Sep 17, 2021 · 3 comments
Assignees
Labels
area/agent bug Something isn't working

Comments

@flxo
Copy link

flxo commented Sep 17, 2021

Describe the bug

Parsing the stats of the blkio controller is broken. According to [1], section IO Interface Files the io.stat file has the format:

8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=35
8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252

but the parsing code expects a : instead of a = in blk.rs

Expected behavior

Parse the correct values.

Additional context

The implementation could be easily optimised to avoid the String and Vec allocations by modifying get_value:

    fn get_value(s: &str) -> u64 {
        s.split('=')
            .skip(1)
            .next()
            .and_then(|s| s.parse::<u64>().ok())
            .unwrap_or_default()
    }

which is only used for the v2 parsing. Same applies for more places of the parsing code in (at least) blkio.

[1] https://www.kernel.org/doc/Documentation/cgroup-v2.txt

@flxo flxo added bug Something isn't working needs-review labels Sep 17, 2021
@c3d c3d self-assigned this Sep 28, 2021
@Tim-Zhang
Copy link
Member

@liubin PTAL

@flxo
Copy link
Author

flxo commented Apr 27, 2022

Hello,

This issues is open for quite a long time. Anything I can support here in order to make progress?

Thanks,

@flxo

@liubin
Copy link
Member

liubin commented Apr 27, 2022

Hi @c3d, you assigned to yourself, do you plan to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants