diff options
| author | denisova-ok <denisova.olga.k@yandex.ru> | 2025-04-15 18:34:04 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-24 11:27:06 +0100 |
| commit | 5b74c7696485805d9b9ababc69cc569a227145ce (patch) | |
| tree | 537bd8ec2c3c613030ca57e712a7de691b9b3828 | |
| parent | 8dcd0f73eb9547b8daacc751141b8531fbbe4bf7 (diff) | |
| download | poky-5b74c7696485805d9b9ababc69cc569a227145ce.tar.gz | |
buildstats.py: extend diskstats support for NVMe and flexible token count
Added support for NVMe devices in the diskstats regex pattern to ensure stats are properly collected from devices like nvme0n1.
Relaxed the check for the number of fields in /proc/diskstats from an exact match (14) to a minimum check (at least 14), to handle kernel variations and additional fields gracefully.
(From OE-Core rev: 87a31bc4ca3661aae94cf43f3f579b02f4fb4923)
Signed-off-by: denisova-ok <denisova.olga.k@yandex.ru>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oe/buildstats.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/buildstats.py b/meta/lib/oe/buildstats.py index 1ffe679801..359ad2a460 100644 --- a/meta/lib/oe/buildstats.py +++ b/meta/lib/oe/buildstats.py | |||
| @@ -66,7 +66,7 @@ class SystemStats: | |||
| 66 | self.min_seconds = 1.0 - self.tolerance | 66 | self.min_seconds = 1.0 - self.tolerance |
| 67 | 67 | ||
| 68 | self.meminfo_regex = re.compile(rb'^(MemTotal|MemFree|Buffers|Cached|SwapTotal|SwapFree):\s*(\d+)') | 68 | self.meminfo_regex = re.compile(rb'^(MemTotal|MemFree|Buffers|Cached|SwapTotal|SwapFree):\s*(\d+)') |
| 69 | self.diskstats_regex = re.compile(rb'^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$') | 69 | self.diskstats_regex = re.compile(rb'^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+|nvme\d+n\d+.*)$') |
| 70 | self.diskstats_ltime = None | 70 | self.diskstats_ltime = None |
| 71 | self.diskstats_data = None | 71 | self.diskstats_data = None |
| 72 | self.stat_ltimes = None | 72 | self.stat_ltimes = None |
| @@ -94,7 +94,7 @@ class SystemStats: | |||
| 94 | (b'MemTotal', b'MemFree', b'Buffers', b'Cached', b'SwapTotal', b'SwapFree')]) + b'\n') | 94 | (b'MemTotal', b'MemFree', b'Buffers', b'Cached', b'SwapTotal', b'SwapFree')]) + b'\n') |
| 95 | 95 | ||
| 96 | def _diskstats_is_relevant_line(self, linetokens): | 96 | def _diskstats_is_relevant_line(self, linetokens): |
| 97 | if len(linetokens) != 14: | 97 | if len(linetokens) < 14: |
| 98 | return False | 98 | return False |
| 99 | disk = linetokens[2] | 99 | disk = linetokens[2] |
| 100 | return self.diskstats_regex.match(disk) | 100 | return self.diskstats_regex.match(disk) |
