mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cpumf/cpumf_helper: always return list reference for --sfb-size
Running lscpumf -i as regular user causes a warning when trying to disply sampling buffer sizes. The root cause is in the cpumf_helper that returns "0,0" instead of a list reference "[0,0]". This happened when running as regular user because the sampling buffer size sysfs attribute is not readable for them. Remove the shortcut and always return a list reference. Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
a69470d7e0
commit
299144264d
@@ -51,10 +51,11 @@ sub cpumf_get_sfb_size()
|
||||
my $val = "0,0";
|
||||
my $SFBSIZE;
|
||||
|
||||
return $val unless open($SFBSIZE, '<', $CPUM_SFB_SIZE);
|
||||
$val = <$SFBSIZE>;
|
||||
chomp($val);
|
||||
close($SFBSIZE);
|
||||
if (open($SFBSIZE, '<', $CPUM_SFB_SIZE)) {
|
||||
$val = <$SFBSIZE>;
|
||||
chomp($val);
|
||||
close($SFBSIZE);
|
||||
}
|
||||
|
||||
return [split /,/, $val];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user