[PATCH i-g-t v6 09/14] lib/igt_core: Implement conditional backtrace support using HAVE_LIBUNWIND
Kamil Konieczny
kamil.konieczny at linux.intel.com
Fri May 16 16:46:45 UTC 2025
Hi Jeevaka,
On 2025-05-16 at 16:05:46 +0000, Jeevaka Prabu Badrappan wrote:
> Add a log message indicating "backtrace not implemented" in the
> print_backtrace function and return when HAVE_LIBUNWIND is not defined.
>
> Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>
> ---
> lib/igt_core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 1d7402cb7..097a556c9 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -383,6 +383,9 @@ static int _igt_dynamic_tests_executed = -1;
>
> static void print_backtrace(void)
> {
> +#ifndef HAVE_LIBUNWIND
I added here
#error "an error"
and this did not compile on my machine. You need to add HAVE_LIBUNWIND
into lib/meson.build
For example how to do it please grep for HAVE_VALGRIND
and make similar change.
Regards,
Kamil
> + igt_info("backtrace not implemented\n");
> +#else
> unw_cursor_t cursor;
> unw_context_t uc;
> int stack_num = 0;
> @@ -440,6 +443,7 @@ static void print_backtrace(void)
>
> if (dwfl)
> dwfl_end(dwfl);
> +#endif
> }
>
> __attribute__((format(printf, 2, 3)))
> --
> 2.49.0
>
More information about the igt-dev
mailing list