summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/aarch64/processor.c
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2020-02-14 15:59:16 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-16 17:57:06 +0100
commit3439d886e4d9b79b6b226e70c08d312bd31acbd4 (patch)
tree0bd2d1f30cb7414986c9607083889aac9c9549c8 /tools/testing/selftests/kvm/lib/aarch64/processor.c
parentf09205b99832f353088b7c82778b3f8175627620 (diff)
KVM: selftests: Rework debug message printing
There were a few problems with the way we output "debug" messages. The first is that we used DEBUG() which is defined when NDEBUG is not defined, but NDEBUG will never be defined for kselftests because it relies too much on assert(). The next is that most of the DEBUG() messages were actually "info" messages, which users may want to turn off if they just want a silent test that either completes or asserts. Finally, a debug message output from a library function, and thus for all tests, was annoying when its information wasn't interesting for a test. Rework these messages so debug messages only output when DEBUG is defined and info messages output unless QUIET is defined. Also name the functions pr_debug and pr_info and make sure that when they're disabled we eat all the inputs. The later avoids unused variable warnings when the variables were only defined for the purpose of printing. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/aarch64/processor.c')
-rw-r--r--tools/testing/selftests/kvm/lib/aarch64/processor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c
index 216d802479dd..ba2ff3241781 100644
--- a/tools/testing/selftests/kvm/lib/aarch64/processor.c
+++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c
@@ -186,7 +186,7 @@ unmapped_gva:
static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, uint64_t page, int level)
{
-#ifdef DEBUG_VM
+#ifdef DEBUG
static const char * const type[] = { "", "pud", "pmd", "pte" };
uint64_t pte, *ptep;