Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 09:16, Martin Liška wrote: On 7/23/21 9:06 AM, Sebastian Huber wrote: On 23/07/2021 08:52, Martin Liška wrote: +#ifdef NEED_L_GCOV_INFO_TO_GCDA +/* Convert the gcov info to a gcda data stream.  It is intended for +   free-standing environments which do not support the C library

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 11:17, Sebastian Huber wrote: On 23/07/2021 08:52, Martin Liška wrote: It would be nice having a test-case that can test your approach. The problem is that you need the linker set to get access to the gcov information. The test program of the commit message works on my

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 08:52, Martin Liška wrote: It would be nice having a test-case that can test your approach. The problem is that you need the linker set to get access to the gcov information. The test program of the commit message works on my Linux machine. I am not sure if it is generic

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Martin Liška
On 7/23/21 9:06 AM, Sebastian Huber wrote: On 23/07/2021 08:52, Martin Liška wrote: +#ifdef NEED_L_GCOV_INFO_TO_GCDA +/* Convert the gcov info to a gcda data stream.  It is intended for +   free-standing environments which do not support the C library file I/O.  */ + +void +__gcov_info_to_gcda

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 08:52, Martin Liška wrote: +#ifdef NEED_L_GCOV_INFO_TO_GCDA +/* Convert the gcov info to a gcda data stream.  It is intended for +   free-standing environments which do not support the C library file I/O.  */ + +void +__gcov_info_to_gcda (const struct gcov_info *gi_ptr, + 

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Martin Liška
On 7/23/21 8:21 AM, Sebastian Huber wrote: On 23/07/2021 07:31, Martin Liška wrote: +static void * +allocate_handler (unsigned size, void *unused) +{ +  (void)unused; +  return xmalloc (size); +} +#endif /* NEED_L_GCOV */ + +#if defined(NEED_L_GCOV) || defined(NEED_L_GCOV_INFO_TO_GCDA) +static

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Martin Liška
On 7/23/21 8:14 AM, Sebastian Huber wrote: On 23/07/2021 07:31, Martin Liška wrote:   write_topn_counters (const struct gcov_ctr_info *ci_ptr,    unsigned t_ix, - gcov_unsigned_t n_counts) + gcov_unsigned_t n_counts, + void (*dump) (const void *,

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Martin Liška
On 7/23/21 8:10 AM, Sebastian Huber wrote: Hallo Martin, Hello. thanks for your review. On 23/07/2021 07:31, Martin Liška wrote: On 7/13/21 10:15 PM, Sebastian Huber wrote: Hello. Thanks for working on that, there's my review: Add __gcov_info_to_gcda() to libgcov to get the gcda data

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 07:31, Martin Liška wrote: +static void * +allocate_handler (unsigned size, void *unused) +{ +  (void)unused; +  return xmalloc (size); +} +#endif /* NEED_L_GCOV */ + +#if defined(NEED_L_GCOV) || defined(NEED_L_GCOV_INFO_TO_GCDA) +static inline void Likewise here.

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
On 23/07/2021 07:31, Martin Liška wrote:   write_topn_counters (const struct gcov_ctr_info *ci_ptr,    unsigned t_ix, - gcov_unsigned_t n_counts) + gcov_unsigned_t n_counts, + void (*dump) (const void *, unsigned, void *), + void

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-23 Thread Sebastian Huber
Hallo Martin, thanks for your review. On 23/07/2021 07:31, Martin Liška wrote: On 7/13/21 10:15 PM, Sebastian Huber wrote: Hello. Thanks for working on that, there's my review: Add __gcov_info_to_gcda() to libgcov to get the gcda data for a gcda info in a freestanding environment.  It is

Re: [PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-22 Thread Martin Liška
On 7/13/21 10:15 PM, Sebastian Huber wrote: Hello. Thanks for working on that, there's my review: Add __gcov_info_to_gcda() to libgcov to get the gcda data for a gcda info in a freestanding environment. It is intended to be used with the -fprofile-info-section option. A crude test program

[PATCH v2] gcov: Add __gcov_info_to_gdca()

2021-07-13 Thread Sebastian Huber
Add __gcov_info_to_gcda() to libgcov to get the gcda data for a gcda info in a freestanding environment. It is intended to be used with the -fprofile-info-section option. A crude test program which doesn't use a linker script is (use "gcc -coverage -fprofile-info-section -lgcc test.c" to compile