From patchwork Tue Feb 6 10:00:17 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: 126975 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2766229ljc; Tue, 6 Feb 2018 02:06:52 -0800 (PST) X-Google-Smtp-Source: AH8x227jj6wu+FkdS/C7Iluo/TSmw1/QmNuenw8dv06c3czHI0s6h3KHabMaJmJ+tZ8jM290X7eD X-Received: by 10.55.175.65 with SMTP id y62mr2406364qke.20.1517911612033; Tue, 06 Feb 2018 02:06:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517911612; cv=none; d=google.com; s=arc-20160816; b=TWON3H+Z7CVSP0Dn9GfcT4XnU6rbhNgTO6LXWUvVdhtEG8gUvqHIsLxr05afxkhV+p rkwY+Bf0ptc22wWPp3GGoKNFClQ/Z9FMvdNcuokayDeeKGet4EeR683x+fQvkRbTuLol 4SPq0DFpMcCXtTaEDlQ30h+UGLXFVwYVGvsbLxa4sQUC31r6fzWnURWMFHAI8ip/zUYN v+9GHpWiqQwdmCq+pOBt+GMTADGZoT+jQDDjrKcshf0D5PCJv8QQTguni1wbtPoofHRl +LUgvlhuzSvgqsQdbZpe3Cp7LpIjWWxhAU42befYpnjNSGvL9wNB09bhmaP9i+HXWMnn HFRw== 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=8/9lYamM2L8SvilyuQRBedGV/7k07pWO1YLFCnPn0tI=; b=Cia1txopIuK3Xe5pv1g46SXWqOuOS1gCJONC5dxY/V8a4G6j07ogTBi2TU/X7JZTpv YDg2E+LZxwhmSkTIXB7iMZoVfxyMMbsFjlFfsxbIGouLFiUVjcedDBOPQBgbhUUM62OD S7rvkn5lhF3QykaFlHg0PlGC7Ch+xRZu4TxicxIIb5Xl7J+K/pXlqAHu/S+iLDMvsaTi NOu11er89P5LC0NgNf+d1pT3WGuM8eUZyMlwfMfvjfOv54Mfb3lLvOVAXGQ0yboJ2fZ6 7w55JomH+cmIaxBfKrXnAyQUqbzI9k8eznf9YU7g9xzXlz50QqVyj6BUKD7Qzmp0Ypfc ytGQ== 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 l65si2087384qkl.383.2018.02.06.02.06.51; Tue, 06 Feb 2018 02:06:52 -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 B13F061792; Tue, 6 Feb 2018 10:06:51 +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 3DC8F617DE; Tue, 6 Feb 2018 10:03:38 +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 D40ED62783; Tue, 6 Feb 2018 10:03:32 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 73A6D617DE for ; Tue, 6 Feb 2018 10:01:01 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 667C61801792 for ; Tue, 6 Feb 2018 13:01:00 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4sxXDT3eYv-10jiaeiU; Tue, 06 Feb 2018 13:01:00 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id bzfBbjnfEh-0ZwGvjSV; Tue, 06 Feb 2018 13:00:35 +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: Tue, 6 Feb 2018 13:00:17 +0300 Message-Id: <1517911222-3896-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517911222-3896-1-git-send-email-odpbot@yandex.ru> References: <1517911222-3896-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 443 Subject: [lng-odp] [PATCH v4 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: 27a7923236030fed0272cc9072f0cde62496e91d ** Merge commit sha: 34bd4730244cef8aa4ef2778135e469012c66768 **/ example/Makefile.am | 4 ++++ example/Makefile.inc | 4 ++++ example/instrum/Makefile.am | 15 +++++++++++++++ example/instrum/instrum.c | 18 ++++++++++++++++++ example/m4/configure.m4 | 1 + 5 files changed, 42 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..ff4a04060 --- /dev/null +++ b/example/instrum/Makefile.am @@ -0,0 +1,15 @@ +include $(top_srcdir)/Makefile.inc + +AM_CFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir)/example \ + $(ODP_INCLUDES) \ + $(HELPER_INCLUDES) \ + $(PAPI_CFLAGS) + +AM_LDFLAGS = $(PAPI_LIBS) + +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 2fcf596ca..d925bbe78 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -31,4 +31,5 @@ AC_CONFIG_FILES([example/classifier/Makefile example/time/Makefile example/timer/Makefile example/traffic_mgmt/Makefile + example/instrum/Makefile example/Makefile])