All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
@ 2017-11-24 10:32 Arkadiusz Hiler
  2017-11-24 10:51 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arkadiusz Hiler @ 2017-11-24 10:32 UTC (permalink / raw)
  To: intel-gfx

write_stderr() and __write_stderr() are defined behind ifdef on
HAVE_LIBUNWIND, but do no depend on the lib in any way.

fatal_sig_handler() uses those helpers unconditionally.

This patch just moves the code couple of lines up, so the helpers are
always available and do not break build on systems without libunwind.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 4fe48c97..6ce83bec 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1231,6 +1231,16 @@ static bool run_under_gdb(void)
 		strncmp(basename(buf), "gdb", 3) == 0);
 }
 
+static void __write_stderr(const char *str, size_t len)
+{
+	igt_ignore_warn(write(STDERR_FILENO, str, len));
+}
+
+static void write_stderr(const char *str)
+{
+	__write_stderr(str, strlen(str));
+}
+
 #ifdef HAVE_LIBUNWIND
 #define UNW_LOCAL_ONLY
 #include <libunwind.h>
@@ -1407,16 +1417,6 @@ xprintf(const char *fmt, ...)
 	va_end(ap);
 }
 
-static void __write_stderr(const char *str, size_t len)
-{
-	igt_ignore_warn(write(STDERR_FILENO, str, len));
-}
-
-static void write_stderr(const char *str)
-{
-	__write_stderr(str, strlen(str));
-}
-
 static void print_backtrace_sig_safe(void)
 {
 	unw_cursor_t cursor;
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
  2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
@ 2017-11-24 10:51 ` Chris Wilson
  2017-11-24 11:07   ` Arkadiusz Hiler
  2017-11-24 11:01 ` Tvrtko Ursulin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-11-24 10:51 UTC (permalink / raw)
  To: Arkadiusz Hiler, intel-gfx

Quoting Arkadiusz Hiler (2017-11-24 10:32:07)
> write_stderr() and __write_stderr() are defined behind ifdef on
> HAVE_LIBUNWIND, but do no depend on the lib in any way.

Hmm, we keep getting caught out by large ifdefs. Although I guess
conditionally enabled code itself is less-than-welcome, we should
probably aim to make whole C files be conditionally compiled, exporting
no-op interfaces when not enabled. Just a thought.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
  2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
  2017-11-24 10:51 ` Chris Wilson
@ 2017-11-24 11:01 ` Tvrtko Ursulin
  2017-11-24 14:33 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-11-24 17:06 ` ✗ Fi.CI.IGT: warning " Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2017-11-24 11:01 UTC (permalink / raw)
  To: Arkadiusz Hiler, intel-gfx


On 24/11/2017 10:32, Arkadiusz Hiler wrote:
> write_stderr() and __write_stderr() are defined behind ifdef on
> HAVE_LIBUNWIND, but do no depend on the lib in any way.
> 
> fatal_sig_handler() uses those helpers unconditionally.
> 
> This patch just moves the code couple of lines up, so the helpers are
> always available and do not break build on systems without libunwind.
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>   lib/igt_core.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 4fe48c97..6ce83bec 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -1231,6 +1231,16 @@ static bool run_under_gdb(void)
>   		strncmp(basename(buf), "gdb", 3) == 0);
>   }
>   
> +static void __write_stderr(const char *str, size_t len)
> +{
> +	igt_ignore_warn(write(STDERR_FILENO, str, len));
> +}
> +
> +static void write_stderr(const char *str)
> +{
> +	__write_stderr(str, strlen(str));
> +}
> +
>   #ifdef HAVE_LIBUNWIND
>   #define UNW_LOCAL_ONLY
>   #include <libunwind.h>
> @@ -1407,16 +1417,6 @@ xprintf(const char *fmt, ...)
>   	va_end(ap);
>   }
>   
> -static void __write_stderr(const char *str, size_t len)
> -{
> -	igt_ignore_warn(write(STDERR_FILENO, str, len));
> -}
> -
> -static void write_stderr(const char *str)
> -{
> -	__write_stderr(str, strlen(str));
> -}
> -
>   static void print_backtrace_sig_safe(void)
>   {
>   	unw_cursor_t cursor;
> 

Oopsie, I did not spot that #ifdef block.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
  2017-11-24 10:51 ` Chris Wilson
@ 2017-11-24 11:07   ` Arkadiusz Hiler
  0 siblings, 0 replies; 6+ messages in thread
From: Arkadiusz Hiler @ 2017-11-24 11:07 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Nov 24, 2017 at 10:51:38AM +0000, Chris Wilson wrote:
> Quoting Arkadiusz Hiler (2017-11-24 10:32:07)
> > write_stderr() and __write_stderr() are defined behind ifdef on
> > HAVE_LIBUNWIND, but do no depend on the lib in any way.
> 
> Hmm, we keep getting caught out by large ifdefs. Although I guess
> conditionally enabled code itself is less-than-welcome, we should
> probably aim to make whole C files be conditionally compiled, exporting
> no-op interfaces when not enabled. Just a thought.
> -Chris

Sounds about right, and... unwinding the libunwind mess would be a good
way to start.

Any volunteers? I may be able to give it a shot next week...

-- 
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
  2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
  2017-11-24 10:51 ` Chris Wilson
  2017-11-24 11:01 ` Tvrtko Ursulin
@ 2017-11-24 14:33 ` Patchwork
  2017-11-24 17:06 ` ✗ Fi.CI.IGT: warning " Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-24 14:33 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

== Series Details ==

Series: lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
URL   : https://patchwork.freedesktop.org/series/34349/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2a1c1c099113022f091f9e9585be88c6c9cefec5 igt/perf_pmu: Recalibrate interrupt loop.

with latest DRM-Tip kernel build CI_DRM_3383
99e3e01d35c9 drm-tip: 2017y-11m-24d-13h-20m-57s UTC integration manifest

No testlist changes.

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:444s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:455s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:387s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:545s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:280s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:508s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:512s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:505s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:492s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:427s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:543s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:431s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:442s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:434s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:484s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:468s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:480s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:533s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:540s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:570s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:457s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:546s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:498s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:469s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:567s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:423s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:605s
fi-cnl-y         total:289  pass:261  dwarn:1   dfail:0   fail:0   skip:27  time:557s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:492s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_548/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: warning for lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
  2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
                   ` (2 preceding siblings ...)
  2017-11-24 14:33 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-11-24 17:06 ` Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-24 17:06 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

== Series Details ==

Series: lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
URL   : https://patchwork.freedesktop.org/series/34349/
State : warning

== Summary ==

Test kms_flip:
        Subgroup wf_vblank-vs-modeset-interruptible:
                pass       -> SKIP       (shard-hsw) fdo#102614
        Subgroup vblank-vs-suspend-interruptible:
                pass       -> SKIP       (shard-hsw) fdo#100368
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-b-planes:
                pass       -> SKIP       (shard-hsw)
        Subgroup plane-panning-bottom-right-suspend-pipe-a-planes:
                pass       -> SKIP       (shard-snb) fdo#103667
Test drv_selftest:
        Subgroup mock_sanitycheck:
                pass       -> DMESG-WARN (shard-snb) fdo#103717
Test gem_busy:
        Subgroup close-race:
                fail       -> PASS       (shard-snb) fdo#103829
Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb565-draw-blt:
                fail       -> PASS       (shard-snb) fdo#101623
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103667 https://bugs.freedesktop.org/show_bug.cgi?id=103667
fdo#103717 https://bugs.freedesktop.org/show_bug.cgi?id=103717
fdo#103829 https://bugs.freedesktop.org/show_bug.cgi?id=103829
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2667 pass:1533 dwarn:1   dfail:0   fail:9   skip:1124 time:9396s
shard-snb        total:2667 pass:1308 dwarn:2   dfail:0   fail:14  skip:1343 time:8047s

== Logs ==

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

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

end of thread, other threads:[~2017-11-24 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
2017-11-24 10:51 ` Chris Wilson
2017-11-24 11:07   ` Arkadiusz Hiler
2017-11-24 11:01 ` Tvrtko Ursulin
2017-11-24 14:33 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-24 17:06 ` ✗ Fi.CI.IGT: warning " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.