[PATCH v4 09/15] lib/igt_core: Add print_backtrace placeholder for Android

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed May 14 14:31:57 UTC 2025


Hi Jeevaka,
On 2025-05-07 at 16:01:42 +0000, Jeevaka Prabu Badrappan wrote:
> As libunwind is not built for Android, print_backtrace placeholder
> aded with not implemented log.
> 
> Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>

Looks OK, one thing - why not using HAVE_LIBUNWIND instead and
make it conditional depending on existence of this lib?

+cc Zbigniew

> ---
>  lib/igt_core.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 6c89e136b..e7d979042 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -381,6 +381,12 @@ static bool stderr_needs_sentinel = false;
>  
>  static int _igt_dynamic_tests_executed = -1;
>  
> +#ifdef ANDROID
> +static void print_backtrace(void)
> +{

Move this #ifdef/#else/#endif inside a function.

Regards,
Kamil

> +	igt_info("backtrace not implemented\n");
> +}
> +#else
>  static void print_backtrace(void)
>  {
>  	unw_cursor_t cursor;
> @@ -441,6 +447,7 @@ static void print_backtrace(void)
>  	if (dwfl)
>  		dwfl_end(dwfl);
>  }
> +#endif /* ANDROID */
>  
>  __attribute__((format(printf, 2, 3)))
>  static void internal_assert(bool cond, const char *format, ...)
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list