Skip to contentSkip to conversation

Add a more informative error message about MSR not found

PATCH In review jani.nikula at linux.intel.com 3 participants 4 messages Feb 21, 2013

lore
Share & tools
lore

jani.nikula at linux.intel.com

#0 lore raw

PATCH 1/1 Add a more informative error message about MSR not found

From: Jani Nikula <jani.nikula(a)intel.com>

Suggest enabling CONFIG_X86_MSR. Add \n at the end of the error message.

Signed-off-by Jani Nikula <jani.nikula(a)intel.com>

---

Note: This breaks translations looking for msgid "msr reg not found". I'm unsure how you want this kind of changes handled.

---
 src/cpu/intel_cpus.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/cpu/intel_cpus.cpp +1 -1
index 2b78d31..30c311f 100644
@@ -58,7 +58,7 @@ static uint64_t get_msr(int cpu, uint64_t offset)
 		fd = sprintf(msr_path, "/dev/msr%d", cpu);
 
 		if (access(msr_path, R_OK) != 0){
-			fprintf(stderr, _("msr reg not found"));
+			fprintf(stderr, _("Model-specific registers (MSR) not found (try enabling CONFIG_X86_MSR).\n"));
 			exit(-2);
 		}
 	}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 20 lines · jani.nikula(a)linux.intel.com

From: Jani Nikula <jani.nikula(a)intel.com>

Suggest enabling CONFIG_X86_MSR. Add \n at the end of the error message.

Signed-off-by Jani Nikula <jani.nikula(a)intel.com>

---

Note: This breaks translations looking for msgid "msr reg not found". I'm unsure how you want this kind of changes handled.

---
 src/cpu/intel_cpus.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/cpu/intel_cpus.cpp +0 -0
index 2b78d31..30c311f 100644

src/cpu/intel_cpus.cpp static uint64_t get_msr(int cpu, uint64_t offset) · line 64

Quoted 8 lines
src/cpu/intel_cpus.cpp +1 -1
@@ -58,7 +58,7 @@ static uint64_t get_msr(int cpu, uint64_t offset)
 		fd = sprintf(msr_path, "/dev/msr%d", cpu);
 
 		if (access(msr_path, R_OK) != 0){
-			fprintf(stderr, _("msr reg not found"));
+			fprintf(stderr, _("Model-specific registers (MSR) not found (try enabling CONFIG_X86_MSR).\n"));
 			exit(-2);
 		}
 	}

I think we're beyond the `string freeze' date, most likely it will not get into upcoming release.

	-ss
Quoted 7 lines

1.7.9.5

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

#2 lore raw
Quoted 2 lines · Sergey Senozhatsky

I think we're beyond the `string freeze' date, most likely it will not get into upcoming release.

I'm ignorant about powertop release practices, and don't mind whether it makes the next release or not; hopefully some release after that though.

I'm just trying to give a hint to the next developer hitting the issue, so he won't have to first grep the powertop sources to figure out what the error really is about, and then the kernel sources to figure out who's responsible for creating /dev/cpu/%d/msr, and what config knob to turn to enable that... The README patch I sent of course helps too.

BR,
Jani.

#3 lore raw
Quoted 4 lines · Jani Nikula
Quoted 2 lines · Sergey Senozhatsky

I think we're beyond the `string freeze' date, most likely it will not get into upcoming release.

Quoted 9 lines

I'm ignorant about powertop release practices, and don't mind whether it makes the next release or not; hopefully some release after that though.

I'm just trying to give a hint to the next developer hitting the issue, so he won't have to first grep the powertop sources to figure out what the error really is about, and then the kernel sources to figure out who's responsible for creating /dev/cpu/%d/msr, and what config knob to turn to enable that... The README patch I sent of course helps too.

sure, thanks.

	-ss
Quoted 3 lines

BR,
Jani.