libnuma.c | 1 + numa.3 | 9 +++++++++ numa.h | 3 +++ numademo.c | 8 ++++++-- versions.ldscript | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) Index: numactl-2.0.0/numa.3 =================================================================== --- numactl-2.0.0.orig/numa.3 +++ numactl-2.0.0/numa.3 @@ -156,6 +156,8 @@ numa \- NUMA policy library .sp .BI "extern int " numa_exit_on_error ; .br +.BI "extern int " numa_exit_on_warn ; +.br .BI "void numa_warn(int " number ", char *" where ", ...);" .br @@ -937,6 +939,13 @@ The first argument is a unique number identifying each warning. After that there is a .BR printf (3)-style format string and a variable number of arguments. +.I numa_warn +exits the program when +.I numa_exit_on_warn +is set to a non-zero value. +The default value of +.I numa_exit_on_warn +is zero. .SH Compatibility with libnuma version 1 Binaries that were compiled for libnuma version 1 need not be re-compiled Index: numactl-2.0.0/numa.h =================================================================== --- numactl-2.0.0.orig/numa.h +++ numactl-2.0.0/numa.h @@ -230,6 +230,9 @@ extern int numa_exit_on_error; once. */ void numa_warn(int num, char *fmt, ...); +/* When true exit the program on a numa_warn() call */ +extern int numa_exit_on_warn; + int numa_migrate_pages(int pid, struct bitmask *from, struct bitmask *to); int numa_move_pages(int pid, unsigned long count, void **pages, Index: numactl-2.0.0/numademo.c =================================================================== --- numactl-2.0.0.orig/numademo.c +++ numactl-2.0.0/numademo.c @@ -390,8 +390,8 @@ void test(enum test type) void usage(void) { int i; - printf("usage: numademo [-S] [-f] [-c] msize[kmg] {tests}\nNo tests means run all.\n"); - printf("-c output CSV data. -f run even without NUMA API. -S run stupid tests\n"); + printf("usage: numademo [-S] [-f] [-c] [-e] msize[kmg] {tests}\nNo tests means run all.\n"); + printf("-c output CSV data. -f run even without NUMA API. -S run stupid tests. -e exit on error\n"); printf("valid tests:"); for (i = 0; testname[i]; i++) printf(" %s", testname[i]); @@ -427,6 +427,10 @@ int main(int ac, char **av) case 'S': simple_tests = 1; break; + case 'e': + numa_exit_on_error = 1; + numa_exit_on_warn = 1; + break; default: usage(); break; Index: numactl-2.0.0/libnuma.c =================================================================== --- numactl-2.0.0.orig/libnuma.c +++ numactl-2.0.0/libnuma.c @@ -70,6 +70,7 @@ static int nodemask_sz = 0; static int cpumask_sz = 0; int numa_exit_on_error = 0; +int numa_exit_on_warn = 0; static void set_sizes(void); static inline void Index: numactl-2.0.0/versions.ldscript =================================================================== --- numactl-2.0.0.orig/versions.ldscript +++ numactl-2.0.0/versions.ldscript @@ -59,6 +59,7 @@ libnuma_1.1 { numa_tonode_memory; numa_tonodemask_memory; numa_warn; + numa_exit_on_warn; local: *; }; -- To unsubscribe from this list: send the line "unsubscribe linux-numa" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html