From patchwork Mon Jan 29 16:00:19 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: 126180 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp2558450ljd; Mon, 29 Jan 2018 08:06:25 -0800 (PST) X-Google-Smtp-Source: AH8x225DNzbxFeWVkJnVv5+JjQAG7gHXuaBj/8xg2C2KyobuLlLjItC0ZJ0IbNzn1JfNAICuC46I X-Received: by 10.13.242.68 with SMTP id b65mr12284636ywf.399.1517241985575; Mon, 29 Jan 2018 08:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517241985; cv=none; d=google.com; s=arc-20160816; b=qKTndYvFrvnKWzNymdmHN24ixsDvUTZU1uAP2Zk1EecyXkwRVwrRNPGJbQFe2qV0gm +AFyC8x5VpIXImz9tRmT7NrP31KJY5Kqn0K55K1RpU6YkrgNRExorNkfyp8pvJm4biiy Xnc6wRlzXeaV/0hpOmObAQDLP9Xr6qU8F1IT+x+Z2VpOwbXkoQ9QXHzEK1qhZqSh+9Pi b8HxG75rfmrRPT6gI07irVhIy8R6Wikq6RHhM3IX7ekT6VhI23NSLeXGDRqUtuReH70M CONM2YkVyb7w0brsRzRO5OnyOCSne6SagJa0H6PnNcaS2JodCSrc89hDu+7UWgpRRSyI 5/VA== 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=GVScX6V4h5uGCVrUggPyBLctapre37BHyFTCuKPDkLk=; b=JEoFAw15FKzhOgakM/mgw/qv2sOY38ky+5DvLlaLDAiq85zfyzVEBMGrd6A3MY3mXZ N3NkrI4HAt/jsSGDCpFmSbarD/JCZM2C2NratuTMPUm4RM3/EyYCBPcxYGjMixt3/zE5 ez//nppDEsxQg0UZSsYBIFKuaO7Oavy49IuxgNGwSpJU0FFe5n2b/W74dUEYBYAZxevF gses7eEqEeMdQAt/B+RjvvB0MduO3tbR+uLDTaG05RZrs79lvGVdvhVqFwVwD3W+xBHE gvc6ymyF2P9aS99Ovb4UDZSUfugd1uHK7C7wq6oOnokOfu0t1YnLFrnVKCB20syl0H5k Bsmw== 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 f64si2134500ywc.677.2018.01.29.08.06.25; Mon, 29 Jan 2018 08:06:25 -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 2982660956; Mon, 29 Jan 2018 16:06:25 +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_H2 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 8E08261754; Mon, 29 Jan 2018 16:01:00 +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 3EF4160C5E; Mon, 29 Jan 2018 16:00:37 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id B7A2F60912 for ; Mon, 29 Jan 2018 16:00:27 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 23D982182034 for ; Mon, 29 Jan 2018 19:00:26 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hHAlNwpUni-0QLCZarn; Mon, 29 Jan 2018 19:00:26 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 1WljkUuA25-0Pdeh9hd; Mon, 29 Jan 2018 19:00:25 +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: Mon, 29 Jan 2018 19:00:19 +0300 Message-Id: <1517241621-24528-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517241621-24528-1-git-send-email-odpbot@yandex.ru> References: <1517241621-24528-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 406 Subject: [lng-odp] [PATCH CATERPILLAR v3 5/7] 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: 5251bda54b51d3754aaf8c988aa959b48b4d25f9 ** Merge commit sha: 2d6677b6a3794cad32abe2af7314215ea22921c3 **/ example/instrum/Makefile.am | 16 +++++++++++++--- example/instrum/drv.h | 3 +++ example/instrum/instrum.c | 4 ++++ example/instrum/sched.h | 3 +++ example/m4/configure.m4 | 9 +++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/example/instrum/Makefile.am b/example/instrum/Makefile.am index d5111c16c..e1fdbf7ab 100644 --- a/example/instrum/Makefile.am +++ b/example/instrum/Makefile.am @@ -16,13 +16,11 @@ AM_LDFLAGS = -L$(PAPI_PATH)/lib -lpapi lib_LTLIBRARIES = $(LIB)/libinstrum.la -__LIB__libinstrum_la_SOURCES = \ +INSTRUM_SRC = \ instrum.c \ store.c \ papi_cnt.c \ init.c \ - drv.c \ - sched.c \ instrum_common.h \ sample.h \ store.h \ @@ -30,3 +28,15 @@ __LIB__libinstrum_la_SOURCES = \ init.h \ drv.h \ sched.h + +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 5a05717b8..3e7a69112 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -23,6 +23,15 @@ AS_HELP_STRING([--with-papi-path=DIR path to papi install directory]), AC_SUBST([PAPI_PATH]) 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 example/hello/Makefile