From patchwork Thu Feb 1 14:00:02 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: 126537 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1736648ljc; Thu, 1 Feb 2018 06:01:36 -0800 (PST) X-Google-Smtp-Source: AH8x227I344QkvXSM9nAXI/4M6G8qnLLwJE9wCNb66Tboh7rbOpb/iLh8Q3AXRumAjFHda19Zs6s X-Received: by 10.13.220.3 with SMTP id f3mr24390476ywe.288.1517493695933; Thu, 01 Feb 2018 06:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517493695; cv=none; d=google.com; s=arc-20160816; b=FXjWDoWvAPrClf7xjKzvVYT4ChpNDuNV6CHWlr/sDJoKIDvh4O0fYGcxPh0o47n+29 1+EXLwevypBK8ntVmsIBWbAhPCOl42mVxduys7m/s4YSwe+naXa5omlkFNHal/2hWTrC t9uJXorP8crmllXyg970kPog8iwnJupPLUz9YqD56hku9kGLhoeYwC6DIx+g8qARV1vZ GLo8KnllSXUSQI5k2dxvkEU4aBraoQjzjH7Sc249+vQPUhuAnQICXB+rI53+RHhFJSz6 OsmD6mFItTh7y6ypC14PZj+x4WECPRjsFTJpr3UtGiIQwnBW1nriSI3UAN4PJswIfy+b vPIg== 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=orNEE4/Qa/OZvCErdN+1ZQFwbvtf01e5BA1XaII7OwQ=; b=AlLmjEFKn8a3ZcXLrncFW+3N7lrHqnxRkxYaa7+HnxPIhOFUG/4teEt3q1nO+EgAtp gJsbcWF4defgs5UttTpaQRD9whRK+Pm8xPXGuNpIkflVtbNEnndzze5A4CblH+C5uxgk OswIB0sG6n2k6azNh82wcbc1jNivRfPa5wON4v6De/gfPcGIPeE+MA2VoLEbv11jC9BO zlAkSAwfeJyVSM1eCEy0QCei3X9OR0Ti9sLPPaXKYE3CH9ljRKyDYqWySv1Cb3e2eQ+a dXOn+L+kS4TRv40cgdSJWBn1RB1EEmaAKiaARAyNvPYeiQ11bZ7zG2w03Vjs08MSonJ4 6i0Q== 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 q12si4386342qtf.61.2018.02.01.06.01.35; Thu, 01 Feb 2018 06:01:35 -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 97A5C617B8; Thu, 1 Feb 2018 14:01:35 +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 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 9A70861698; Thu, 1 Feb 2018 14:00:30 +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 3D97D61773; Thu, 1 Feb 2018 14:00:18 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 084F3616F6 for ; Thu, 1 Feb 2018 14:00:12 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 828F2785E08 for ; Thu, 1 Feb 2018 17:00:10 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rXCVFb05dF-0AtKQTcb; Thu, 01 Feb 2018 17:00:10 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 84IFXYC70u-0An4a9p6; Thu, 01 Feb 2018 17:00:10 +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: Thu, 1 Feb 2018 17:00:02 +0300 Message-Id: <1517493607-30535-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517493607-30535-1-git-send-email-odpbot@yandex.ru> References: <1517493607-30535-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 443 Subject: [lng-odp] [PATCH v1 2/7] 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 Add instrumentation library as odp example. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 443 (bogdanPricope:master_benchmark_pr) ** https://github.com/Linaro/odp/pull/443 ** Patch: https://github.com/Linaro/odp/pull/443.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: a7eb054a87f5e31ccdca856470dd8e2ce0dcdd1b **/ 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 2ea244cf7..332dbae46 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -13,4 +13,8 @@ SUBDIRS = classifier \ timer \ traffic_mgmt +if CODE_INSTRUM +SUBDIRS += instrum +endif + noinst_HEADERS = example_debug.h diff --git a/example/Makefile.inc b/example/Makefile.inc index 3c8060da9..6d62cb6ab 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -16,7 +16,11 @@ AM_CFLAGS = \ $(HELPER_INCLUDES) if STATIC_APPS +if !CODE_INSTRUM AM_LDFLAGS = -L$(LIB) -static else AM_LDFLAGS = endif +else +AM_LDFLAGS = +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 64a51e401..45549b728 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -37,4 +37,5 @@ AC_CONFIG_FILES([example/classifier/Makefile example/time/Makefile example/timer/Makefile example/traffic_mgmt/Makefile + example/instrum/Makefile example/Makefile])