add libnuma_helper
PATCH v2 1/4 add libnuma_helper
A library to share NUMA helper functions shared by multiple testcases.
Signed-off-by Jan Stancek <[email protected]>
--- testcases/kernel/syscalls/numa/Makefile | 22 ++++ testcases/kernel/syscalls/numa/Makefile.inc | 27 +++++ testcases/kernel/syscalls/numa/lib/Makefile | 26 ++++ testcases/kernel/syscalls/numa/lib/numa_helper.c | 135 ++++++++++++++++++++++ testcases/kernel/syscalls/numa/lib/numa_helper.h | 34 ++++++ 5 files changed, 244 insertions(+), 0 deletions(-) create mode 100644 testcases/kernel/syscalls/numa/Makefile create mode 100644 testcases/kernel/syscalls/numa/Makefile.inc create mode 100644 testcases/kernel/syscalls/numa/lib/Makefile create mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c create mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h
testcases/kernel/syscalls/numa/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# +# Copyright (C) 2012 Linux Test Project, Inc. +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk
testcases/kernel/syscalls/numa/Makefile.inc new file +27 -0
@@ -0,0 +1,27 @@ +# +# Copyright (C) 2012 Linux Test Project, Inc. +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +CPPFLAGS += $(NUMA_CPPFLAGS) -I../numa/lib/ +LIBDIR := ../numa/lib +LIB := $(LIBDIR)/libnuma_helper.a +MAKE_DEPS += $(LIB) +LDLIBS += $(NUMA_LIBS) -lnuma_helper -lltp +LDFLAGS += -L$(LIBDIR) + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
testcases/kernel/syscalls/numa/lib/Makefile new file +26 -0
@@ -0,0 +1,26 @@ +# +# Copyright (C) 2012 Linux Test Project, Inc. +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -I../../../include +LIB := libnuma_helper.a + +include $(top_srcdir)/include/mk/lib.mk
testcases/kernel/syscalls/numa/lib/numa_helper.c new file +135 -0
135 lines not on this page · raw message
testcases/kernel/syscalls/numa/lib/numa_helper.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Copyright (C) 2012 Linux Test Project, Inc. +* +* 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 +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +* the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef NUMA_HELPER_H +#define NUMA_HELPER_H + +#include "config.h" +#if HAVE_NUMA_H +#include <numa.h> +#endif +#if HAVE_NUMAIF_H +#include <numaif.h> +#endif + +int get_allowed_nodes_arr (int *num_allowed_nodes,int **allowed_nodes); +int get_allowed_nodes (int count, ...); + +#endif +
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list