igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2.
@ 2018-08-29 10:43 Maarten Lankhorst
  2018-08-29 11:07 ` Petri Latvala
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2018-08-29 10:43 UTC (permalink / raw)
  To: igt-dev

elfutils is LGPLv3 or GPLv2, so it's ok to link against it.

Before:
IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
Starting subtest: fail-result
(meta_test:29661) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
(meta_test:29661) CRITICAL: Failed assertion: result == 1
(meta_test:29661) CRITICAL: error: 0 != 1
Stack trace:
  #0 [__igt_fail_assert+0x20a]
  #1 [test_result+0x7a]
  #2 [__real_main120+0x240]
  #3 [main+0x4a]
  #4 (../csu/libc-start.c) __libc_start_main:344
  #5 [_start+0x2a]

After:
IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
Starting subtest: fail-result
(meta_test:1357) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
(meta_test:1357) CRITICAL: Failed assertion: result == 1
(meta_test:1357) CRITICAL: error: 0 != 1
Stack trace:
  #0 ../lib/igt_core.c:1467 __igt_fail_assert()
  #1 ../tests/meta_test.c:95 test_result()
  #2 ../tests/meta_test.c:137 __real_main120()
  #3 ../tests/meta_test.c:120 main()
  #4 ../csu/libc-start.c:344 __libc_start_main()
  #5 [_start+0x2a]

Changes since v1:
- Add libdw dependency to readme.
- Change backtrace format slightly.

Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 README          |  1 +
 configure.ac    |  1 +
 lib/Makefile.am |  2 ++
 lib/igt_core.c  | 50 ++++++++++++++++++++++++++++++++++++++++++++-----
 lib/meson.build |  1 +
 meson.build     |  1 +
 6 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/README b/README
index c71ecedd0e5e..f8ba5c710e81 100644
--- a/README
+++ b/README
@@ -148,6 +148,7 @@ the default configuration (package names may vary):
 	libpciaccess-dev
 	libprocps-dev
 	libunwind-dev
+	libdw-dev
 	python-docutils
 	x11proto-dri2-dev
 	xutils-dev
diff --git a/configure.ac b/configure.ac
index 72f359943779..c75ef284f3bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,7 @@ PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 PKG_CHECK_MODULES(KMOD, [libkmod])
 PKG_CHECK_MODULES(PROCPS, [libprocps])
 PKG_CHECK_MODULES(LIBUNWIND, [libunwind])
+PKG_CHECK_MODULES(LIBDW, [libdw])
 PKG_CHECK_MODULES(SSL, [openssl])
 PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
 
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6251bdb85f67..388b8b00ae36 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -60,6 +60,7 @@ AM_CFLAGS = \
 	    $(DRM_CFLAGS) \
 	    $(PCIACCESS_CFLAGS) \
 	    $(LIBUNWIND_CFLAGS) \
+	    $(LIBDW_CFLAGS) \
 	    $(GSL_CFLAGS) \
 	    $(KMOD_CFLAGS) \
 	    $(PROCPS_CFLAGS) \
@@ -86,6 +87,7 @@ libintel_tools_la_LIBADD = \
 	$(CAIRO_LIBS) \
 	$(LIBUDEV_LIBS) \
 	$(LIBUNWIND_LIBS) \
+	$(LIBDW_LIBS) \
 	$(TIMER_LIBS) \
 	$(XMLRPC_LIBS) \
 	$(LIBUDEV_LIBS) \
diff --git a/lib/igt_core.c b/lib/igt_core.c
index c52c081899c9..4776db93594e 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -73,6 +73,7 @@
 
 #define UNW_LOCAL_ONLY
 #include <libunwind.h>
+#include <elfutils/libdwfl.h>
 
 #ifdef HAVE_LIBGEN_H
 #include <libgen.h>   /* for basename() on Solaris */
@@ -1212,20 +1213,59 @@ static void print_backtrace(void)
 	unw_context_t uc;
 	int stack_num = 0;
 
+	Dwfl_Callbacks cbs = {
+		.find_elf = dwfl_linux_proc_find_elf,
+		.find_debuginfo = dwfl_standard_find_debuginfo,
+	};
+
+	Dwfl *dwfl = dwfl_begin(&cbs);
+
+	if (dwfl_linux_proc_report(dwfl, getpid())) {
+		dwfl_end(dwfl);
+		dwfl = NULL;
+	} else
+		dwfl_report_end(dwfl, NULL, NULL);
+
 	igt_info("Stack trace:\n");
 
 	unw_getcontext(&uc);
 	unw_init_local(&cursor, &uc);
 	while (unw_step(&cursor) > 0) {
 		char name[255];
-		unw_word_t off;
+		unw_word_t off, ip;
+		Dwfl_Module *mod = NULL;
 
-		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
-			strcpy(name, "<unknown>");
+		unw_get_reg(&cursor, UNW_REG_IP, &ip);
+
+		if (dwfl)
+			mod = dwfl_addrmodule(dwfl, ip);
 
-		igt_info("  #%d [%s+0x%x]\n", stack_num++, name,
-			 (unsigned int) off);
+		if (mod) {
+			const char *src, *name;
+			Dwfl_Line *line;
+			int lineno;
+			GElf_Sym sym;
+
+			line = dwfl_module_getsrc(mod, ip);
+			name = dwfl_module_addrsym(mod, ip, &sym, NULL);
+
+			if (line && name) {
+				src = dwfl_lineinfo(line, NULL, &lineno, NULL, NULL, NULL);
+				igt_info("  #%d %s:%d %s()\n", stack_num++, src, lineno, name);
+				continue;
+			}
+		}
+
+		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
+			igt_info("  #%d [<unknown>+0x%x]\n", stack_num++,
+				 (unsigned int) ip);
+		else
+			igt_info("  #%d [%s+0x%x]\n", stack_num++, name,
+				 (unsigned int) off);
 	}
+
+	if (dwfl)
+		dwfl_end(dwfl);
 }
 
 static const char hex[] = "0123456789abcdef";
diff --git a/lib/meson.build b/lib/meson.build
index 6b554c681579..e60e5e02f9d0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -60,6 +60,7 @@ lib_deps = [
 	libprocps,
 	libudev,
 	libunwind,
+	libdw,
 	pciaccess,
 	pthreads,
 	math,
diff --git a/meson.build b/meson.build
index 7278c4383624..faf1b764d69d 100644
--- a/meson.build
+++ b/meson.build
@@ -103,6 +103,7 @@ pciaccess = dependency('pciaccess', version : '>=0.10')
 libkmod = dependency('libkmod')
 libprocps = dependency('libprocps', required : true)
 libunwind = dependency('libunwind', required : true)
+libdw = dependency('libdw', required : true)
 ssl = dependency('openssl', required : true)
 
 valgrind = null_dep
-- 
2.18.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2.
  2018-08-29 10:43 [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2 Maarten Lankhorst
@ 2018-08-29 11:07 ` Petri Latvala
  2018-08-30  9:12   ` Maarten Lankhorst
  2018-08-30  8:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
  2018-08-30  8:16 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Petri Latvala @ 2018-08-29 11:07 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Wed, Aug 29, 2018 at 12:43:24PM +0200, Maarten Lankhorst wrote:
> elfutils is LGPLv3 or GPLv2, so it's ok to link against it.
> 
> Before:
> IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
> Starting subtest: fail-result
> (meta_test:29661) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
> (meta_test:29661) CRITICAL: Failed assertion: result == 1
> (meta_test:29661) CRITICAL: error: 0 != 1
> Stack trace:
>   #0 [__igt_fail_assert+0x20a]
>   #1 [test_result+0x7a]
>   #2 [__real_main120+0x240]
>   #3 [main+0x4a]
>   #4 (../csu/libc-start.c) __libc_start_main:344
>   #5 [_start+0x2a]
> 
> After:
> IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
> Starting subtest: fail-result
> (meta_test:1357) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
> (meta_test:1357) CRITICAL: Failed assertion: result == 1
> (meta_test:1357) CRITICAL: error: 0 != 1
> Stack trace:
>   #0 ../lib/igt_core.c:1467 __igt_fail_assert()
>   #1 ../tests/meta_test.c:95 test_result()
>   #2 ../tests/meta_test.c:137 __real_main120()
>   #3 ../tests/meta_test.c:120 main()
>   #4 ../csu/libc-start.c:344 __libc_start_main()
>   #5 [_start+0x2a]

These line numbers are off just a little bit (as discussed on
IRC). It's not a consistent off-by-one, could be that the used IP is
off by one instruction. Either way, we can brush that off as a TODO
bug, having a bit-off line numbers in stack traces is so much better
than not having them at all.



> 
> Changes since v1:
> - Add libdw dependency to readme.
> - Change backtrace format slightly.
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  README          |  1 +
>  configure.ac    |  1 +
>  lib/Makefile.am |  2 ++
>  lib/igt_core.c  | 50 ++++++++++++++++++++++++++++++++++++++++++++-----
>  lib/meson.build |  1 +
>  meson.build     |  1 +
>  6 files changed, 51 insertions(+), 5 deletions(-)
> 
> diff --git a/README b/README
> index c71ecedd0e5e..f8ba5c710e81 100644
> --- a/README
> +++ b/README
> @@ -148,6 +148,7 @@ the default configuration (package names may vary):
>  	libpciaccess-dev
>  	libprocps-dev
>  	libunwind-dev
> +	libdw-dev
>  	python-docutils
>  	x11proto-dri2-dev
>  	xutils-dev
> diff --git a/configure.ac b/configure.ac
> index 72f359943779..c75ef284f3bc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -128,6 +128,7 @@ PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>  PKG_CHECK_MODULES(KMOD, [libkmod])
>  PKG_CHECK_MODULES(PROCPS, [libprocps])
>  PKG_CHECK_MODULES(LIBUNWIND, [libunwind])
> +PKG_CHECK_MODULES(LIBDW, [libdw])
>  PKG_CHECK_MODULES(SSL, [openssl])
>  PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
>  
> diff --git a/lib/Makefile.am b/lib/Makefile.am
> index 6251bdb85f67..388b8b00ae36 100644
> --- a/lib/Makefile.am
> +++ b/lib/Makefile.am
> @@ -60,6 +60,7 @@ AM_CFLAGS = \
>  	    $(DRM_CFLAGS) \
>  	    $(PCIACCESS_CFLAGS) \
>  	    $(LIBUNWIND_CFLAGS) \
> +	    $(LIBDW_CFLAGS) \
>  	    $(GSL_CFLAGS) \
>  	    $(KMOD_CFLAGS) \
>  	    $(PROCPS_CFLAGS) \
> @@ -86,6 +87,7 @@ libintel_tools_la_LIBADD = \
>  	$(CAIRO_LIBS) \
>  	$(LIBUDEV_LIBS) \
>  	$(LIBUNWIND_LIBS) \
> +	$(LIBDW_LIBS) \
>  	$(TIMER_LIBS) \
>  	$(XMLRPC_LIBS) \
>  	$(LIBUDEV_LIBS) \
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index c52c081899c9..4776db93594e 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -73,6 +73,7 @@
>  
>  #define UNW_LOCAL_ONLY
>  #include <libunwind.h>
> +#include <elfutils/libdwfl.h>
>  
>  #ifdef HAVE_LIBGEN_H
>  #include <libgen.h>   /* for basename() on Solaris */
> @@ -1212,20 +1213,59 @@ static void print_backtrace(void)
>  	unw_context_t uc;
>  	int stack_num = 0;
>  
> +	Dwfl_Callbacks cbs = {
> +		.find_elf = dwfl_linux_proc_find_elf,
> +		.find_debuginfo = dwfl_standard_find_debuginfo,
> +	};
> +
> +	Dwfl *dwfl = dwfl_begin(&cbs);
> +
> +	if (dwfl_linux_proc_report(dwfl, getpid())) {
> +		dwfl_end(dwfl);
> +		dwfl = NULL;
> +	} else
> +		dwfl_report_end(dwfl, NULL, NULL);
> +
>  	igt_info("Stack trace:\n");
>  
>  	unw_getcontext(&uc);
>  	unw_init_local(&cursor, &uc);
>  	while (unw_step(&cursor) > 0) {
>  		char name[255];
> -		unw_word_t off;
> +		unw_word_t off, ip;
> +		Dwfl_Module *mod = NULL;
>  
> -		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
> -			strcpy(name, "<unknown>");
> +		unw_get_reg(&cursor, UNW_REG_IP, &ip);
> +
> +		if (dwfl)
> +			mod = dwfl_addrmodule(dwfl, ip);
>  
> -		igt_info("  #%d [%s+0x%x]\n", stack_num++, name,
> -			 (unsigned int) off);
> +		if (mod) {
> +			const char *src, *name;

Shadowed variable 'name' here.

With that fixed and an added note that libdw is a new mandatory
dependency in the commit message, this is


Reviewed-by: Petri Latvala <petri.latvala@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for lib/core: Use libdw to decode stack trace with debugging symbols, v2.
  2018-08-29 10:43 [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2 Maarten Lankhorst
  2018-08-29 11:07 ` Petri Latvala
@ 2018-08-30  8:04 ` Patchwork
  2018-08-30  8:16 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-08-30  8:04 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: lib/core: Use libdw to decode stack trace with debugging symbols, v2.
URL   : https://patchwork.freedesktop.org/series/48867/
State : failure

== Summary ==

= CI Bug Log - changes from IGT_4610_full -> IGTPW_1751_full =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1751_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1751_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48867/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1751_full:

  === IGT changes ===

    ==== Possible regressions ====

    igt@gem_eio@in-flight-10ms:
      shard-glk:          PASS -> FAIL

    
    ==== Warnings ====

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-wc-untiled:
      shard-snb:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1751_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_isolation@bcs0-s3:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_exec_basic@gtt-vebox:
      shard-snb:          SKIP -> INCOMPLETE (fdo#105411)

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-kbl:          PASS -> FAIL (fdo#103060)

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          PASS -> FAIL (fdo#103925)

    igt@kms_setmode@basic:
      shard-glk:          NOTRUN -> FAIL (fdo#99912)
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_ctx_isolation@vcs0-s3:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#107556) -> PASS

    igt@gem_ctx_isolation@vcs1-none:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#106023) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          FAIL (fdo#103166) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4610 -> IGTPW_1751
    * Linux: CI_DRM_4706 -> CI_DRM_4715

  CI_DRM_4706: 6d5687919f3a3426243041b99111b576dd0576d0 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1751: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1751/
  IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1751/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for lib/core: Use libdw to decode stack trace with debugging symbols, v2.
  2018-08-29 10:43 [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2 Maarten Lankhorst
  2018-08-29 11:07 ` Petri Latvala
  2018-08-30  8:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
@ 2018-08-30  8:16 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-08-30  8:16 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: lib/core: Use libdw to decode stack trace with debugging symbols, v2.
URL   : https://patchwork.freedesktop.org/series/48867/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4715 -> IGTPW_1751 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48867/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1751 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-whl-u:           PASS -> DMESG-FAIL (fdo#106560)
      fi-kbl-7567u:       PASS -> DMESG-FAIL (fdo#106560, fdo#106947)

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-ilk-650:         PASS -> DMESG-WARN (fdo#106387)

    igt@kms_pipe_crc_basic@read-crc-pipe-b:
      {fi-byt-clapper}:   PASS -> FAIL (fdo#107362)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      {fi-cfl-8109u}:     PASS -> INCOMPLETE (fdo#106070)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      {fi-byt-clapper}:   PASS -> FAIL (fdo#103191, fdo#107362)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#106070 https://bugs.freedesktop.org/show_bug.cgi?id=106070
  fdo#106387 https://bugs.freedesktop.org/show_bug.cgi?id=106387
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362


== Participating hosts (53 -> 48) ==

  Additional (1): fi-bxt-dsi 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u 


== Build changes ==

    * IGT: IGT_4610 -> IGTPW_1751

  CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1751: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1751/
  IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1751/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2.
  2018-08-29 11:07 ` Petri Latvala
@ 2018-08-30  9:12   ` Maarten Lankhorst
  0 siblings, 0 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2018-08-30  9:12 UTC (permalink / raw)
  To: Latvala, Petri; +Cc: igt-dev

Op 29-08-18 om 13:07 schreef Petri Latvala:
> On Wed, Aug 29, 2018 at 12:43:24PM +0200, Maarten Lankhorst wrote:
>> elfutils is LGPLv3 or GPLv2, so it's ok to link against it.
>>
>> Before:
>> IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
>> Starting subtest: fail-result
>> (meta_test:29661) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
>> (meta_test:29661) CRITICAL: Failed assertion: result == 1
>> (meta_test:29661) CRITICAL: error: 0 != 1
>> Stack trace:
>>   #0 [__igt_fail_assert+0x20a]
>>   #1 [test_result+0x7a]
>>   #2 [__real_main120+0x240]
>>   #3 [main+0x4a]
>>   #4 (../csu/libc-start.c) __libc_start_main:344
>>   #5 [_start+0x2a]
>>
>> After:
>> IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
>> Starting subtest: fail-result
>> (meta_test:1357) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
>> (meta_test:1357) CRITICAL: Failed assertion: result == 1
>> (meta_test:1357) CRITICAL: error: 0 != 1
>> Stack trace:
>>   #0 ../lib/igt_core.c:1467 __igt_fail_assert()
>>   #1 ../tests/meta_test.c:95 test_result()
>>   #2 ../tests/meta_test.c:137 __real_main120()
>>   #3 ../tests/meta_test.c:120 main()
>>   #4 ../csu/libc-start.c:344 __libc_start_main()
>>   #5 [_start+0x2a]
> These line numbers are off just a little bit (as discussed on
> IRC). It's not a consistent off-by-one, could be that the used IP is
> off by one instruction. Either way, we can brush that off as a TODO
> bug, having a bit-off line numbers in stack traces is so much better
> than not having them at all.
>
>
>
>> Changes since v1:
>> - Add libdw dependency to readme.
>> - Change backtrace format slightly.
>>
>> Cc: Petri Latvala <petri.latvala@intel.com>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>>  README          |  1 +
>>  configure.ac    |  1 +
>>  lib/Makefile.am |  2 ++
>>  lib/igt_core.c  | 50 ++++++++++++++++++++++++++++++++++++++++++++-----
>>  lib/meson.build |  1 +
>>  meson.build     |  1 +
>>  6 files changed, 51 insertions(+), 5 deletions(-)
>>
>> diff --git a/README b/README
>> index c71ecedd0e5e..f8ba5c710e81 100644
>> --- a/README
>> +++ b/README
>> @@ -148,6 +148,7 @@ the default configuration (package names may vary):
>>  	libpciaccess-dev
>>  	libprocps-dev
>>  	libunwind-dev
>> +	libdw-dev
>>  	python-docutils
>>  	x11proto-dri2-dev
>>  	xutils-dev
>> diff --git a/configure.ac b/configure.ac
>> index 72f359943779..c75ef284f3bc 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -128,6 +128,7 @@ PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>>  PKG_CHECK_MODULES(KMOD, [libkmod])
>>  PKG_CHECK_MODULES(PROCPS, [libprocps])
>>  PKG_CHECK_MODULES(LIBUNWIND, [libunwind])
>> +PKG_CHECK_MODULES(LIBDW, [libdw])
>>  PKG_CHECK_MODULES(SSL, [openssl])
>>  PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
>>  
>> diff --git a/lib/Makefile.am b/lib/Makefile.am
>> index 6251bdb85f67..388b8b00ae36 100644
>> --- a/lib/Makefile.am
>> +++ b/lib/Makefile.am
>> @@ -60,6 +60,7 @@ AM_CFLAGS = \
>>  	    $(DRM_CFLAGS) \
>>  	    $(PCIACCESS_CFLAGS) \
>>  	    $(LIBUNWIND_CFLAGS) \
>> +	    $(LIBDW_CFLAGS) \
>>  	    $(GSL_CFLAGS) \
>>  	    $(KMOD_CFLAGS) \
>>  	    $(PROCPS_CFLAGS) \
>> @@ -86,6 +87,7 @@ libintel_tools_la_LIBADD = \
>>  	$(CAIRO_LIBS) \
>>  	$(LIBUDEV_LIBS) \
>>  	$(LIBUNWIND_LIBS) \
>> +	$(LIBDW_LIBS) \
>>  	$(TIMER_LIBS) \
>>  	$(XMLRPC_LIBS) \
>>  	$(LIBUDEV_LIBS) \
>> diff --git a/lib/igt_core.c b/lib/igt_core.c
>> index c52c081899c9..4776db93594e 100644
>> --- a/lib/igt_core.c
>> +++ b/lib/igt_core.c
>> @@ -73,6 +73,7 @@
>>  
>>  #define UNW_LOCAL_ONLY
>>  #include <libunwind.h>
>> +#include <elfutils/libdwfl.h>
>>  
>>  #ifdef HAVE_LIBGEN_H
>>  #include <libgen.h>   /* for basename() on Solaris */
>> @@ -1212,20 +1213,59 @@ static void print_backtrace(void)
>>  	unw_context_t uc;
>>  	int stack_num = 0;
>>  
>> +	Dwfl_Callbacks cbs = {
>> +		.find_elf = dwfl_linux_proc_find_elf,
>> +		.find_debuginfo = dwfl_standard_find_debuginfo,
>> +	};
>> +
>> +	Dwfl *dwfl = dwfl_begin(&cbs);
>> +
>> +	if (dwfl_linux_proc_report(dwfl, getpid())) {
>> +		dwfl_end(dwfl);
>> +		dwfl = NULL;
>> +	} else
>> +		dwfl_report_end(dwfl, NULL, NULL);
>> +
>>  	igt_info("Stack trace:\n");
>>  
>>  	unw_getcontext(&uc);
>>  	unw_init_local(&cursor, &uc);
>>  	while (unw_step(&cursor) > 0) {
>>  		char name[255];
>> -		unw_word_t off;
>> +		unw_word_t off, ip;
>> +		Dwfl_Module *mod = NULL;
>>  
>> -		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
>> -			strcpy(name, "<unknown>");
>> +		unw_get_reg(&cursor, UNW_REG_IP, &ip);
>> +
>> +		if (dwfl)
>> +			mod = dwfl_addrmodule(dwfl, ip);
>>  
>> -		igt_info("  #%d [%s+0x%x]\n", stack_num++, name,
>> -			 (unsigned int) off);
>> +		if (mod) {
>> +			const char *src, *name;
> Shadowed variable 'name' here.
>
> With that fixed and an added note that libdw is a new mandatory
> dependency in the commit message, this is
>
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>

Thanks, pushed. :)

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-30  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29 10:43 [igt-dev] [PATCH i-g-t] lib/core: Use libdw to decode stack trace with debugging symbols, v2 Maarten Lankhorst
2018-08-29 11:07 ` Petri Latvala
2018-08-30  9:12   ` Maarten Lankhorst
2018-08-30  8:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2018-08-30  8:16 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).