From edb75870b5646c7bdfea7531a690d463d53ff36a Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Mon, 19 Mar 2018 14:01:52 +0000 Subject: [PATCH] cpumf_helper.in: Fix output of shortdesc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cpumf_helper.in is called to parse counter definition files stored in /usr/share/s390-tools/cpumf directory and returns perl references to be examined by other perl tools such as lsctrdef. cpumf_helper.in expects several keywords in the counter definition files, one is 'shortdesc' which contains a short description of the purpose of the counter. However this short description not is stored in the hash field shortdesc keyed by counter number 'ctr' because the wrong key is used. Output before: { '64' => { 'desc' => 'Total number of the PRNG functions issued by the CPU', 'name' => 'PRNG_FUNCTIONS', 'set' => 8 }, '65' => { 'desc' => 'Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU', 'name' => 'PRNG_CYCLES', 'set' => 8 }, .... 'ctr' => { <-------- WRONG 'shortdesc' => 'AES Blocked Cycles' } } Output with this patch: { '64' => { 'desc' => 'Total number of the PRNG functions issued by the CPU', 'name' => 'PRNG_FUNCTIONS', 'set' => 8, 'shortdesc' => 'PRNG Functions' }, '65' => { 'desc' => 'Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU', 'name' => 'PRNG_CYCLES', 'set' => 8, 'shortdesc' => 'PRNG Cycles' }, ... } Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Signed-off-by: Jan Höppner --- cpumf/bin/cpumf_helper.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 cpumf/bin/cpumf_helper.in diff --git a/cpumf/bin/cpumf_helper.in b/cpumf/bin/cpumf_helper.in old mode 100644 new mode 100755 index fb7e6d4c..c25475b6 --- a/cpumf/bin/cpumf_helper.in +++ b/cpumf/bin/cpumf_helper.in @@ -172,7 +172,7 @@ sub cpumf_parse_ctrdef($;$) # Parse short description (optional) if ($line =~ m/^Short-Description:\s*(\S.*)?$/) { - $h->{ctr}->{shortdesc} = $1 || ""; + $h->{$ctr}->{shortdesc} = $1 || ""; # Parse start of counter description } elsif ($line =~ m/^Description:\s*(\S.*)?$/) {