diff --git a/arch/x86/kernel/cpu.c b/arch/x86/kernel/cpu.c index ab473941..0818c210 100644 --- a/arch/x86/kernel/cpu.c +++ b/arch/x86/kernel/cpu.c @@ -1820,11 +1820,11 @@ mod_nmi_ctx(void *nmi_ctx, void (*func)()) int i; unsigned long flags; -struct x86_cpu_local_variables *v; +//struct x86_cpu_local_variables *v; -if(!ihk_mc_get_processor_id()) { -v = get_x86_this_cpu_local(); -} +//if(!ihk_mc_get_processor_id()) { +//v = get_x86_this_cpu_local(); +//} asm volatile("pushf; pop %0" : "=r"(flags) : : "memory", "cc"); for (i = 0; i < 22; i++) l[i] = l[i + 5]; diff --git a/configure b/configure index 60326c38..92963567 100755 --- a/configure +++ b/configure @@ -629,6 +629,7 @@ DCFA_VERSION MCKERNEL_VERSION IHK_VERSION ENABLE_MCOVERLAYFS +ENABLE_RUSAGE MANDIR KERNDIR KMODDIR @@ -696,6 +697,7 @@ with_system_map enable_dcfa enable_memdump enable_mcoverlayfs +enable_rusage ' ac_precious_vars='build_alias host_alias @@ -1318,6 +1320,7 @@ Optional Features: --enable-dcfa Enable DCFA modules --enable-memdump enable dumping memory and analyzing a dump --enable-mcoverlayfs enable mcoverlayfs implementation + --enable-rusage enable rusage implementation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2111,6 +2114,12 @@ else ENABLE_MCOVERLAYFS=yes fi +# Check whether --enable-rusage was given. +if test "${enable_rusage+set}" = set; then : + enableval=$enable_rusage; ENABLE_RUSAGE=$enableval +else + ENABLE_RUSAGE=no +fi case "X$WITH_KERNELSRC" in Xyes | Xno | X) @@ -3895,6 +3904,16 @@ $as_echo "$as_me: mcoverlayfs is disabled" >&6;} fi +if test "x$ENABLE_RUSAGE" = "xyes" ; then + +$as_echo "#define ENABLE_RUSAGE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: rusage is enabled" >&5 +$as_echo "$as_me: rusage is enabled" >&6;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: rusage is disabled" >&5 +$as_echo "$as_me: rusage is disabled" >&6;} +fi @@ -5118,6 +5137,9 @@ _ACEOF # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ENABLE_RUSAGE=$ENABLE_RUSAGE +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF diff --git a/kernel/Makefile.build.in b/kernel/Makefile.build.in index 28334e10..c84a7335 100644 --- a/kernel/Makefile.build.in +++ b/kernel/Makefile.build.in @@ -1,3 +1,4 @@ +ENABLE_RUSAGE=@ENABLE_RUSAGE@ VPATH=@abs_srcdir@ SRC=$(VPATH) IHKDIR=$(IHKBASE)/$(TARGETDIR) @@ -5,8 +6,12 @@ OBJS = init.o mem.o debug.o mikc.o listeners.o ap.o syscall.o cls.o host.o OBJS += process.o copy.o waitq.o futex.o timer.o plist.o fileobj.o shmobj.o OBJS += zeroobj.o procfs.o devobj.o sysfs.o xpmem.o rusage.o freeze.o DEPSRCS=$(wildcard $(SRC)/*.c) +DOPT= +ifeq ($(ENABLE_RUSAGE),yes) +DOPT=-DENABLE_RUSAGE +endif -CFLAGS += -I$(SRC)/include -D__KERNEL__ -g -fno-omit-frame-pointer -fno-inline -fno-inline-small-functions +CFLAGS += -I$(SRC)/include -D__KERNEL__ $(DOPT) -g -fno-omit-frame-pointer -fno-inline -fno-inline-small-functions LDFLAGS += -e arch_start IHKOBJ = ihk/ihk.o diff --git a/kernel/freeze.c b/kernel/freeze.c index 25a21bc0..ccd1d4cb 100644 --- a/kernel/freeze.c +++ b/kernel/freeze.c @@ -5,7 +5,7 @@ #include extern int nmi_mode; -extern mod_nmi_ctx(void *, void(*)()); +extern void mod_nmi_ctx(void *, void(*)()); extern void lapic_ack(); extern void __freeze(); diff --git a/kernel/include/rusage.h b/kernel/include/rusage.h index 7500d1a1..43b9f5f0 100644 --- a/kernel/include/rusage.h +++ b/kernel/include/rusage.h @@ -1,8 +1,6 @@ #ifndef __RUSAGE_H #define __RUSAGE_H -#define ENABLE_RUSAGE - #define RUSAGE_DEFAULT_SIZE 10 enum RUSAGE_MEMBER {