From patchwork Tue Feb 6 10:00:20 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: 126980 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2769940ljc; Tue, 6 Feb 2018 02:11:58 -0800 (PST) X-Google-Smtp-Source: AH8x224AIeegw38AFMrmGhnNllG4Vbd4rFpd4Byzv/nsQzvy1jlnE7oRMaw7veCWEbtknPsh8885 X-Received: by 10.55.24.147 with SMTP id 19mr2738210qky.173.1517911918588; Tue, 06 Feb 2018 02:11:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517911918; cv=none; d=google.com; s=arc-20160816; b=ZpPNczfPJVfWh+AWugjDxSQf2Fvjrj+Xf83wLaRiVcY9oaGt2zuSrqXWCh3tHDxz1d vv8+jMazaC7fByGVXI3lcjJerZuy/liHD5b+loknADc8vSM5G4Mnb9WN9luzEp064kpz nBx3pQhkFb8xpiSuUmWE8hP6TiHNVmrI3oinKMPF1rzzF8MdjbxxkqBtFYspdtl+gIeb b0wvP/QQ7M0EIWd11DnWmHF5fZlaFYOCp+3DepQvNN269QyazL2DtCue9FxMMRKF8AGO uNN4XVosOf94ot+l/PwIMOt85QvTN2mvGPXCxyHkldCflqpcbcDTP6TKAe68GMOcA138 wFHA== 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=NonuNpCp00wKyXmDUlXxclrRs2ZZPU2K4aSu8WdZ00o=; b=XS7uuXU9Ce2M6ZdLu2vMDGyYS8R9DN4fnQPdhCAKEk+Jy5cp07rnIbCpxmSzVkQyk5 7LfI+4tIJZ48c1byEnbvplhAYddyDs1q3EpwddJ9V9womDIZoNOoMxtlWHgOz9oB0FSo B22Y/c6fu42M8NI3zjPb+6tuqutwHp24qaU597lt5hTrDMtHPx+Tj5eJVcWo7FG7+zm4 q2QFj6EJB8KPXI4L01Nf7LpXkvE4a/vFF1waxvkb0ex4QKODmc8Ug9NT4+WI4gSr0EJ3 lSPhDN+b1vf4qu4cmKEU6s4+ihXlbGO/CUPtHfCmY7DtuXH/UsPaKC4DeYkZC/67Jbcf 3Yeg== 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 n186si6970122qkc.309.2018.02.06.02.11.58; Tue, 06 Feb 2018 02:11:58 -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 43E7D6182D; Tue, 6 Feb 2018 10:11:58 +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 8C1816278A; Tue, 6 Feb 2018 10:04:54 +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 C31746181C; Tue, 6 Feb 2018 10:04:47 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 126E46181D for ; Tue, 6 Feb 2018 10:02:17 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward106p.mail.yandex.net (Yandex) with ESMTP id D61D52D83E68 for ; Tue, 6 Feb 2018 13:01:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ah2ahEj2Tt-1KJGEOgY; Tue, 06 Feb 2018 13:01:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id bzfBbjnfEh-1Ew8mSBu; Tue, 06 Feb 2018 13:01:14 +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:20 +0300 Message-Id: <1517911222-3896-6-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 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 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/instrum/Makefile.am | 16 +++++++++++++--- example/instrum/instrum.c | 4 ++++ example/instrum/pktio_direct.h | 3 +++ example/instrum/sched.h | 3 +++ example/m4/configure.m4 | 8 ++++++++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/example/instrum/Makefile.am b/example/instrum/Makefile.am index 852bdc77f..368f24c7d 100644 --- a/example/instrum/Makefile.am +++ b/example/instrum/Makefile.am @@ -11,13 +11,11 @@ AM_LDFLAGS = $(PAPI_LIBS) lib_LTLIBRARIES = $(LIB)/libinstrum.la -__LIB__libinstrum_la_SOURCES = \ +INSTRUM_SRC = \ instrum.c \ store.c \ papi_cnt.c \ init.c \ - pktio_direct.c\ - sched.c \ instrum_common.h \ sample.h \ store.h \ @@ -25,3 +23,15 @@ __LIB__libinstrum_la_SOURCES = \ init.h \ pktio_direct.h \ sched.h + +if CODE_INSTRUM_SCHED +AM_CFLAGS += -DCODE_INSTRUM_SCHED +INSTRUM_SRC += sched.c +endif + +if CODE_INSTRUM_PKTIO_DIRECT +AM_CFLAGS += -DCODE_INSTRUM_PKTIO_DIRECT +INSTRUM_SRC += pktio_direct.c +endif + +__LIB__libinstrum_la_SOURCES = $(INSTRUM_SRC) diff --git a/example/instrum/instrum.c b/example/instrum/instrum.c index 605675154..aba07e0c2 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_SCHED if (instr_odpsched_init()) return; +#endif /* CODE_INSTRUM_SCHED */ +#ifdef CODE_INSTRUM_PKTIO_DIRECT if (instr_odppktio_direct_init()) return; +#endif /* CODE_INSTRUM_PKTIO_DIRECT */ } static __attribute__((destructor)) void teardown_wrappers(void) diff --git a/example/instrum/pktio_direct.h b/example/instrum/pktio_direct.h index 1bc544dd2..6f2fc6ce7 100644 --- a/example/instrum/pktio_direct.h +++ b/example/instrum/pktio_direct.h @@ -7,6 +7,8 @@ #ifndef __INSTRUM_PKTIO_DIRECT_H__ #define __INSTRUM_PKTIO_DIRECT_H__ +#ifdef CODE_INSTRUM_PKTIO_DIRECT + #ifdef __cplusplus extern "C" { #endif @@ -16,4 +18,5 @@ int instr_odppktio_direct_init(void); #ifdef __cplusplus } #endif +#endif /* CODE_INSTRUM_PKTIO_DIRECT */ #endif /* __INSTRUM_PKTIO_DIRECT_H__ */ 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 d925bbe78..f2ed909e1 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -17,6 +17,14 @@ AC_ARG_ENABLE([code-instrum], AM_CONDITIONAL([CODE_INSTRUM], [test x$code_instrumentation = xyes ]) +AC_ARG_WITH([code-instrum-profile], +AS_HELP_STRING([--with-code-instrum-profile=all|scheduler|pktio_direct 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_PKTIO_DIRECT],[test $code_instrum_profile = "all" || test $code_instrum_profile = "pktio_direct"]) + AC_CONFIG_FILES([example/classifier/Makefile example/generator/Makefile example/hello/Makefile