From patchwork Wed May 4 05:45:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 67106 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp963717qge; Tue, 3 May 2016 22:45:46 -0700 (PDT) X-Received: by 10.50.32.133 with SMTP id j5mr8096692igi.51.1462340746791; Tue, 03 May 2016 22:45:46 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l32si2161038iod.67.2016.05.03.22.45.46; Tue, 03 May 2016 22:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4D4B76108D; Wed, 4 May 2016 05:45:46 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED 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 D1FB0610B1; Wed, 4 May 2016 05:45:23 +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 E02356108D; Wed, 4 May 2016 05:45:21 +0000 (UTC) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by lists.linaro.org (Postfix) with ESMTPS id 9E0506108D for ; Wed, 4 May 2016 05:45:20 +0000 (UTC) Received: by mail-pf0-f179.google.com with SMTP id 77so20799013pfv.2 for ; Tue, 03 May 2016 22:45:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=e5oYZP1H6gv2FxCC2yzFfw8LoozSXWSEUptw+6satO0=; b=TiRDzMVipdvea1bspgc7pl/5+Ub1ygV8j8CKVeXoKeeO1BiCLjATADaMExsSLjKvFn Z4mAd9Wm5mOvfseDkPkGunR2+Sy8sWHiMHlRdHhsM82FCyrqNsJbrr0buWucoauOQWdU 7jjH4A+pDoS9n7uJOG0ZnMLUHf2VsExzUwEYOukkIoEWqc03BpaBYnt2dj4G2Z0HsTds /RowR9/17OzvKRCza0Szloo3rN4Y6PlJA5cGxHZVVfzXqJ+VaXmmvkVVXnzaesqRc8Qz 5WWuFE1K6UdaXCfmBtDbchbAOqEdSSRuqKfK/+wW3hQbZaQKmxpGHp9evPhfY4B4TOim JUnQ== X-Gm-Message-State: AOPr4FVdq9TjPVntiEVGC2FFSiOMZQ2muhSilZL1Xx5JNMuWz06rOmnOB2eX59kGk6JnN2PWMdE= X-Received: by 10.98.0.203 with SMTP id 194mr8894930pfa.126.1462340719988; Tue, 03 May 2016 22:45:19 -0700 (PDT) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id c190sm2484154pfb.33.2016.05.03.22.45.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 May 2016 22:45:19 -0700 (PDT) From: Yi He To: lng-odp@lists.linaro.org Date: Wed, 4 May 2016 05:45:07 +0000 Message-Id: <1462340707-14796-2-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462340707-14796-1-git-send-email-yi.he@linaro.org> References: <1462340707-14796-1-git-send-email-yi.he@linaro.org> Subject: [lng-odp] [API-NEXT, RFC, 1/1] api: cpu: performance profiling start/stop 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Establish a performance profiling environment guarantees meaningful and consistency of consecutive invocations of the odp_cpu_xxx() APIs. While after profiling was done restore the execution environment to its multi-core optimized state. Signed-off-by: Yi He --- include/odp/api/spec/cpu.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h index 2789511..0bc9327 100644 --- a/include/odp/api/spec/cpu.h +++ b/include/odp/api/spec/cpu.h @@ -27,6 +27,21 @@ extern "C" { /** + * @typedef odp_profiler_t + * ODP performance profiler handle + */ + +/** + * Setup a performance profiling environment + * + * A performance profiling environment guarantees meaningful and consistency of + * consecutive invocations of the odp_cpu_xxx() APIs. + * + * @return performance profiler handle + */ +odp_profiler_t odp_profiler_start(void); + +/** * CPU identifier * * Determine CPU identifier on which the calling is running. CPU numbering is @@ -170,6 +185,22 @@ uint64_t odp_cpu_cycles_resolution(void); void odp_cpu_pause(void); /** + * Stop the performance profiling environment + * + * Stop performance profiling and restore the execution environment to its + * multi-core optimized state, won't preserve meaningful and consistency of + * consecutive invocations of the odp_cpu_xxx() APIs anymore. + * + * @param profiler performance profiler handle + * + * @retval 0 on success + * @retval <0 on failure + * + * @see odp_profiler_start() + */ +int odp_profiler_stop(odp_profiler_t profiler); + +/** * @} */