memblock tests: change build options to run-time options
PATCH 1/1 memblock tests: change build options to run-time options
Change verbose and movable node build options to run-time options.
Movable node usage:
$ ./main -m
Or:
$ ./main --movable-nodeVerbose usage:
$ ./main -v
Or:
$ ./main --verboseSigned-off-by Rebecca Mckeever <[email protected]>
--- tools/testing/memblock/Makefile | 5 -- tools/testing/memblock/linux/memory_hotplug.h | 8 +- tools/testing/memblock/main.c | 2 + .../testing/memblock/scripts/Makefile.include | 10 --- tools/testing/memblock/tests/common.c | 86 ++++++++++++++++--- tools/testing/memblock/tests/common.h | 10 +-- 6 files changed, 79 insertions(+), 42 deletions(-)
tools/testing/memblock/Makefile +0 -5
@@ -45,13 +45,8 @@ help: @echo ' clean - Remove generated files and symlinks in the directory' @echo '' @echo 'Configuration:' - @echo ' make VERBOSE=1 - enable verbose output, which includes the' - @echo ' names of functions being tested and the' - @echo ' number of test cases passing' @echo ' make MEMBLOCK_DEBUG=1 - enable memblock_dbg() messages' @echo ' make NUMA=1 - simulate enabled NUMA' - @echo ' make MOVABLE_NODE=1 - override `movable_node_is_enabled`' - @echo ' definition to simulate movable NUMA nodes' @echo ' make 32BIT_PHYS_ADDR_T=1 - Use 32 bit physical addresses' vpath %.c ../../lib
tools/testing/memblock/linux/memory_hotplug.h +3 -5
@@ -7,13 +7,11 @@#include <linux/cache.h> #include <linux/types.h> +extern bool movable_node_enabled; +static inline bool movable_node_is_enabled (void ) { -#ifdef MOVABLE_NODE -return true; -#else -return false; -#endif +return movable_node_enabled; }#endif
tools/testing/memblock/main.c +2 -0
@@ -3,9 +3,11 @@#include "tests/alloc_api.h" #include "tests/alloc_helpers_api.h" #include "tests/alloc_nid_api.h" +#include "tests/common.h" int main (int argc,char **argv) { +parse_args (argc, argv);memblock_basic_checks ();memblock_alloc_checks ();memblock_alloc_helpers_checks ();
tools/testing/memblock/scripts/Makefile.include +0 -10
@@ -6,11 +6,6 @@ ifeq ($(NUMA), 1) CFLAGS += -D CONFIG_NUMA endif -# Simulate movable NUMA memory regions -ifeq ($(MOVABLE_NODE), 1) - CFLAGS += -D MOVABLE_NODE -endif - # Use 32 bit physical addresses. # Remember to install 32-bit version of dependencies. ifeq ($(32BIT_PHYS_ADDR_T), 1)
@@ -18,11 +13,6 @@ ifeq ($(32BIT_PHYS_ADDR_T), 1) LDFLAGS += -m32 endif -# Enable verbose testing output -ifeq ($(VERBOSE), 1) - CFLAGS += -D VERBOSE -endif - # Enable memblock_dbg() messages ifeq ($(MEMBLOCK_DEBUG), 1) CFLAGS += -D MEMBLOCK_DEBUG
tools/testing/memblock/tests/common.c +73 -13
121 lines not on this page · raw message
tools/testing/memblock/tests/common.h +1 -9
@@ -70,22 +70,14 @@ void reset_memblock_attributes(void);void setup_memblock (void );void dummy_physical_memory_init (void );void dummy_physical_memory_cleanup (void ); +void parse_args (int argc,char **argv); -#ifdef VERBOSE void test_fail (void );void test_pass (void );void test_print (const char *fmt, ...);void prefix_reset (void );void prefix_push (const char *prefix);void prefix_pop (void ); -#else -static inline void test_fail (void ) {} -static inline void test_pass (void ) {} -static inline void test_print (const char *fmt, ...) {} -static inline void prefix_reset (void ) {} -static inline void prefix_push (const char *prefix) {} -static inline void prefix_pop (void ) {} -#endif /* VERBOSE */ static inline void test_pass_pop (void ) {
Signature · 1 line
2.34.1
Quoted 8 lines · Rebecca Mckeever
Change verbose and movable node build options to run-time options.
Movable node usage:
$ ./main -mOr: $ ./main --movable-node
Quoted 7 lines
Verbose usage:
$ ./main -vOr: $ ./main --verboseSigned-off-by Rebecca Mckeever <[email protected]>
LGTM, thanks!
Reviewed-by David Hildenbrand <[email protected]>
Signature · 3 lines
Thanks, David / dhildenb
Quoted 15 lines · Rebecca Mckeever
Change verbose and movable node build options to run-time options.
Movable node usage:
$ ./main -mOr: $ ./main --movable-nodeVerbose usage:
$ ./main -vOr: $ ./main --verboseSigned-off-by Rebecca Mckeever <[email protected]>
Quoted 8 lines
--- tools/testing/memblock/Makefile | 5 -- tools/testing/memblock/linux/memory_hotplug.h | 8 +- tools/testing/memblock/main.c | 2 + .../testing/memblock/scripts/Makefile.include | 10 --- tools/testing/memblock/tests/common.c | 86 ++++++++++++++++--- tools/testing/memblock/tests/common.h | 10 +-- 6 files changed, 79 insertions(+), 42 deletions(-)
Applied, thanks!
Signature · 2 lines
Sincerely yours, Mike.