From patchwork Fri Jan 5 15:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 123532 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp915375qgn; Fri, 5 Jan 2018 07:01:56 -0800 (PST) X-Google-Smtp-Source: ACJfBosp2d1+2OOnnuD+V78flTuyWLdnAt2LSFTwz2znqJ8AEjdOwlhdEQ07Lqg1aICYBY7x5Prq X-Received: by 10.237.32.225 with SMTP id 88mr4177248qtb.122.1515164516012; Fri, 05 Jan 2018 07:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515164516; cv=none; d=google.com; s=arc-20160816; b=ESkWdda4JZRLNfi/Mt2/gLRdYSG8MyR+KhzfO4hzH8zTbNwNZ53arEd1g/n35muvAA E2jb4Tj8NmVAGj5khIHKZzzMCPRQSIJam9Vxn59FPC0Cz9uCd+fH1cKnJmUT6hNAfytf QDlz+3vLOa1g3zaoY6RuSvE1XqBgOM0KKVyABO/GNuZZJM5JePvntqXpyFbGGNeWrQ8M rmZOAMXU4GrQmfRTtdrF/bZjWfzGQyMKOdYBPg+BLI7MAgDg0s2tCD0ncVcJwa7DQAkq IjIrnb4pl3EUmTLCj+PY2zuelCzavGUl7QgoDD9q+EHlstTh81A3bDCHwk05V2JoEbAl C+vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=071AJ9Km/h19YrUZ2F1aKKZTeYa8hS+gZ+4ImOVzvo4=; b=ojsIE6jLvJS8+FbPVoZAo8dDddzvp8uChWCiNArFn673Xv7/tPu6+viNBYHnbv0YIi XWNaxWh8nHTvQf63BQbcSn3qbJx6dllibq84s4egLF0EO5/AjZZBKsOfLzIbJ7SI7t6j yHi39vj82RWxxUxVCMgHdNCP0MLhrUm9hqo6lUhr7b2nGb+DcKfS2o0e+BRjD5YWL758 TPutxJYbeCxj0VxJdIkmKOJedJBop9UzWhvqCop+N5fCicRZ12ec85Jn9PUOD9YWDsx0 W3WG5jGEbJ1HhKW9U0KHhkWUXQlQ95fuPni2mQXvg4EoVCw2kvqHpxDwyu8oijhIGYYi Haaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t6si5028112qki.423.2018.01.05.07.01.55; Fri, 05 Jan 2018 07:01:55 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 0CA8E60B11; Fri, 5 Jan 2018 15:01:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id ACA7A60C4C; Fri, 5 Jan 2018 15:00:35 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 75B6460B52; Fri, 5 Jan 2018 15:00:21 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 4198B6081B for ; Fri, 5 Jan 2018 15:00:15 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward104o.mail.yandex.net (Yandex) with ESMTP id CBB02703119 for ; Fri, 5 Jan 2018 18:00:13 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dViD9bsjxV-0D0K26uJ; Fri, 05 Jan 2018 18:00:13 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ty462EFbUF-0CdCD33c; Fri, 05 Jan 2018 18:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 5 Jan 2018 18:00:08 +0300 Message-Id: <1515164409-28381-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515164409-28381-1-git-send-email-odpbot@yandex.ru> References: <1515164409-28381-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 381 Subject: [lng-odp] [PATCH CATERPILLAR v1 2/3] example: instrum: add skeleton X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bogdan Pricope Signed-off-by: Bogdan Pricope --- /** 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: 85dce59a9248687c1522281ae7ac822405a71a20 **/ 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 --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 +#include + +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])