diff options
author | Richard Braun <rbraun@sceen.net> | 2019-05-22 21:59:19 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2019-05-22 21:59:19 +0200 |
commit | 5bc2263b54a89e28dd5092c807a86cd3c078e4d3 (patch) | |
tree | ad399e98a6d46bad25543a4f8680335f3abb1bf8 /test | |
parent | c45d94a590d778c26dc78386c41231fed9df1b14 (diff) |
Add a log print function type for information reporting
This type allows the use of either printf-based or log-based functions
when reporting information.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_mutex.c | 6 | ||||
-rw-r--r-- | test/test_mutex_pi.c | 4 | ||||
-rw-r--r-- | test/test_sref_dirty_zeroes.c | 9 | ||||
-rw-r--r-- | test/test_sref_noref.c | 7 | ||||
-rw-r--r-- | test/test_sref_weakref.c | 11 |
5 files changed, 20 insertions, 17 deletions
diff --git a/test/test_mutex.c b/test/test_mutex.c index 49691cf9..365c25d3 100644 --- a/test/test_mutex.c +++ b/test/test_mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Richard Braun. + * Copyright (c) 2017-2019 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,9 +154,9 @@ test_report_syscnt(struct timer *timer) uint64_t time; #ifdef CONFIG_MUTEX_PI - syscnt_info("rtmutex"); + syscnt_info("rtmutex", log_info); #else /* CONFIG_MUTEX_PI */ - syscnt_info("mutex"); + syscnt_info("mutex", log_info); #endif /* CONFIG_MUTEX_PI */ time = timer_get_time(timer) + clock_ticks_from_ms(TEST_REPORT_INTERVAL); diff --git a/test/test_mutex_pi.c b/test/test_mutex_pi.c index 5ddcfa70..ebe8ea97 100644 --- a/test/test_mutex_pi.c +++ b/test/test_mutex_pi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Richard Braun. + * Copyright (c) 2017-2019 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -312,7 +312,7 @@ test_manage_b(void *arg) } printf("b:%u ", i); - syscnt_info("thread_boosts"); + syscnt_info("thread_boosts", log_info); } } diff --git a/test/test_sref_dirty_zeroes.c b/test/test_sref_dirty_zeroes.c index 53183358..3a88fd02 100644 --- a/test/test_sref_dirty_zeroes.c +++ b/test/test_sref_dirty_zeroes.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Richard Braun. + * Copyright (c) 2014-2019 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include <kern/error.h> #include <kern/init.h> #include <kern/kmem.h> +#include <kern/log.h> #include <kern/macros.h> #include <kern/mutex.h> #include <kern/panic.h> @@ -69,9 +70,9 @@ test_inc(void *arg) } printf("counter global value: %lu\n", test_counter.value); - syscnt_info("sref_epoch"); - syscnt_info("sref_dirty_zero"); - syscnt_info("sref_true_zero"); + syscnt_info("sref_epoch", log_info); + syscnt_info("sref_dirty_zero", log_info); + syscnt_info("sref_true_zero", log_info); } } diff --git a/test/test_sref_noref.c b/test/test_sref_noref.c index e82d14c3..3fcbfb13 100644 --- a/test/test_sref_noref.c +++ b/test/test_sref_noref.c @@ -41,6 +41,7 @@ #include <kern/init.h> #include <kern/error.h> #include <kern/kmem.h> +#include <kern/log.h> #include <kern/macros.h> #include <kern/mutex.h> #include <kern/panic.h> @@ -106,9 +107,9 @@ test_obj_noref(struct sref_counter *counter) obj = structof(counter, struct test_obj, ref_counter); vm_kmem_free(obj, sizeof(*obj)); printf("0 references, page released\n"); - syscnt_info("sref_epoch"); - syscnt_info("sref_dirty_zero"); - syscnt_info("sref_true_zero"); + syscnt_info("sref_epoch", log_info); + syscnt_info("sref_dirty_zero", log_info); + syscnt_info("sref_true_zero", log_info); } static void diff --git a/test/test_sref_weakref.c b/test/test_sref_weakref.c index d1d44071..6b9f1a4d 100644 --- a/test/test_sref_weakref.c +++ b/test/test_sref_weakref.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Richard Braun. + * Copyright (c) 2017-2019 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include <kern/error.h> #include <kern/init.h> +#include <kern/log.h> #include <kern/macros.h> #include <kern/sref.h> #include <kern/syscnt.h> @@ -74,10 +75,10 @@ test_run(void *arg) for (j = 0; j < 0x20000000; j++); printf("run: iterations: %lu\n", i); - syscnt_info("sref_epoch"); - syscnt_info("sref_dirty_zero"); - syscnt_info("sref_revive"); - syscnt_info("sref_true_zero"); + syscnt_info("sref_epoch", log_info); + syscnt_info("sref_dirty_zero", log_info); + syscnt_info("sref_revive", log_info); + syscnt_info("sref_true_zero", log_info); } } |