Update SCHEDSTAT_SUPPORTED_VERSION to match kernel 6.12
Linux kernel 6.12 updated /proc/schedstat version to 16. As a result collectd and schedtop fails to get sched statistics. This change updates collect scripts with the required version. Test Plan: PASS: Fresh install PASS: <sudo schedtop --idle> executes with no errors PASS: no errors in /var/log/collectd.log related to schedstat version Closes-Bug: 2111949 Change-Id: I1296bbbdd7a898d1dc285c06d5881a40228fb924 Signed-off-by: Alyson Deives Pereira <alyson.deivespereira@windriver.com>
This commit is contained in:
@@ -38,7 +38,7 @@ PLUGIN_HISTOGRAM_INTERVAL = 300 # histogram interval in secs
|
|||||||
TIMESTAMP = 'timestamp'
|
TIMESTAMP = 'timestamp'
|
||||||
PLATFORM_CPU_PERCENT = 'platform-occupancy'
|
PLATFORM_CPU_PERCENT = 'platform-occupancy'
|
||||||
CGROUP_PLATFORM_CPU_PERCENT = 'cgroup-platform-occupancy'
|
CGROUP_PLATFORM_CPU_PERCENT = 'cgroup-platform-occupancy'
|
||||||
SCHEDSTAT_SUPPORTED_VERSION = 15
|
SCHEDSTAT_SUPPORTED_VERSION = 16
|
||||||
|
|
||||||
# Linux per-cpu info
|
# Linux per-cpu info
|
||||||
CPUINFO = '/proc/cpuinfo'
|
CPUINFO = '/proc/cpuinfo'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015-2024 Wind River Systems, Inc.
|
# Copyright (c) 2015-2025 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
@@ -1317,9 +1317,9 @@ sub read_schedstat
|
|||||||
$_ = <$fh>; ($version) = /^version\s+(\d+)/;
|
$_ = <$fh>; ($version) = /^version\s+(\d+)/;
|
||||||
$_ = <$fh>; ($timestamp) = /^timestamp\s+(\d+)/;
|
$_ = <$fh>; ($timestamp) = /^timestamp\s+(\d+)/;
|
||||||
|
|
||||||
if ($version == 15) {
|
if ($version == 15 or $version == 16) {
|
||||||
LOOP_SCHEDSTAT: while (<$fh>) {
|
LOOP_SCHEDSTAT: while (<$fh>) {
|
||||||
# version 15: cputime is 7th field
|
# version 15 and 16: cputime is 7th field
|
||||||
if (/^cpu(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)\s+/) {
|
if (/^cpu(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)\s+/) {
|
||||||
$cpu = $1; $cputime = $2;
|
$cpu = $1; $cputime = $2;
|
||||||
$::percpu{$cpu} = $cputime;
|
$::percpu{$cpu} = $cputime;
|
||||||
|
|||||||
Reference in New Issue
Block a user