From patchwork Fri Jan 19 08:00:13 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: 125105 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp181428ljf; Fri, 19 Jan 2018 00:04:43 -0800 (PST) X-Google-Smtp-Source: ACJfBosUcW6M72q2U5Br1gGX9ZBpQr1ukbrztYMMQkZO2QRpyXETW4M7HA+ilz6aIaFjQGJk1bQU X-Received: by 10.55.150.6 with SMTP id y6mr57704012qkd.155.1516349083334; Fri, 19 Jan 2018 00:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516349083; cv=none; d=google.com; s=arc-20160816; b=mArYs7r1vHbMoEfrm4tKs1kQtJWUumTbIXnlsYuDg1v2iseJqZFLnVC6IEk+t8uQ+w ixIkDnIiRPGAijlJ66xqnvx7tGzCKh97rP7+SschSfbW/HGw4fiIwndoF8ICj2TVtyik /BE6GeAGG9Rl31C3E/4p1HByhFrsXnF/cr3+R/vEXL008pH9uBHksFSHzq2feVy9Hij6 aqvpiVfnp1EldctaEaciyP7GN2VlJ4kn3lZtkm8AdpxxUXED0WzalHd/VqqAye5S/iNM ZNayN51vkk3iPtYiMe2736N/rioMSCIp2e5oYZzMlL1KZrDgsFdO9iHC24ZiRCc/AsKE i5fA== 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=g20rZMNphcCKGfkyAtglcZY/jd9lv+JrhGapa+nq4T8=; b=UPV5YJHE5gZ3VNh5hfmje4JfTE7MpEgxPoJ6NZM733lmgbfDEID4Vhopt1bE2ctNot J+B31loOrzWMOgeJJg7GPgO7DFvz4KhM+LdZVO6wy5cCRvfR4QtVC4+QZuw0zXauypAI HtJB21Y8fQRc5t0qUSLG0IZfYuXjIDJKABRSLFoX+lc9FW9wCn5TXN2aKvKMg+ru9Z8v s6Qy6lbibTI79AQOBI3o7aPQCcoFum0pAwIVMeA6rkC71CnfifYSnTOE52XiYgPkOf/f jRK7x3B4KQ/2OhEmMwACAvc1TIRKwwurJ+5Urqkzi0DYFedFfWbrzE/lrwp4aIBCSEr0 +ZMg== 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 t10si1147186qth.211.2018.01.19.00.04.43; Fri, 19 Jan 2018 00:04:43 -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 0B45C627F8; Fri, 19 Jan 2018 08:04:43 +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 D5983627FC; Fri, 19 Jan 2018 08:01:51 +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 01D75627FC; Fri, 19 Jan 2018 08:01:42 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 94954627FC for ; Fri, 19 Jan 2018 08:00:18 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 07597124239E for ; Fri, 19 Jan 2018 11:00:17 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xTTOQ56rsp-0GxCWX4S; Fri, 19 Jan 2018 11:00:16 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id DUUW7ACKYu-0GeSY1Gf; Fri, 19 Jan 2018 11:00:16 +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, 19 Jan 2018 11:00:13 +0300 Message-Id: <1516348813-27607-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516348813-27607-1-git-send-email-odpbot@yandex.ru> References: <1516348813-27607-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 406 Subject: [lng-odp] [PATCH CATERPILLAR v1 5/5] example: instrum: configure instrumented API set 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 configure time option to trim API set to be instrumented. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 406 (bogdanPricope:cat_benchmark_pr) ** https://github.com/Linaro/odp/pull/406 ** Patch: https://github.com/Linaro/odp/pull/406.patch ** Base sha: 8f1b3e72d5aa42a336978445a5011758f8044622 ** Merge commit sha: 96735e5c4a87252edc58ccf09fc6398dacaca021 **/ example/instrum/Makefile.am | 18 ++++++++++++++---- example/instrum/drv.h | 3 +++ example/instrum/instrum.c | 4 ++++ example/instrum/sched.h | 3 +++ example/m4/configure.m4 | 17 ++++++++++++----- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/example/instrum/Makefile.am b/example/instrum/Makefile.am index 452b36c46..30c26046f 100644 --- a/example/instrum/Makefile.am +++ b/example/instrum/Makefile.am @@ -25,10 +25,20 @@ noinst_HEADERS = \ $(srcdir)/drv.h \ $(srcdir)/sched.h -__LIB__libinstrum_la_SOURCES = \ +INSTRUM_SRC = \ instrum.c \ store.c \ papi_cnt.c \ - init.c \ - drv.c \ - sched.c + init.c + +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) diff --git a/example/instrum/drv.h b/example/instrum/drv.h index 12441a7e4..ed3dd7a08 100644 --- a/example/instrum/drv.h +++ b/example/instrum/drv.h @@ -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__ */ diff --git a/example/instrum/instrum.c b/example/instrum/instrum.c index 05b38da68..93b6cc78f 100644 --- a/example/instrum/instrum.c +++ b/example/instrum/instrum.c @@ -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) diff --git a/example/instrum/sched.h b/example/instrum/sched.h index 2a092b0ed..6cfc40bdc 100644 --- a/example/instrum/sched.h +++ b/example/instrum/sched.h @@ -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__ */ diff --git a/example/m4/configure.m4 b/example/m4/configure.m4 index d2258bf27..970dfd927 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -7,15 +7,22 @@ AC_ARG_ENABLE([test-example], [test_example=yes]) AM_CONDITIONAL([test_example], [test x$test_example = xyes ]) -PAPI_PATH="" -code_instrumentation=no AC_ARG_WITH([papi-path], AS_HELP_STRING([--with-papi-path=DIR path to papi install directory]), [PAPI_PATH="$withval" - code_instrumentation=yes],[]) - + code_instrumentation=yes], + [PAPI_PATH="" + code_instrumentation=no]) AC_SUBST([PAPI_PATH]) -AM_CONDITIONAL([CODE_INSTRUM], [test x$code_instrumentation = xyes ]) +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