All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rt-tests] queuelat: fix get_cpuinfo_mhz.sh script on SMP systems
@ 2018-06-20 13:21 Marcelo Tosatti
  2018-06-22 20:00 ` Gratian Crisan
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Tosatti @ 2018-06-20 13:21 UTC (permalink / raw)
  To: John Kacur; +Cc: linux-rt-users


get_cpuinfo_mhz.sh fails on SMP systems because 
/proc/cpuinfo returns multiple "cpu MHz" containing
lines.

Get only the first one.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/src/queuelat/get_cpuinfo_mhz.sh b/src/queuelat/get_cpuinfo_mhz.sh
index fb5158f..46f94c4 100755
--- a/src/queuelat/get_cpuinfo_mhz.sh
+++ b/src/queuelat/get_cpuinfo_mhz.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-mhz=`cat /proc/cpuinfo  | grep "cpu MHz" | uniq | cut -f 3 -d " "`
+mhz=`cat /proc/cpuinfo  | grep "cpu MHz" | uniq | cut -f 3 -d " " | head -1`
 echo $mhz
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-23 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 13:21 [PATCH rt-tests] queuelat: fix get_cpuinfo_mhz.sh script on SMP systems Marcelo Tosatti
2018-06-22 20:00 ` Gratian Crisan
2018-06-23 13:24   ` Carsten Emde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.