diff mbox

[API-NEXT] api: version.h: add odp_version_str

Message ID 1431100053-17100-1-git-send-email-mike.holmes@linaro.org
State New
Headers show

Commit Message

Mike Holmes May 8, 2015, 3:47 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 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(+)

Comments

Mike Holmes May 11, 2015, 4:13 p.m. UTC | #1
All, this is holding 1.1

On 8 May 2015 at 11:47, Mike Holmes <mike.holmes@linaro.org> wrote:

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  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);
>
> --
> 2.1.4
>
>
Bill Fischofer May 11, 2015, 4:40 p.m. UTC | #2
On Fri, May 8, 2015 at 10:47 AM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  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);
>
> --
> 2.1.4
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes May 11, 2015, 4:44 p.m. UTC | #3
Thanks Bill.

Just need Petri or Robbies confirmation that 1.1 forward will use the
implementation version as a number and not a long string, essentially as it
was before but  we failed to take advantage of it.

Mike

On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org> wrote:

>
>
> On Fri, May 8, 2015 at 10:47 AM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
>
>
>> ---
>>  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);
>>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
Maxim Uvarov May 12, 2015, 11:16 a.m. UTC | #4
with this patch:

     ODP API version: 1.0.4
     ODP implementation version: linux-generic 1.0.4-0 (v1.0.4) May 12 
2015 13:31:28
     ODP version: linux-generic 1.0.4-0 (v1.0.4) May 12 2015 13:31:28

without this patch:

     ODP API version: 1.0.4
     ODP implementation version: linux-generic 1.0.4-0 (v1.0.4) May 12 
2015 13:32:53

I also think that new call is not needed. I think only thing we need is 
test version number is case
if we do not change linux-generic implementation.

So final version formula is

$GEN.$MAJ.$MIN.$IMPL.$TEST  - that version goes to packages, like debian.

This is numeric code which goes to packaging linux-generic. so it will 
be opendataplane-1.1.0.0.tar.gz and deb files
according it line libodp-110.0.0.deb. I.e. in linux-generic we maintain 
implementation number.

Verbose  version sting can be the same + some generated value:
Like:
linux-generic 1.0.4.1 (v1.0.4) May 6 2015 07:54:33

1) "-"  has to be "." to better match versions in packages.

2) "May 6 2015 07:54:33" has to be date of the tag or date of the latest 
commit in ./platform/linux-generic/ directory.
C preprocessor __DATE__   will not work here, because this time will be 
always different and useless.

I think we need to substitute commiter date for the latest commit in 
rfc. Output from that command:
git log -1 --pretty="%cD"
(debian change log has the same date format.)

For one build data has to be the the same for all x86, arm, mips and etc 
builds which we are going to ship as binaries.

3) From other point it we provide hash, like:
linux-generic 1.0.4.1 (v1.0.4) May 6 2015 07:54:33 
https://git.linaro.org/lng/odp.git hash 812ea78445

Then time stamp is useless due to it always matches hash. But it's more 
readable.

4) in some case if we change only test we add additional number at the 
and. So it will be:
linux-generic 1.0.4.1.0 (v1.0.4) May 6 2015 07:54:33 
https://git.linaro.org/lng/odp.git hash 812ea78445
linux-generic 1.0.4.1.1 (v1.0.4) May 6 2015 07:54:33 
https://git.linaro.org/lng/odp.git hash 812ea78445
linux-generic 1.0.4.1.3 (v1.0.4) May 6 2015 07:54:33 
https://git.linaro.org/lng/odp.git hash 812ea78445



So my vote is for following format:

linux-generic 1.0.4.1.0 (v1.0.4) May 6 2015 07:54:33 
https://git.linaro.org/lng/odp.git hash 812ea78445


Thanks,
Maxim.


On 05/12/2015 11:14, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> Hi,
>
> I may have missed some mail but ... don't get why the third string is needed. API string (odp_version_api_str()) is the API version number in string format (in addition to macros in numeric format). Implementation string (odp_version_impl_str()) is a free form string containing whatever information the implementation decides to put there. I’d expect a user to print out both of those into a log or bug report.
>
> What would be the use case for the third one? I expect odp_version_impl_str() include all information needed to identify an implementation, including the build number.
>
> Examples of odp_version_impl_str():
>
> linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
> linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
> linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34 https://git.linaro.org/lng/odp.git hash 812ea78445
> odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
> odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
>
> User would not compare or expect any format on the implementation specific strings. The intention is that each implementation release/build would produces a unique string, which helps then identify bugs,etc ... but implementation decides.
>
>
> -Petri
>
>
>
>
> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of ext Mike Holmes
> Sent: Monday, May 11, 2015 7:45 PM
> To: Bill Fischofer
> Cc: LNG ODP Mailman List
> Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add odp_version_str
>
> Thanks Bill.
>
> Just need Petri or Robbies confirmation that 1.1 forward will use the implementation version as a number and not a long string, essentially as it was before but  we failed to take advantage of it.
>
> Mike
>
> On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>
>
> On Fri, May 8, 2015 at 10:47 AM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
>   
> ---
>   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);
>
> --
> 2.1.4
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
Mike Holmes May 12, 2015, 11:47 a.m. UTC | #5
On 12 May 2015 at 04:14, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

> Hi,
>
> I may have missed some mail but ... don't get why the third string is
> needed. API string (odp_version_api_str()) is the API version number in
> string format (in addition to macros in numeric format). Implementation
> string (odp_version_impl_str()) is a free form string containing whatever
> information the implementation decides to put there. I’d expect a user to
> print out both of those into a log or bug report.
>

The current implementation string needs to remain as a simple value that
the application can compare, forcing an application to parse a long string
does not make any sense to me, in fact I think this should become part of
the API and not implementation defined.

I.e. in my application I can compare API version and then implementation
number to determine if I have the code at the level I require, possibly I
need some important patch level.

To retain that capability and meet your suggestion of an easy way to get a
lot of debug information out  then a verbose string is valuable in addition.




> What would be the use case for the third one? I expect
> odp_version_impl_str() include all information needed to identify an
> implementation, including the build number.
>
> Examples of odp_version_impl_str():
>
> linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
> linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
> linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34
> https://git.linaro.org/lng/odp.git hash 812ea78445
> odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
> odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
>
> User would not compare or expect any format on the implementation specific
> strings. The intention is that each implementation release/build would
> produces a unique string, which helps then identify bugs,etc ... but
> implementation decides.
>
>
> -Petri
>
>
>
>
> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of ext
> Mike Holmes
> Sent: Monday, May 11, 2015 7:45 PM
> To: Bill Fischofer
> Cc: LNG ODP Mailman List
> Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add odp_version_str
>
> Thanks Bill.
>
> Just need Petri or Robbies confirmation that 1.1 forward will use the
> implementation version as a number and not a long string, essentially as it
> was before but  we failed to take advantage of it.
>
> Mike
>
> On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>
>
> On Fri, May 8, 2015 at 10:47 AM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
>
> ---
>  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);
>
> --
> 2.1.4
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org │ Open source software for ARM SoCs
>
>
Maxim Uvarov May 12, 2015, 12:31 p.m. UTC | #6
On 05/12/2015 14:47, Mike Holmes wrote:
>
>
> On 12 May 2015 at 04:14, Savolainen, Petri (Nokia - FI/Espoo) 
> <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>
>     Hi,
>
>     I may have missed some mail but ... don't get why the third string
>     is needed. API string (odp_version_api_str()) is the API version
>     number in string format (in addition to macros in numeric format).
>     Implementation string (odp_version_impl_str()) is a free form
>     string containing whatever information the implementation decides
>     to put there. I’d expect a user to print out both of those into a
>     log or bug report.
>
>
> The current implementation string needs to remain as a simple value 
> that the application can compare, forcing an application to parse a 
> long string does not make any sense to me, in fact I think this should 
> become part of the API and not implementation defined.
>
> I.e. in my application I can compare API version and then 
> implementation number to determine if I have the code at the level I 
> require, possibly I need some important patch level.
>
> To retain that capability and meet your suggestion of an easy way to 
> get a lot of debug information out  then a verbose string is valuable 
> in addition.
>

Yes, ok. How then how about move

#define ODP_IMPL_VERSION to the api?

Maxim.


>
>
>
>     What would be the use case for the third one? I expect
>     odp_version_impl_str() include all information needed to identify
>     an implementation, including the build number.
>
>     Examples of odp_version_impl_str():
>
>     linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
>     linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
>     linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34
>     https://git.linaro.org/lng/odp.git hash 812ea78445
>     odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
>     odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
>
>     User would not compare or expect any format on the implementation
>     specific strings. The intention is that each implementation
>     release/build would produces a unique string, which helps then
>     identify bugs,etc ... but implementation decides.
>
>
>     -Petri
>
>
>
>
>     From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of ext Mike
>     Holmes
>     Sent: Monday, May 11, 2015 7:45 PM
>     To: Bill Fischofer
>     Cc: LNG ODP Mailman List
>     Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add
>     odp_version_str
>
>     Thanks Bill.
>
>     Just need Petri or Robbies confirmation that 1.1 forward will use
>     the implementation version as a number and not a long string,
>     essentially as it was before but  we failed to take advantage of it.
>
>     Mike
>
>     On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>> wrote:
>
>
>     On Fri, May 8, 2015 at 10:47 AM, Mike Holmes
>     <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>> wrote:
>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>
>
>     Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      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);
>
>     --
>     2.1.4
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
>     --
>     Mike Holmes
>     Technical Manager - Linaro Networking Group
>     Linaro.org │ Open source software for ARM SoCs
>
>
>
>
> -- 
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes May 12, 2015, 12:55 p.m. UTC | #7
On 12 May 2015 at 08:31, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 05/12/2015 14:47, Mike Holmes wrote:
>
>>
>>
>> On 12 May 2015 at 04:14, Savolainen, Petri (Nokia - FI/Espoo) <
>> petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>>
>>     Hi,
>>
>>     I may have missed some mail but ... don't get why the third string
>>     is needed. API string (odp_version_api_str()) is the API version
>>     number in string format (in addition to macros in numeric format).
>>     Implementation string (odp_version_impl_str()) is a free form
>>     string containing whatever information the implementation decides
>>     to put there. I’d expect a user to print out both of those into a
>>     log or bug report.
>>
>>
>> The current implementation string needs to remain as a simple value that
>> the application can compare, forcing an application to parse a long string
>> does not make any sense to me, in fact I think this should become part of
>> the API and not implementation defined.
>>
>> I.e. in my application I can compare API version and then implementation
>> number to determine if I have the code at the level I require, possibly I
>> need some important patch level.
>>
>> To retain that capability and meet your suggestion of an easy way to get
>> a lot of debug information out  then a verbose string is valuable in
>> addition.
>>
>>
> Yes, ok. How then how about move
>
> #define ODP_IMPL_VERSION to the api?
>

I would leave it defined where it is, there is a public API to recover the
number already and we want to reuse the public API files as they are
without modifying them in any way per implementation.

I think Alex, Taras and Zoltan representing three additional platforms all
agree we should retain this simple number, please correct me :)

All we need to is update the doxygen to state that the implementation
string is defined by the API as a number that increments per patch - I
suggest that it is relative to the api number, for example the
implementation number increments the 4th digit  when changes are made that
do not alter the API in any way.

Thus you might release  API = 1.1.0 and Implementation = 0 or 1.1.0.0 of
your platform once we sort this out, then you improve the implementation so
you will release  API = 1.1.0 and Implementation = 1 or 1.1.0.1

Then separately we can add the new string API or not, but I really see
value in having that for debug logs.



>
> Maxim.
>
>
>
>>
>>
>>     What would be the use case for the third one? I expect
>>     odp_version_impl_str() include all information needed to identify
>>     an implementation, including the build number.
>>
>>     Examples of odp_version_impl_str():
>>
>>     linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
>>     linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
>>     linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34
>>     https://git.linaro.org/lng/odp.git hash 812ea78445
>>     odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
>>     odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
>>
>>     User would not compare or expect any format on the implementation
>>     specific strings. The intention is that each implementation
>>     release/build would produces a unique string, which helps then
>>     identify bugs,etc ... but implementation decides.
>>
>>
>>     -Petri
>>
>>
>>
>>
>>     From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>>     <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of ext Mike
>>     Holmes
>>     Sent: Monday, May 11, 2015 7:45 PM
>>     To: Bill Fischofer
>>     Cc: LNG ODP Mailman List
>>     Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add
>>     odp_version_str
>>
>>     Thanks Bill.
>>
>>     Just need Petri or Robbies confirmation that 1.1 forward will use
>>     the implementation version as a number and not a long string,
>>     essentially as it was before but  we failed to take advantage of it.
>>
>>     Mike
>>
>>     On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org
>>     <mailto:bill.fischofer@linaro.org>> wrote:
>>
>>
>>     On Fri, May 8, 2015 at 10:47 AM, Mike Holmes
>>     <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>> wrote:
>>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>>     <mailto:mike.holmes@linaro.org>>
>>
>>     Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org
>>     <mailto:bill.fischofer@linaro.org>>
>>
>>
>>     ---
>>      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);
>>
>>     --
>>     2.1.4
>>
>>     _______________________________________________
>>     lng-odp mailing list
>>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>     https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>
>>
>>     --
>>     Mike Holmes
>>     Technical Manager - Linaro Networking Group
>>     Linaro.org │ Open source software for ARM SoCs
>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM
>> SoCs
>>
>>
>>
>> _______________________________________________
>> 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
>
Mike Holmes May 13, 2015, 12:55 p.m. UTC | #8
On 13 May 2015 at 03:48, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>  Hi,
>
>
>
> As discussed yesterday, we’ll keep current api and impl string calls and
> potentially add numeric implementation version calls after v1.1. The
> problem there is to define (== force) common version numbering scheme for
> all implementation.
>
>
>
> E.g. if some  implementation wants to include a hash into its version
> number:
>
> - how many bits are sufficient?
>
> - > or < comparisons would not have any meaning, only =! or ==  would work
>
>
>
>
>

A version defined as four digits would be sufficient in my opinion, the
strings are available for more elaborate logging.

Leaving something as simple as

{
u32 generation
u32 major
u32 minor
u32 patch
} odp_version_t

odp_version_t odp_version();

These increment per the previously well discussed rules, hash information
etc is delivered in the string.


>  -Petri
>
>
>
>
>
> *From:* lng-odp [mailto:lng-odp-bounces@lists.linaro.org] *On Behalf Of *ext
> Mike Holmes
> *Sent:* Tuesday, May 12, 2015 3:56 PM
> *To:* Maxim Uvarov
> *Cc:* lng-odp
>
> *Subject:* Re: [lng-odp] [API-NEXT PATCH] api: version.h: add
> odp_version_str
>
>
>
>
>
>
>
> On 12 May 2015 at 08:31, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> On 05/12/2015 14:47, Mike Holmes wrote:
>
>
>
> On 12 May 2015 at 04:14, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>
>     Hi,
>
>     I may have missed some mail but ... don't get why the third string
>     is needed. API string (odp_version_api_str()) is the API version
>     number in string format (in addition to macros in numeric format).
>     Implementation string (odp_version_impl_str()) is a free form
>     string containing whatever information the implementation decides
>     to put there. I’d expect a user to print out both of those into a
>     log or bug report.
>
>
> The current implementation string needs to remain as a simple value that
> the application can compare, forcing an application to parse a long string
> does not make any sense to me, in fact I think this should become part of
> the API and not implementation defined.
>
> I.e. in my application I can compare API version and then implementation
> number to determine if I have the code at the level I require, possibly I
> need some important patch level.
>
> To retain that capability and meet your suggestion of an easy way to get a
> lot of debug information out  then a verbose string is valuable in addition.
>
>
> Yes, ok. How then how about move
>
> #define ODP_IMPL_VERSION to the api?
>
>
>
> I would leave it defined where it is, there is a public API to recover the
> number already and we want to reuse the public API files as they are
> without modifying them in any way per implementation.
>
>
>
> I think Alex, Taras and Zoltan representing three additional platforms all
> agree we should retain this simple number, please correct me :)
>
>
>
> All we need to is update the doxygen to state that the implementation
> string is defined by the API as a number that increments per patch - I
> suggest that it is relative to the api number, for example the
> implementation number increments the 4th digit  when changes are made that
> do not alter the API in any way.
>
>
>
> Thus you might release  API = 1.1.0 and Implementation = 0 or 1.1.0.0 of
> your platform once we sort this out, then you improve the implementation so
> you will release  API = 1.1.0 and Implementation = 1 or 1.1.0.1
>
>
>
> Then separately we can add the new string API or not, but I really see
> value in having that for debug logs.
>
>
>
>
>
>
> Maxim.
>
>
>
>
>     What would be the use case for the third one? I expect
>     odp_version_impl_str() include all information needed to identify
>     an implementation, including the build number.
>
>     Examples of odp_version_impl_str():
>
>     linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
>     linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
>     linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34
>     https://git.linaro.org/lng/odp.git hash 812ea78445
>     odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
>     odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
>
>     User would not compare or expect any format on the implementation
>     specific strings. The intention is that each implementation
>     release/build would produces a unique string, which helps then
>     identify bugs,etc ... but implementation decides.
>
>
>     -Petri
>
>
>
>
>     From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of ext Mike
>     Holmes
>     Sent: Monday, May 11, 2015 7:45 PM
>     To: Bill Fischofer
>     Cc: LNG ODP Mailman List
>     Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add
>     odp_version_str
>
>     Thanks Bill.
>
>     Just need Petri or Robbies confirmation that 1.1 forward will use
>     the implementation version as a number and not a long string,
>     essentially as it was before but  we failed to take advantage of it.
>
>     Mike
>
>     On 11 May 2015 at 12:40, Bill Fischofer <bill.fischofer@linaro.org
>
>     <mailto:bill.fischofer@linaro.org>> wrote:
>
>
>     On Fri, May 8, 2015 at 10:47 AM, Mike Holmes
>     <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>> wrote:
>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>
>
>     Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>
>
>
>     ---
>      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);
>
>     --
>     2.1.4
>
>     _______________________________________________
>     lng-odp mailing list
>
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
>     --
>     Mike Holmes
>     Technical Manager - Linaro Networking Group
>     Linaro.org │ Open source software for ARM SoCs
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
>
>
> _______________________________________________
> 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
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
diff mbox

Patch

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);