Repository navigation
Conversation
| version_txt = release.split('-', 1)[0] | ||
| self.linux_version = tuple(map(int, version_txt.split('.'))) | ||
| except ValueError: | ||
| self.linux_version = parse_linux_version(release) |
There was a problem hiding this comment.
linux_version is only needed to check if the running Linux kernel is Linux 3.8 or newer. Linux 3.8 was released 13 years ago. Maybe we can just remove the test and makes the assumption that the current Linux is more recent than that.
There was a problem hiding this comment.
It's moderately convenient to my usecase to have pyperf system show capture the Linux kernel version for my benchmark records, but I also support not making pointless checks. I'm sure some older kernels are out there, but I'm dubious they're running a contemporary pyperf.
There was a problem hiding this comment.
It's moderately convenient to my usecase to have pyperf system show capture the Linux kernel version for my benchmark records
Would you mind to elaborate? Currently, os.uname()[2] is only logged if parsing the Linux fails (your issue). On success, self.linux_version is not logged.
There was a problem hiding this comment.
linux_version is only needed to check if the running Linux kernel is Linux 3.8 or newer. Linux 3.8 was released 13 years ago. Maybe we can just remove the test and makes the assumption that the current Linux is more recent than that.
We can drop the check.
Linux 3.7 was EOL in March 2013.
https://en.wikipedia.org/wiki/Linux_kernel_version_history
That's around the time Python 2.6 and 3.1 went EOL.
There was a problem hiding this comment.
It's moderately convenient to my usecase to have pyperf system show capture the Linux kernel version for my benchmark records
Would you mind to elaborate? Currently,
os.uname()[2]is only logged if parsing the Linux fails (your issue). On success,self.linux_versionis not logged.
Ah: shows how much experience I have with pyperf! There's no need to keep it from my end, then---my benchmarking will get that information elsewhere.
There was a problem hiding this comment.
I'm happy to put up a "take out the version" check PR, but y'all seem to have this well in hand. Feel free to close this PR.
There was a problem hiding this comment.
Do you want to open a new PR to drop this Linux version check?
If you want to log os.uname(), you should look at pyperf/_collect_metadata.py, but it should be done in a separated PR.
There was a problem hiding this comment.
Sure, thing, if it saves you trouble! I'll put up those two later this evening.
There was a problem hiding this comment.
#281 drops the version check. Apparently the Linux kernel version will show up in the platform metadata already, so no second PR (I don't need full uname, just the version). Thanks!
Debian 13 (trixie, released in 2025) switched its
unameoutput to something like6.12.x+deb13-amd64, which puts+deb13before the first-, which breaks the old parsing code.This PR moves the parsing code to a function, makes it more robust, and adds a regression test (which is maybe skippable if you don't need the belt-and-suspenders approach).
I noticed this because
pyperf showfailed on my laptop. I got:With the fix, I get: