Android doesnt have the udevd daemon and so device nodes are created
using default kernel given name. This patch enables powertop2 to check
the kernel default locations of msr registers.
---
cpu/intel_cpus.cpp | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/cpu/intel_cpus.cpp b/cpu/intel_cpus.cpp
index f42f3b4..db5afb2 100644
--- a/cpu/intel_cpus.cpp
+++ b/cpu/intel_cpus.cpp
@@ -60,6 +60,16 @@ static uint64_t get_msr(int cpu, uint64_t offset)
char msr_path[256];
fd = sprintf(msr_path, "/dev/cpu/%d/msr", cpu);
+
+ if (access(msr_path, R_OK) != 0){
+ fd = sprintf(msr_path, "/dev/msr%d", cpu);
+
+ if (access(msr_path, R_OK) != 0){
+ fprintf(stderr, "msr reg not found");
+ exit(-2);
+ }
+ }
+
fd = open(msr_path, O_RDONLY);
retval = pread(fd, &msr, sizeof msr, offset);
--
1.7.0.4
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Power mailing list
[email protected]
https://bughost.org/mailman/listinfo/power