Skip to contentSkip to conversation

selftest: intel_pstate: debug support message from aperf.c and return value fix.

PATCH RESEND In review Jeffrin Jose T 2 participants 2 messages May 29, 2018 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 selftest: intel_pstate: debug support message from aperf.c and return value fix.

Additional message along with an error message which is more verbose for debug support from aperf.c and updated with the new return value "KSFT_SKIP".

Signed-off-by Jeffrin Jose T [Rajagiri SET] <ahiliation at gmail.com>
---
 tools/testing/selftests/intel_pstate/aperf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/intel_pstate/aperf.c +4 -2
index d21edea9c560..f6cd03a87493 100644
@@ -9,6 +9,8 @@
 #include <sys/timeb.h>
 #include <sched.h>
 #include <errno.h>
+#include <string.h>
+#include "../kselftest.h"
 
 void usage(char *name) {
 	printf ("Usage: %s cpunum\n", name);
@@ -41,8 +43,8 @@ int main(int argc, char **argv) {
 	fd = open(msr_file_name, O_RDONLY);
 
 	if (fd == -1) {
-		perror("Failed to open");
-		return 1;
+		printf("/dev/cpu/%d/msr: %s\n", cpu, strerror(errno));
+		return KSFT_SKIP;
 	}
 
 	CPU_ZERO(&cpuset);
Signature · 6 lines
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#1 lore raw
Quoted 24 lines · Jeffrin Jose T

Additional message along with an error message which is more verbose for debug support from aperf.c and updated with the new return value "KSFT_SKIP".

Signed-off-by Jeffrin Jose T [Rajagiri SET] <ahiliation at gmail.com>
---
 tools/testing/selftests/intel_pstate/aperf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/intel_pstate/aperf.c +2 -0
index d21edea9c560..f6cd03a87493 100644
@@ -9,6 +9,8 @@
 #include <sys/timeb.h>
 #include <sched.h>
 #include <errno.h>
+#include <string.h>
+#include "../kselftest.h"
 
 void usage(char *name) {
 	printf ("Usage: %s cpunum\n", name);

tools/testing/selftests/intel_pstate/aperf.c int main(int argc, char **argv) { · line 50

Quoted 10 lines
tools/testing/selftests/intel_pstate/aperf.c +2 -2
@@ -41,8 +43,8 @@ int main(int argc, char **argv) {
 	fd = open(msr_file_name, O_RDONLY);
 
 	if (fd == -1) {
-		perror("Failed to open");
-		return 1;
+		printf("/dev/cpu/%d/msr: %s\n", cpu, strerror(errno));
+		return KSFT_SKIP;
 	}
 
 	CPU_ZERO(&cpuset);

Thanks, Applied to linux-kselftest next for 4.18-rc1

-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html