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

libstatgrab returning failed to parse input (not all from 'cpu', 'intr', 'ctxt', 'softirq' found in '/proc/stat') on very older Linux kernels #124

Closed
andersontrindade0975 opened this issue Sep 23, 2020 · 3 comments

Comments

@andersontrindade0975
Copy link

Scenario:
libstatgrab, version 0.92
Linux: Red Hat Enterprise Linux Server release 5.8 (Tikanga)
kernel: 2.6.18-308.el5

sample from /proc/stat:

cpu 18586839 2778 1352412 1042991263 13325089 233546 1339797 0
cpu0 2004901 6 94998 266665069 689946 0 3026 0
cpu1 7457682 1608 586971 254413646 6337841 111160 549022 0
cpu2 4501376 485 347268 260712591 3439678 66105 390420 0
cpu3 4622878 677 323174 261199956 2857623 56280 397327 0
intr 3816107288 2694989123 0 0 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 548560172 0 0 0 0 0 0 0 116023946 0 0 0 0 0 0 0 125125056 0 0 0 0 0 0 0 114902213 0 0 0 0 0 0 0 123535670 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90339499 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2631542 0 0 0 0 0
ctxt 1217111454
btime 1598202327
processes 3810640
procs_running 1
procs_blocked 0

Issue:

sg_get_cpu_stats_int() seens to find at least four lines of interest on /proc/stats. Each of then, starting with: cpu, intr, ctxt and softirq. However, this LInux version is not including softirq data on /proc/stats

@tdb
Copy link
Member

tdb commented Sep 24, 2020

@andersontrindade0975 as a workaround you can just comment/remove this line:

https://github.com/libstatgrab/libstatgrab/blob/master/src/libstatgrab/cpu_stats.c#L264

We'll consider whether this test is necessary or not.

@andersontrindade0975
Copy link
Author

Thanks @tdb , I will apply the suggested workaround.

rehsack added a commit to rehsack/libstatgrab that referenced this issue Sep 28, 2020
There are Linux kernels out there that do not provide information about
'cpu', 'intr', 'ctxt' or 'softirq'. Accept, that when information aren't
provided via appropriate API, it's similar to the datum is available but
nulled.

This patch should also help fixing libstatgrab#124

Signed-off-by: Jens Rehsack <sno@netbsd.org>
tdb pushed a commit that referenced this issue Sep 28, 2020
There are Linux kernels out there that do not provide information about
'cpu', 'intr', 'ctxt' or 'softirq'. Accept, that when information aren't
provided via appropriate API, it's similar to the datum is available but
nulled.

This patch should also help fixing #124

Signed-off-by: Jens Rehsack <sno@netbsd.org>
@tdb
Copy link
Member

tdb commented Sep 28, 2020

Fixed by #125.

@tdb tdb closed this as completed Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants