Commit Graph

6 Commits

Author SHA1 Message Date
Jim Warner 133a833942 library: become more tolerant of /proc/cpuinfo formats
In the issue referenced below, it is now apparent that
not all architectures follow a logical/expected format
for the /proc/cpuinfo file. Specifically, the expected
empty line after each processor entry might be missing
under some architectures for the last processor shown.

[ and a belated review of kernel source confirms it. ]

So this commit makes our stat module a little bit more
tolerant of some potential missing newline characters.

[ along the way, it's also now tolerant of a missing ]
[ cpuinfo file plus more efficient whenever a cpu is ]
[ is not linked to a core or toggled offline/online. ]

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/272
procps-ng/procps#272

Signed-off-by: Jim Warner <james.warner@comcast.net>
2023-03-02 19:38:41 +11:00
Craig Small 8fcfb01a81 misc: Update the copyrights of files
The copyrights of the source files were all out of date and were not
the same format. This has been corrected. The source of the authors
was examining the git log for each file.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2023-02-07 21:09:48 +11:00
Jim Warner b89e3230b2 library: adapted for absent 'core id' in /proc/cpuinfo
A big oops on my part - with a big thanks to Dr. Fink.

[ this version eliminates an extraneous startup call ]
[ to the 'stat_cores_verify' function as superfluous ]

Reference(s):
https://www.freelists.org/post/procps/For-procpsng4001-No-core-id-in-eg-aarch65-or-ppc64le-proccpuinfo

Prototyped by: Dr. Werner Fink <werner@suse.de>
Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-25 20:16:12 +11:00
Jim Warner f571746af2 library: tweak support of p-core/e-core identification
Wow, after this we'll eliminate one 'jmp' instruction!

[ plus we can also save a single precious whitespace ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-04 10:57:34 +11:00
Jim Warner 6e51196589 library: provided for cpu p-core/e-core identification
With Intel's 12th generation Alder Lake processors now
providing two distinct types of core, it would be nice
if the library offered some sort of clue to core type.

Well, with this patch it does. We'll have 2 additional
enumerators. One deals with the cpu's core association
and the other provides the type of that core (P or E).

[ now, all we need is for some program to exploit it ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-28 17:30:56 +10:00
Craig Small 3d0871728b build-sys: Relocate library to library/
All the dependent programs needed to have their includes moved too

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 19:02:44 +10:00