@@ -16,13 +16,11 @@ AM_LDFLAGS = -L$(PAPI_PATH)/lib -lpapi
lib_LTLIBRARIES = $(LIB)/libinstrum.la
-__LIB__libinstrum_la_SOURCES = \
+INSTRUM_SRC = \
instrum.c \
store.c \
papi_cnt.c \
init.c \
- drv.c \
- sched.c \
instrum_common.h \
sample.h \
store.h \
@@ -30,3 +28,15 @@ __LIB__libinstrum_la_SOURCES = \
init.h \
drv.h \
sched.h
+
+if CODE_INSTRUM_SCHED
+AM_CFLAGS += -DCODE_INSTRUM_SCHED
+INSTRUM_SRC += sched.c
+endif
+
+if CODE_INSTRUM_DDF
+AM_CFLAGS += -DCODE_INSTRUM_DDF
+INSTRUM_SRC += drv.c
+endif
+
+__LIB__libinstrum_la_SOURCES = $(INSTRUM_SRC)
@@ -7,6 +7,8 @@
#ifndef __INSTRUM_DRV_H__
#define __INSTRUM_DRV_H__
+#ifdef CODE_INSTRUM_DDF
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -16,4 +18,5 @@ int instr_odpdrv_init(void);
#ifdef __cplusplus
}
#endif
+#endif /* CODE_INSTRUM_DDF */
#endif /* __INSTRUM_DRV_H__ */
@@ -21,11 +21,15 @@ static __attribute__((constructor)) void setup_wrappers(void)
if (instr_odpinit_init())
return;
+#ifdef CODE_INSTRUM_DDF
if (instr_odpdrv_init())
return;
+#endif /* CODE_INSTRUM_DDF */
+#ifdef CODE_INSTRUM_SCHED
if (instr_odpsched_init())
return;
+#endif /* CODE_INSTRUM_SCHED */
}
static __attribute__((destructor)) void teardown_wrappers(void)
@@ -7,6 +7,8 @@
#ifndef __INSTRUM_SCHED_H__
#define __INSTRUM_SCHED_H__
+#ifdef CODE_INSTRUM_SCHED
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -16,4 +18,5 @@ int instr_odpsched_init(void);
#ifdef __cplusplus
}
#endif
+#endif /* CODE_INSTRUM_SCHED */
#endif /* __INSTRUM_SCHED_H__ */
@@ -23,6 +23,15 @@ AS_HELP_STRING([--with-papi-path=DIR path to papi install directory]),
AC_SUBST([PAPI_PATH])
AM_CONDITIONAL([CODE_INSTRUM], [test x$code_instrumentation = xyes ])
+AC_ARG_WITH([code-instrum-profile],
+AS_HELP_STRING([--with-code-instrum-profile=all|scheduler|ddf set code instrumentation profile]),
+ [code_instrum_profile="$withval"],
+ [code_instrum_profile="all"])
+
+AM_CONDITIONAL([CODE_INSTRUM_SCHED],[test $code_instrum_profile = "all" || test $code_instrum_profile = "scheduler"])
+AM_CONDITIONAL([CODE_INSTRUM_DDF],[test $code_instrum_profile = "all" || test $code_instrum_profile = "ddf"])
+
+
AC_CONFIG_FILES([example/classifier/Makefile
example/generator/Makefile
example/hello/Makefile