From patchwork Fri May 8 15:47:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 48172 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6102221550 for ; Fri, 8 May 2015 15:47:51 +0000 (UTC) Received: by wiun10 with SMTP id n10sf8414199wiu.1 for ; Fri, 08 May 2015 08:47:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=35+uB5CHn4sj1UrKLrRcq3z0rMnU9XblrZNFLo+XhQQ=; b=KqIxfsGoxxSmigG3c0oBqah9BWFeebNcSU9hncXYJM2gWJ29vl9NwRoAQWzSU30iUG mFgEgcbbnT3kPT4KNkdvpkrF7dSJwW5CfHyqrzboCTYu8lJZ/CRFuuXZ0fw7RtNk9uUo HvAij2f+5KPgWySY/pb9QS3/AFEF980X1e/eKGGb35iJKV55fTPhRNgxIhusAqeNcz2n doTDEvSpNZvXIGd6AWPLSV8SLvJy4TnTUQbWqzUq0oV2iyRR9r3aNNTPKpy9FMF61qw3 +ZZH6TjtceBzq7Voy9SeGhAdPGPt4fXYTQy6yoTI6K0VuMIX9VgcHnweTjr0d+rdJr00 jHfg== X-Gm-Message-State: ALoCoQmXMwBNmjKsfxZW54z/QvDcEMw2ojobLUab/lJsLV2HKemAYtbHG8Y32geA1W7Pw+XErzkM X-Received: by 10.112.29.39 with SMTP id g7mr2358257lbh.1.1431100070662; Fri, 08 May 2015 08:47:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.101 with SMTP id i5ls321896laa.58.gmail; Fri, 08 May 2015 08:47:50 -0700 (PDT) X-Received: by 10.112.140.9 with SMTP id rc9mr3438568lbb.14.1431100070511; Fri, 08 May 2015 08:47:50 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ac10si3514661lbc.134.2015.05.08.08.47.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 08:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by layy10 with SMTP id y10so55552485lay.0 for ; Fri, 08 May 2015 08:47:50 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr3421517lab.35.1431100070351; Fri, 08 May 2015 08:47:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp99449lbb; Fri, 8 May 2015 08:47:49 -0700 (PDT) X-Received: by 10.140.152.14 with SMTP id 14mr5866646qhy.91.1431100067992; Fri, 08 May 2015 08:47:47 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d191si5659997qka.74.2015.05.08.08.47.47; Fri, 08 May 2015 08:47:47 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 1FA7D62000; Fri, 8 May 2015 15:47:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3D5A861D20; Fri, 8 May 2015 15:47:42 +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 9FD3161FD3; Fri, 8 May 2015 15:47:40 +0000 (UTC) Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com [209.85.216.172]) by lists.linaro.org (Postfix) with ESMTPS id B46BA61D20 for ; Fri, 8 May 2015 15:47:39 +0000 (UTC) Received: by qcyk17 with SMTP id k17so39080837qcy.1 for ; Fri, 08 May 2015 08:47:39 -0700 (PDT) X-Received: by 10.140.89.200 with SMTP id v66mr5677850qgd.50.1431100059506; Fri, 08 May 2015 08:47:39 -0700 (PDT) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id 47sm3877233qgt.15.2015.05.08.08.47.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 May 2015 08:47:38 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 8 May 2015 11:47:33 -0400 Message-Id: <1431100053-17100-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] api: version.h: add odp_version_str X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- include/odp/api/version.h | 17 +++++++++++++++++ platform/linux-generic/odp_impl.c | 16 ++++++++++++++++ test/miscellaneous/odp_api_from_cpp.cpp | 1 + test/validation/common/odp_cunit_common.c | 1 + test/validation/odp_init.c | 1 + test/validation/odp_init_abort.c | 1 + test/validation/odp_init_log.c | 1 + 7 files changed, 38 insertions(+) diff --git a/include/odp/api/version.h b/include/odp/api/version.h index 027095d..f64e4ef 100644 --- a/include/odp/api/version.h +++ b/include/odp/api/version.h @@ -50,6 +50,8 @@ extern "C" { /** * Returns ODP API version string + * @sa odp_version_impl_str() + * @sa odp_version_str() */ const char *odp_version_api_str(void); @@ -61,10 +63,25 @@ const char *odp_version_api_str(void); * of the API changing, this function returns that indication string. * @note This string is implementation specific. * @sa odp_version_api_str() + * @sa odp_version_str() * * @return null terminated implementation specific version identifier string */ const char *odp_version_impl_str(void); + +/** + * Returns ODP version string + * + * Verbosely describe the build in use, typicaly for use in log file. + * @note This string is implementation specific. + * @sa odp_version_api_str() + * @sa odp_version_impl_str() + * + * @return null terminated implementation specific version string + */ +const char *odp_version_str(void); + + /** * @} */ diff --git a/platform/linux-generic/odp_impl.c b/platform/linux-generic/odp_impl.c index 46d0e40..26ee3f9 100644 --- a/platform/linux-generic/odp_impl.c +++ b/platform/linux-generic/odp_impl.c @@ -38,6 +38,22 @@ const char *odp_version_impl_str(void) return ODP_VERSION_IMPL_STR; } +#define ODP_VERSION_STR \ + ODP_VERSION_TO_STR(PLATFORM) " " \ + ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ + ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ + ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) "-" \ + ODP_VERSION_TO_STR(ODP_VERSION_IMPL) " (v" \ + ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ + ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ + ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) ") " \ + __DATE__ " " __TIME__ " " \ + ODP_VERSION_TO_STR(GIT_HASH) + +const char *odp_version_str(void) +{ + return ODP_VERSION_STR; +} #ifdef __cplusplus } #endif diff --git a/test/miscellaneous/odp_api_from_cpp.cpp b/test/miscellaneous/odp_api_from_cpp.cpp index e62ef8d..f044f92 100644 --- a/test/miscellaneous/odp_api_from_cpp.cpp +++ b/test/miscellaneous/odp_api_from_cpp.cpp @@ -7,6 +7,7 @@ int main(int argc, const char *argv[]) printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + printf("\tODP version: %s\n", odp_version_str()); return 0; } diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index 2af4410..315a902 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -55,6 +55,7 @@ int main(void) printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + printf("\tODP version: %s\n", odp_version_str()); if (0 != odp_init_global(NULL, NULL)) { fprintf(stderr, "error: odp_init_global() failed.\n"); diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c index 82f8849..08e0b08 100644 --- a/test/validation/odp_init.c +++ b/test/validation/odp_init.c @@ -37,6 +37,7 @@ int main(void) printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + printf("\tODP version: %s\n", odp_version_str()); CU_set_error_action(CUEA_ABORT); diff --git a/test/validation/odp_init_abort.c b/test/validation/odp_init_abort.c index ceb82b5..7844066 100644 --- a/test/validation/odp_init_abort.c +++ b/test/validation/odp_init_abort.c @@ -42,6 +42,7 @@ int main(void) printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + printf("\tODP version: %s\n", odp_version_str()); CU_set_error_action(CUEA_ABORT); diff --git a/test/validation/odp_init_log.c b/test/validation/odp_init_log.c index 275d343..f905850 100644 --- a/test/validation/odp_init_log.c +++ b/test/validation/odp_init_log.c @@ -48,6 +48,7 @@ int main(void) printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + printf("\tODP version: %s\n", odp_version_str()); CU_set_error_action(CUEA_ABORT);