Merged to api-next.

Maxim.

On 11/05/2015 12:11, Savolainen, Petri (Nokia - FI/Espoo) wrote:
Ping. A standard way for application to check which implementation it's running 
on.

-Petri

-----Original Message-----
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
EXT Savolainen, Petri (Nokia - FI/Espoo)
Sent: Tuesday, November 03, 2015 10:56 AM
To: EXT Bala Manoharan
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH 1/2] api: version: added
implementation name str

This patch introduces odp_version_impl_name(), which is used to
identify platform e.g.

if (strcmp(odp_version_impl_name(), "odp-dpdk") == 0) {
        // odp-dpdk specific worker thread creation, etc

}

Otherwise it's just documenting what we already have. Implementation
specific defines would be documented in implementation's user guide (as
well as the name above). E.g.

#ifdef _ODP_DPDK
plat_param.foo = 1;
#endif

-Petri




-----Original Message-----
From: EXT Bala Manoharan [mailto:bala.manoha...@linaro.org]
Sent: Tuesday, November 03, 2015 7:24 AM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH 1/2] api: version: added
implementation name str

This method of identifying ODP version using API is useful for
finding
the implementation version while executing the binary. IMO we need to
additionally define a method to identify the version of the compiled
binary statically.

We can add a "#define Version <ODP_IMP_Version>" inside the
implementation file so that we can execute "strings" command on the
compiled binary to grep and identify the implementation version
statically.

Regards,
Bala

On 2 November 2015 at 16:41, Petri Savolainen
<petri.savolai...@nokia.com> wrote:
Refined version API documentation and added implementation
name string that can be used to identify the underlying
implementation at run time.

Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
---
  include/odp/api/version.h | 47
++++++++++++++++++++++++++++++++++++++---------
  1 file changed, 38 insertions(+), 9 deletions(-)

diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index c976f16..d7bce74 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -18,8 +18,15 @@
  extern "C" {
  #endif

-/** @defgroup odp_version ODP VERSION
- *  @{
+/**
+ * @defgroup odp_version ODP VERSION
+ * @details
+ * <b> ODP API and implementation versions </b>
+ *
+ * ODP API version is identified by ODP_VERSION_API_XXX pre-
processor macros.
+ * In addition to these macros, API calls can be used to identify
implementation
+ * and API version information at run time.
+ * @{
   */

  /**
@@ -49,20 +56,42 @@ extern "C" {
  #define ODP_VERSION_API_MINOR 0

  /**
- * Returns ODP API version string
+ * ODP API version string
+ *
+ * The API version string defines ODP API version in this format:
+ * @verbatim <generation>.<major>.<minor> @endverbatim
+ *
+ * The string is null terminated.
+ *
+ * @return Pointer to API version string
   */
  const char *odp_version_api_str(void);

+/**
+ * Implementation name string
+ *
+ * This is a free format string which identifies the
implementation
with a
+ * unique name. The string should be compact and remain constant
over multiple
+ * API and implementation versions. Application can use this to
identify the
+ * underlying implementation at run time. The string is null
terminated.
+ *
+ * @return Pointer to implementation name string
+  */
+const char *odp_version_impl_name(void);

  /**
- * Returns ODP implementation version string
+ * Implementation version string
   *
- * Every implementation of ODP may receive bug fixes independent
of
the version
- * of the API changing, this function returns that indication
string.
- * @note This string is implementation specific.
- * @sa odp_version_api_str()
+ * This is a free format string which identifies the
implementation
with
+ * detailed version information. The string may include
information
about
+ * implementation version, bug fix level, version control tags,
build number,
+ * etc details which exactly identify the implementation code
base.
+ * User may include this information e.g. to bug reports. The
string
is null
+ * terminated.
   *
- * @return null terminated implementation specific version
identifier string
+ * @see odp_version_api_str(), odp_version_impl_name()
+ *
+ * @return Pointer to implementation specific version identifier
string
    */
  const char *odp_version_impl_str(void);
  /**
--
2.6.2

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to