diff mbox series

[CATERPILLAR,v4,2/5] example: instrum: add skeleton

Message ID 1516284076-2857-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [CATERPILLAR,v4,1/5] example: add papi path configuration option | expand

Commit Message

Github ODP bot Jan. 18, 2018, 2:01 p.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 381 (bogdanPricope:cat_benchmark_poc)
 ** https://github.com/Linaro/odp/pull/381
 ** Patch: https://github.com/Linaro/odp/pull/381.patch
 ** Base sha: 4d17f8ae64aba0e6f24877be30f86ae5880cef7e
 ** Merge commit sha: c651bdf2f6e197eb49c2aecff6f64a247db2b982
 **/
 example/Makefile.am         |  4 ++++
 example/Makefile.inc        |  4 ++++
 example/instrum/Makefile.am | 20 ++++++++++++++++++++
 example/instrum/instrum.c   | 18 ++++++++++++++++++
 example/m4/configure.m4     |  1 +
 5 files changed, 47 insertions(+)
 create mode 100644 example/instrum/Makefile.am
 create mode 100644 example/instrum/instrum.c
diff mbox series

Patch

diff --git a/example/Makefile.am b/example/Makefile.am
index b6e8d81fe..99c5726f7 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -13,4 +13,8 @@  SUBDIRS = classifier \
 	  ddf_ifs \
 	  ddf_app
 
+if CODE_INSTRUM
+SUBDIRS += instrum
+endif
+
 noinst_HEADERS = example_debug.h
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 31bf7c435..78b750cda 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -13,4 +13,8 @@  AM_CFLAGS = \
 	-I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
 	-I$(top_builddir)/include
 
+if CODE_INSTRUM
+AM_LDFLAGS = -L$(LIB) -lssl -lcrypto -latomic
+else
 AM_LDFLAGS = -L$(LIB) -static
+endif
diff --git a/example/instrum/Makefile.am b/example/instrum/Makefile.am
new file mode 100644
index 000000000..bf2a19c0d
--- /dev/null
+++ b/example/instrum/Makefile.am
@@ -0,0 +1,20 @@ 
+LIB   = $(top_builddir)/lib
+
+AM_CFLAGS = \
+        -I$(srcdir) \
+        -I$(top_srcdir)/example \
+        -I$(top_srcdir)/platform/@with_platform@/include \
+        -I$(top_srcdir)/include/ \
+        -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
+        -I$(top_srcdir)/helper/include \
+        -I$(top_builddir)/platform/@with_platform@/include \
+        -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
+        -I$(top_builddir)/include \
+        -I$(PAPI_PATH)/include
+
+AM_LDFLAGS = -L$(PAPI_PATH)/lib -lpapi
+
+lib_LTLIBRARIES = $(LIB)/libinstrum.la
+
+__LIB__libinstrum_la_SOURCES = \
+		instrum.c
diff --git a/example/instrum/instrum.c b/example/instrum/instrum.c
new file mode 100644
index 000000000..88580c58f
--- /dev/null
+++ b/example/instrum/instrum.c
@@ -0,0 +1,18 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static __attribute__((constructor)) void setup_wrappers(void)
+{
+	printf("Setup Wrappers\n");
+}
+
+static __attribute__((destructor)) void teardown_wrappers(void)
+{
+	printf("Teardown Wrappers\n");
+}
diff --git a/example/m4/configure.m4 b/example/m4/configure.m4
index 034415903..d2258bf27 100644
--- a/example/m4/configure.m4
+++ b/example/m4/configure.m4
@@ -31,4 +31,5 @@  AC_CONFIG_FILES([example/classifier/Makefile
 		 example/traffic_mgmt/Makefile
 		 example/ddf_ifs/Makefile
 		 example/ddf_app/Makefile
+		 example/instrum/Makefile
 		 example/Makefile])