[Powertop] [PATCH] Fixed cpu_core::has_c1_res initialization.

David Rosca <nowrep at gmail.com>
Newsgroups dev.linux.lists.powertop
Message-ID <CAM7PDoj+Hskmnje+chjYn6jM2D_zwqhLx-7LcQ5NE2UP8wyexg@mail.gmail.com>
This is regression from 8d6e716

cpu_core::has_c1_res is left uninitialized for anything other than BYT-M,
resulting in error at startup:

  unknown op '{'
                read_msr cpu0 0x660 : Argument list too long.


Signed-off-by: David Rosca <nowrep(a)gmail.com>

---
 src/cpu/intel_cpus.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 3348dba..6330b6f 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -101,8 +101,10 @@ nhm_core::nhm_core(int model)
     if (model == 0x37) {
         has_c3_res = 0;
         has_c1_res = 1;
-    } else
+    } else {
         has_c3_res = 1;
+                has_c1_res = 0;
+        }
 }

 void nhm_core::measurement_start(void)
--
1.8.4.rc3
attachment.html (text/html, 1006 B)
<div dir="ltr">This is regression from 8d6e716<br><br>cpu_core::has_c1_res is left uninitialized for anything other than BYT-M,<br>resulting in error at startup:<br><br>  unknown op &#39;{&#39;<br>                read_msr cpu0 0x660 : Argument list too long.<br>
<br><br>Signed-off-by: David Rosca &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;<br><br>---<br> src/cpu/intel_cpus.cpp | 4 +++-<br> 1 file changed, 3 insertions(+), 1 deletion(-)<br><br>diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp<br>
index 3348dba..6330b6f 100644<br>--- a/src/cpu/intel_cpus.cpp<br>+++ b/src/cpu/intel_cpus.cpp<br>@@ -101,8 +101,10 @@ nhm_core::nhm_core(int model)<br>     if (model == 0x37) {<br>         has_c3_res = 0;<br>         has_c1_res = 1;<br>
-    } else<br>+    } else {<br>         has_c3_res = 1;<br>+                has_c1_res = 0;<br>+        }<br> }<br> <br> void nhm_core::measurement_start(void)<br>--<br>1.8.4.rc3<br></div>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.