38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From 99f69126221ad8e3abd723576e638e270ab9deb3 Mon Sep 17 00:00:00 2001
|
|
From: John Kacur <jkacur@redhat.com>
|
|
Date: Fri, 17 Jan 2020 18:19:19 +0100
|
|
Subject: [PATCH 5/5] rt-tests: queuelat: get_cpuinfo_mhz.sh highest value
|
|
|
|
get_cpuinfo_mhz.sh greps for the Mhz from the /proc/cpuinfo file
|
|
It assumes that for multiple cpus the value will be the same, and
|
|
intends to return one value using uniq as a filter.
|
|
|
|
Typically the reported Mhz values can all be slightly different though
|
|
It would probably be good enough to simply take the first match as a
|
|
heuristic, but to be safe, take the highest number.
|
|
|
|
Also replace the legacy backticks with the modern $(...) construct, and
|
|
quote the $mhz variable.
|
|
|
|
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
---
|
|
src/queuelat/get_cpuinfo_mhz.sh | 5 ++---
|
|
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/queuelat/get_cpuinfo_mhz.sh b/src/queuelat/get_cpuinfo_mhz.sh
|
|
index eafdd9577424..14a2c12c478f 100755
|
|
--- a/src/queuelat/get_cpuinfo_mhz.sh
|
|
+++ b/src/queuelat/get_cpuinfo_mhz.sh
|
|
@@ -3,6 +3,5 @@
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright (C) 2018 Marcelo Tosatti <mtosatti@redhat.com>
|
|
|
|
-mhz=`cat /proc/cpuinfo | grep "cpu MHz" | uniq | cut -f 3 -d " "`
|
|
-echo $mhz
|
|
-
|
|
+mhz=$(grep "cpu MHz" /proc/cpuinfo | cut -f 3 -d " " | sort -rn | head -n1)
|
|
+echo "$mhz"
|
|
--
|
|
2.20.1
|
|
|