linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: use stdout for success and stdout for failure
@ 2016-10-25 20:56 Paul Bolle
  2016-10-25 20:56 ` [PATCH 1/2] x86: use stdout if insn decoder test is successful Paul Bolle
  2016-10-25 20:56 ` [PATCH 2/2] x86: use stderr if insn sanity test fails Paul Bolle
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Bolle @ 2016-10-25 20:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Andrew Morton, x86, linux-kernel

For some time now my x86 builds are warning free. Yay! But there's still one
single line printed to stderr:
    Succeed: decoded and checked 1767380 instructions

This message is printed if the "insn decoder test" ran successful. Patch 1/2
sends this message to stdout (and fixes the typo).

Patch 2/2 does the reverse for the "insn sanity test": it sends a message to
stderr if that test fails.

One thing puzzles me about these two tests: I must have run them hundreds of
times but I've never seen them fail. Have other people ran into failures?

Paul Bolle (2):
  x86: use stdout if insn decoder test is successful
  x86: use stderr if insn sanity test fails

 arch/x86/tools/insn_sanity.c  | 3 ++-
 arch/x86/tools/test_get_len.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH 1/2] x86: use stdout if insn decoder test is successful
  2016-10-25 20:56 [PATCH 0/2] x86: use stdout for success and stdout for failure Paul Bolle
@ 2016-10-25 20:56 ` Paul Bolle
  2016-10-26  6:54   ` [tip:x86/asm] x86/decoder: Use " tip-bot for Paul Bolle
  2016-10-25 20:56 ` [PATCH 2/2] x86: use stderr if insn sanity test fails Paul Bolle
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Bolle @ 2016-10-25 20:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Andrew Morton, x86, linux-kernel

If the instruction decoder test ran successful it prints a message like
this to stderr:
    Succeed: decoded and checked 1767380 instructions

But, as described in "console mode programming user interface guidelines
version 101" which doesn't exist, programs should use stderr for errors
or warnings. We're told about a successful run here, so the instruction
decoder test should use stdout.

Let's fix the typo too, while we're at it.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
The joke about the guidelines is shamelessly copied from commit 55a6e622e66a
("arch/x86/tools/insn_sanity.c: Identify source of messages"). Let's hope
Andrew doesn't mind!

 arch/x86/tools/test_get_len.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
index 56f04db0c9c0..ecf31e0358c8 100644
--- a/arch/x86/tools/test_get_len.c
+++ b/arch/x86/tools/test_get_len.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
 		fprintf(stderr, "Warning: decoded and checked %d"
 			" instructions with %d warnings\n", insns, warnings);
 	else
-		fprintf(stderr, "Succeed: decoded and checked %d"
+		fprintf(stdout, "Success: decoded and checked %d"
 			" instructions\n", insns);
 	return 0;
 }
-- 
2.7.4

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

* [PATCH 2/2] x86: use stderr if insn sanity test fails
  2016-10-25 20:56 [PATCH 0/2] x86: use stdout for success and stdout for failure Paul Bolle
  2016-10-25 20:56 ` [PATCH 1/2] x86: use stdout if insn decoder test is successful Paul Bolle
@ 2016-10-25 20:56 ` Paul Bolle
  2016-10-26  6:55   ` [tip:x86/asm] x86/decoder: Use " tip-bot for Paul Bolle
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Bolle @ 2016-10-25 20:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Andrew Morton, x86, linux-kernel

If the instruction sanity test fails, it prints a "Failure" message to
stdout. Make this program behave like the rest of the build and print
that message to stderr.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
 arch/x86/tools/insn_sanity.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/tools/insn_sanity.c b/arch/x86/tools/insn_sanity.c
index ba70ff232917..1972565ab106 100644
--- a/arch/x86/tools/insn_sanity.c
+++ b/arch/x86/tools/insn_sanity.c
@@ -269,7 +269,8 @@ int main(int argc, char **argv)
 		insns++;
 	}
 
-	fprintf(stdout, "%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
+	fprintf((errors) ? stderr : stdout,
+		"%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
 		prog,
 		(errors) ? "Failure" : "Success",
 		insns,
-- 
2.7.4

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

* [tip:x86/asm] x86/decoder: Use stdout if insn decoder test is successful
  2016-10-25 20:56 ` [PATCH 1/2] x86: use stdout if insn decoder test is successful Paul Bolle
@ 2016-10-26  6:54   ` tip-bot for Paul Bolle
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Paul Bolle @ 2016-10-26  6:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: pebolle, linux-kernel, peterz, hpa, torvalds, akpm, mingo, tglx

Commit-ID:  bdcc18b548b8f1fab23c097724c6f32daac03185
Gitweb:     http://git.kernel.org/tip/bdcc18b548b8f1fab23c097724c6f32daac03185
Author:     Paul Bolle <pebolle@tiscali.nl>
AuthorDate: Tue, 25 Oct 2016 22:56:04 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 26 Oct 2016 08:41:06 +0200

x86/decoder: Use stdout if insn decoder test is successful

If the instruction decoder test ran successful it prints a message like
this to stderr:
    Succeed: decoded and checked 1767380 instructions

But, as described in "console mode programming user interface guidelines
version 101" which doesn't exist, programs should use stderr for errors
or warnings. We're told about a successful run here, so the instruction
decoder test should use stdout.

Let's fix the typo too, while we're at it.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1477428965-20548-2-git-send-email-pebolle@tiscali.nl
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/tools/test_get_len.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
index 56f04db..ecf31e0 100644
--- a/arch/x86/tools/test_get_len.c
+++ b/arch/x86/tools/test_get_len.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
 		fprintf(stderr, "Warning: decoded and checked %d"
 			" instructions with %d warnings\n", insns, warnings);
 	else
-		fprintf(stderr, "Succeed: decoded and checked %d"
+		fprintf(stdout, "Success: decoded and checked %d"
 			" instructions\n", insns);
 	return 0;
 }

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

* [tip:x86/asm] x86/decoder: Use stderr if insn sanity test fails
  2016-10-25 20:56 ` [PATCH 2/2] x86: use stderr if insn sanity test fails Paul Bolle
@ 2016-10-26  6:55   ` tip-bot for Paul Bolle
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Paul Bolle @ 2016-10-26  6:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: torvalds, linux-kernel, akpm, mingo, peterz, hpa, pebolle, tglx

Commit-ID:  bb12d6740f6de393927362f23f833a79d85df384
Gitweb:     http://git.kernel.org/tip/bb12d6740f6de393927362f23f833a79d85df384
Author:     Paul Bolle <pebolle@tiscali.nl>
AuthorDate: Tue, 25 Oct 2016 22:56:05 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 26 Oct 2016 08:41:06 +0200

x86/decoder: Use stderr if insn sanity test fails

If the instruction sanity test fails, it prints a "Failure" message to
stdout. Make this program behave like the rest of the build and print
that message to stderr.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1477428965-20548-3-git-send-email-pebolle@tiscali.nl
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/tools/insn_sanity.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/tools/insn_sanity.c b/arch/x86/tools/insn_sanity.c
index ba70ff2..1972565 100644
--- a/arch/x86/tools/insn_sanity.c
+++ b/arch/x86/tools/insn_sanity.c
@@ -269,7 +269,8 @@ int main(int argc, char **argv)
 		insns++;
 	}
 
-	fprintf(stdout, "%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
+	fprintf((errors) ? stderr : stdout,
+		"%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
 		prog,
 		(errors) ? "Failure" : "Success",
 		insns,

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

end of thread, other threads:[~2016-10-26  6:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 20:56 [PATCH 0/2] x86: use stdout for success and stdout for failure Paul Bolle
2016-10-25 20:56 ` [PATCH 1/2] x86: use stdout if insn decoder test is successful Paul Bolle
2016-10-26  6:54   ` [tip:x86/asm] x86/decoder: Use " tip-bot for Paul Bolle
2016-10-25 20:56 ` [PATCH 2/2] x86: use stderr if insn sanity test fails Paul Bolle
2016-10-26  6:55   ` [tip:x86/asm] x86/decoder: Use " tip-bot for Paul Bolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).