All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
@ 2018-06-06 22:27 Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 2/4] build: bump c std to gnu11 Lucas De Marchi
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-06 22:27 UTC (permalink / raw)
  To: igt-dev

pthread_create() expects a void *(*start_routine) (void *). Fix warning
the following warning on gcc 8:

../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
   pthread_create(&threads[i], NULL, (void * (*)(void *))
                                     ^
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/sw_sync.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/sw_sync.c b/tests/sw_sync.c
index 20dfbbb9..afe58b0c 100644
--- a/tests/sw_sync.c
+++ b/tests/sw_sync.c
@@ -669,7 +669,7 @@ static struct {
 	pthread_mutex_t lock;
 } test_mpsc_data;
 
-static int mpsc_producer_thread(void *d)
+static void *mpsc_producer_thread(void *d)
 {
 	int id = (long)d;
 	int fence, i;
@@ -702,7 +702,7 @@ static int mpsc_producer_thread(void *d)
 		close(fence);
 	}
 
-	return 0;
+	return NULL;
 }
 
 static int mpsc_consumer_thread(void)
-- 
2.17.1

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

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

* [igt-dev] [PATCH i-g-t 2/4] build: bump c std to gnu11
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
@ 2018-06-06 22:27 ` Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_core: fix check for running under gdb Lucas De Marchi
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-06 22:27 UTC (permalink / raw)
  To: igt-dev

It's been a long time and all reasonable toolchains support gnu11
already.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index cd736d8e..7fbe7a78 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('igt-gpu-tools', 'c',
 	version : '1.22',
         default_options: [
           'warning_level=2',
-          'c_std=gnu99',
+          'c_std=gnu11',
         ],
 	license : 'MIT',
 	meson_version : '>0.40.0')
-- 
2.17.1

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

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

* [igt-dev] [PATCH i-g-t 3/4] lib/igt_core: fix check for running under gdb
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 2/4] build: bump c std to gnu11 Lucas De Marchi
@ 2018-06-06 22:27 ` Lucas De Marchi
  2018-07-11 21:25   ` [igt-dev] [PATCH i-g-t v2 " Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_kms: simplify pipe <-> name conversion Lucas De Marchi
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-06 22:27 UTC (permalink / raw)
  To: igt-dev

Do not repeat the argument buf since this creates an alias for the first
one:

../lib/igt_core.c:1183:25: warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict]
  return (readlink (buf, buf, sizeof (buf)) != -1 &&
                    ~~~  ^~~

Also properly check for errors and rename the function since we are checking if we are
running under gdb, not making it run under gdb. Previously we were
passing uninitialized data to basename() due to not properly adding the
nul termination.

==22293== Conditional jump or move depends on uninitialised value(s)
==22293==    at 0x4C306D0: rindex (vg_replace_strmem.c:199)
==22293==    by 0x4EC55DD: basename (in /usr/lib64/libc-2.27.so)
==22293==    by 0x400744: running_under_gdb (in /tmp/a)

There's another problem with this function that it doesn't detect when
we are running gdb from a toolchain using a toolchain triplet, but
that's left for another patch.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_core.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 5092a3f0..d945375f 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1175,13 +1175,19 @@ bool igt_can_fail(void)
 	return !test_with_subtests || in_fixture || in_subtest;
 }
 
-static bool run_under_gdb(void)
+static bool running_under_gdb(void)
 {
-	char buf[1024];
+	char buf[1024], exe[1024];
+	ssize_t len;
 
 	sprintf(buf, "/proc/%d/exe", getppid());
-	return (readlink (buf, buf, sizeof (buf)) != -1 &&
-		strncmp(basename(buf), "gdb", 3) == 0);
+	len = readlink(buf, exe, sizeof(exe) - 1);
+	if (len < 0)
+		return false;
+
+	exe[len] = '\0';
+
+	return strncmp(basename(exe), "gdb", 3) == 0;
 }
 
 static void __write_stderr(const char *str, size_t len)
@@ -1412,7 +1418,7 @@ void __igt_fail_assert(const char *domain, const char *file, const int line,
 
 	print_backtrace();
 
-	if (run_under_gdb())
+	if (running_under_gdb())
 		abort();
 	igt_fail(IGT_EXIT_FAILURE);
 }
-- 
2.17.1

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

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

* [igt-dev] [PATCH i-g-t 4/4] lib/igt_kms: simplify pipe <-> name conversion
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 2/4] build: bump c std to gnu11 Lucas De Marchi
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_core: fix check for running under gdb Lucas De Marchi
@ 2018-06-06 22:27 ` Lucas De Marchi
  2018-06-06 23:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration Patchwork
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-06 22:27 UTC (permalink / raw)
  To: igt-dev

Now that we can use _Static_assert() due to C11, make it future proof so
we remember to update this if IGT_MAX_PIPES changes. Also reduce
verbosity a little bit by calculating indexes instead of if/else chain.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_kms.c | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0438f641..40146867 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -324,9 +324,10 @@ const unsigned char* igt_kms_get_alt_edid(void)
  */
 const char *kmstest_pipe_name(enum pipe pipe)
 {
-	static const char * const str[] = {
-		"A", "B", "C", "D", "E", "F",
-	};
+	static const char str[] = "A\0B\0C\0D\0E\0F";
+
+	_Static_assert(sizeof(str) == IGT_MAX_PIPES * 2,
+		       "Missing pipe name");
 
 	if (pipe == PIPE_NONE)
 		return "None";
@@ -334,7 +335,7 @@ const char *kmstest_pipe_name(enum pipe pipe)
 	if (pipe >= IGT_MAX_PIPES)
 		return "invalid";
 
-	return str[pipe];
+	return str + (pipe * 2);
 }
 
 /**
@@ -345,20 +346,12 @@ const char *kmstest_pipe_name(enum pipe pipe)
  */
 int kmstest_pipe_to_index(char pipe)
 {
-	if (pipe == 'A')
-		return 0;
-	else if (pipe == 'B')
-		return 1;
-	else if (pipe == 'C')
-		return 2;
-	else if (pipe == 'D')
-		return 3;
-	else if (pipe == 'E')
-		return 4;
-	else if (pipe == 'F')
-		return 5;
-	else
+	int r = pipe - 'A';
+
+	if (r < 0 || r >= IGT_MAX_PIPES)
 		return -EINVAL;
+
+	return r;
 }
 
 /**
-- 
2.17.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
                   ` (2 preceding siblings ...)
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_kms: simplify pipe <-> name conversion Lucas De Marchi
@ 2018-06-06 23:36 ` Patchwork
  2018-06-07  1:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-06-06 23:36 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration
URL   : https://patchwork.freedesktop.org/series/44375/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4282 -> IGTPW_1422 =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1422 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1422, 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/44375/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         PASS -> FAIL (fdo#102575)

    igt@kms_busy@basic-flip-b:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106097)

    igt@kms_flip@basic-flip-vs-dpms:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000)

    
    ==== Possible fixes ====

    igt@gem_sync@basic-each:
      fi-cnl-y3:          INCOMPLETE (fdo#105086) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097


== Participating hosts (41 -> 37) ==

  Additional (1): fi-hsw-peppy 
  Missing    (5): fi-byt-j1900 fi-byt-squawks fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * IGT: IGT_4508 -> IGTPW_1422

  CI_DRM_4282: c1064b9be065603680d060184da1a93d404dcf0c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1422: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1422/
  IGT_4508: 78a68c905066beeefd24b3a4518d817a811e8798 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
                   ` (3 preceding siblings ...)
  2018-06-06 23:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration Patchwork
@ 2018-06-07  1:19 ` Patchwork
  2018-06-19  6:46 ` [igt-dev] [PATCH i-g-t 1/4] " Lucas De Marchi
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-06-07  1:19 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration
URL   : https://patchwork.freedesktop.org/series/44375/
State : failure

== Summary ==

= CI Bug Log - changes from IGT_4508_full -> IGTPW_1422_full =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1422_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1422_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/44375/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
      shard-snb:          PASS -> DMESG-WARN

    
    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd1:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-snb:          PASS -> FAIL (fdo#106641)

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

    igt@kms_flip@2x-modeset-vs-vblank-race-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_flip@flip-vs-expired-vblank:
      shard-hsw:          PASS -> FAIL (fdo#105363, fdo#102887)

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#105363, fdo#102887)

    igt@kms_flip_tiling@flip-to-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724, fdo#103822) +1

    igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-indfb-msflip-blt:
      shard-snb:          SKIP -> INCOMPLETE (fdo#105411)

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

    
    ==== Possible fixes ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

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

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

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
      shard-glk:          FAIL (fdo#105703) -> PASS

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          FAIL (fdo#104724) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-shrfb-fliptrack:
      shard-glk:          FAIL (fdo#104724, fdo#103167) -> PASS

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

    igt@testdisplay:
      shard-glk:          INCOMPLETE (k.org#198133, fdo#103359) -> PASS

    
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4508 -> IGTPW_1422
    * Linux: CI_DRM_4280 -> CI_DRM_4282

  CI_DRM_4280: 967aa2f22752af3adc629b50e7d2ed2b7e061e44 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4282: c1064b9be065603680d060184da1a93d404dcf0c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1422: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1422/
  IGT_4508: 78a68c905066beeefd24b3a4518d817a811e8798 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
                   ` (4 preceding siblings ...)
  2018-06-07  1:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-06-19  6:46 ` Lucas De Marchi
  2018-06-19  7:37   ` Petri Latvala
  2018-07-11 23:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2) Patchwork
  2018-07-12  0:14 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 1 reply; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-19  6:46 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

Ping?

Lucas De Marchi
On Wed, Jun 6, 2018 at 3:31 PM Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>
> pthread_create() expects a void *(*start_routine) (void *). Fix warning
> the following warning on gcc 8:
>
> ../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
>    pthread_create(&threads[i], NULL, (void * (*)(void *))
>                                      ^
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  tests/sw_sync.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> index 20dfbbb9..afe58b0c 100644
> --- a/tests/sw_sync.c
> +++ b/tests/sw_sync.c
> @@ -669,7 +669,7 @@ static struct {
>         pthread_mutex_t lock;
>  } test_mpsc_data;
>
> -static int mpsc_producer_thread(void *d)
> +static void *mpsc_producer_thread(void *d)
>  {
>         int id = (long)d;
>         int fence, i;
> @@ -702,7 +702,7 @@ static int mpsc_producer_thread(void *d)
>                 close(fence);
>         }
>
> -       return 0;
> +       return NULL;
>  }
>
>  static int mpsc_consumer_thread(void)
> --
> 2.17.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev



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

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

* Re: [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-19  6:46 ` [igt-dev] [PATCH i-g-t 1/4] " Lucas De Marchi
@ 2018-06-19  7:37   ` Petri Latvala
  2018-06-19 20:30     ` Lucas De Marchi
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2018-06-19  7:37 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev, Lucas De Marchi

On Mon, Jun 18, 2018 at 11:46:31PM -0700, Lucas De Marchi wrote:
> Ping?

A tentative

Reviewed-by: Petri Latvala <petri.latvala@intel.com>

on the series.

What is the practical effect of -std=gnu11 in terms of gcc version
requirement? I know using C++11 requires some creative selection of
gcc versions, but I have no idea about C11.



-- 
Petri Latvala



> 
> Lucas De Marchi
> On Wed, Jun 6, 2018 at 3:31 PM Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> >
> > pthread_create() expects a void *(*start_routine) (void *). Fix warning
> > the following warning on gcc 8:
> >
> > ../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
> >    pthread_create(&threads[i], NULL, (void * (*)(void *))
> >                                      ^
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > ---
> >  tests/sw_sync.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> > index 20dfbbb9..afe58b0c 100644
> > --- a/tests/sw_sync.c
> > +++ b/tests/sw_sync.c
> > @@ -669,7 +669,7 @@ static struct {
> >         pthread_mutex_t lock;
> >  } test_mpsc_data;
> >
> > -static int mpsc_producer_thread(void *d)
> > +static void *mpsc_producer_thread(void *d)
> >  {
> >         int id = (long)d;
> >         int fence, i;
> > @@ -702,7 +702,7 @@ static int mpsc_producer_thread(void *d)
> >                 close(fence);
> >         }
> >
> > -       return 0;
> > +       return NULL;
> >  }
> >
> >  static int mpsc_consumer_thread(void)
> > --
> > 2.17.1
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> 
> 
> -- 
> Lucas De Marchi
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-19  7:37   ` Petri Latvala
@ 2018-06-19 20:30     ` Lucas De Marchi
  2018-06-20  9:57       ` Petri Latvala
  0 siblings, 1 reply; 14+ messages in thread
From: Lucas De Marchi @ 2018-06-19 20:30 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev

On Tue, Jun 19, 2018 at 12:37 AM Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Mon, Jun 18, 2018 at 11:46:31PM -0700, Lucas De Marchi wrote:
> > Ping?
>
> A tentative
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
>
> on the series.
>
> What is the practical effect of -std=gnu11 in terms of gcc version
> requirement? I know using C++11 requires some creative selection of
> gcc versions, but I have no idea about C11.

I use it since forever in kmod, but there I have some
cruft^Wcompatibility macros. I can bring it over to igt if it's
needed, but I think it would be better to have a tentative push
without them.

Answering your question, according to
https://gcc.gnu.org/wiki/C11Status _Static_assert() that I'm using in
this series is available since gcc 4.6. Some C11 features entered in
4.7 and in 4.9 it was "feature complete".

Lucas De Marchi

>
>
>
> --
> Petri Latvala
>
>
>
> >
> > Lucas De Marchi
> > On Wed, Jun 6, 2018 at 3:31 PM Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> > >
> > > pthread_create() expects a void *(*start_routine) (void *). Fix warning
> > > the following warning on gcc 8:
> > >
> > > ../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
> > >    pthread_create(&threads[i], NULL, (void * (*)(void *))
> > >                                      ^
> > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > > ---
> > >  tests/sw_sync.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> > > index 20dfbbb9..afe58b0c 100644
> > > --- a/tests/sw_sync.c
> > > +++ b/tests/sw_sync.c
> > > @@ -669,7 +669,7 @@ static struct {
> > >         pthread_mutex_t lock;
> > >  } test_mpsc_data;
> > >
> > > -static int mpsc_producer_thread(void *d)
> > > +static void *mpsc_producer_thread(void *d)
> > >  {
> > >         int id = (long)d;
> > >         int fence, i;
> > > @@ -702,7 +702,7 @@ static int mpsc_producer_thread(void *d)
> > >                 close(fence);
> > >         }
> > >
> > > -       return 0;
> > > +       return NULL;
> > >  }
> > >
> > >  static int mpsc_consumer_thread(void)
> > > --
> > > 2.17.1
> > >
> > > _______________________________________________
> > > igt-dev mailing list
> > > igt-dev@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> >
> >
> >
> > --
> > Lucas De Marchi
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev



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

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

* Re: [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-19 20:30     ` Lucas De Marchi
@ 2018-06-20  9:57       ` Petri Latvala
  2018-07-05 20:15         ` Lucas De Marchi
  0 siblings, 1 reply; 14+ messages in thread
From: Petri Latvala @ 2018-06-20  9:57 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev, Lucas De Marchi

On Tue, Jun 19, 2018 at 01:30:27PM -0700, Lucas De Marchi wrote:
> On Tue, Jun 19, 2018 at 12:37 AM Petri Latvala <petri.latvala@intel.com> wrote:
> >
> > On Mon, Jun 18, 2018 at 11:46:31PM -0700, Lucas De Marchi wrote:
> > > Ping?
> >
> > A tentative
> >
> > Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> >
> > on the series.
> >
> > What is the practical effect of -std=gnu11 in terms of gcc version
> > requirement? I know using C++11 requires some creative selection of
> > gcc versions, but I have no idea about C11.
> 
> I use it since forever in kmod, but there I have some
> cruft^Wcompatibility macros. I can bring it over to igt if it's
> needed, but I think it would be better to have a tentative push
> without them.
> 
> Answering your question, according to
> https://gcc.gnu.org/wiki/C11Status _Static_assert() that I'm using in
> this series is available since gcc 4.6. Some C11 features entered in
> 4.7 and in 4.9 it was "feature complete".


That sounds alright. Even debian oldstable has 4.9.


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

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

* Re: [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration
  2018-06-20  9:57       ` Petri Latvala
@ 2018-07-05 20:15         ` Lucas De Marchi
  0 siblings, 0 replies; 14+ messages in thread
From: Lucas De Marchi @ 2018-07-05 20:15 UTC (permalink / raw)
  To: Lucas De Marchi, igt-dev

On Wed, Jun 20, 2018 at 2:57 AM Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Tue, Jun 19, 2018 at 01:30:27PM -0700, Lucas De Marchi wrote:
> > On Tue, Jun 19, 2018 at 12:37 AM Petri Latvala <petri.latvala@intel.com> wrote:
> > >
> > > On Mon, Jun 18, 2018 at 11:46:31PM -0700, Lucas De Marchi wrote:
> > > > Ping?
> > >
> > > A tentative
> > >
> > > Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> > >
> > > on the series.
> > >
> > > What is the practical effect of -std=gnu11 in terms of gcc version
> > > requirement? I know using C++11 requires some creative selection of
> > > gcc versions, but I have no idea about C11.
> >
> > I use it since forever in kmod, but there I have some
> > cruft^Wcompatibility macros. I can bring it over to igt if it's
> > needed, but I think it would be better to have a tentative push
> > without them.
> >
> > Answering your question, according to
> > https://gcc.gnu.org/wiki/C11Status _Static_assert() that I'm using in
> > this series is available since gcc 4.6. Some C11 features entered in
> > 4.7 and in 4.9 it was "feature complete".
>
>
> That sounds alright. Even debian oldstable has 4.9.

so I assume there's nothing pending on my side and this can be in?

Lucas De Marchi

>
>
> --
> Petri Latvala



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

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

* [igt-dev] [PATCH i-g-t v2 3/4] lib/igt_core: fix check for running under gdb
  2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_core: fix check for running under gdb Lucas De Marchi
@ 2018-07-11 21:25   ` Lucas De Marchi
  0 siblings, 0 replies; 14+ messages in thread
From: Lucas De Marchi @ 2018-07-11 21:25 UTC (permalink / raw)
  To: igt-dev

Properly check for errors and rename the function since we are checking if we are
running under gdb, not making it run under gdb. Previously we were
passing uninitialized data to basename() due to not properly adding the
nul termination.

==22293== Conditional jump or move depends on uninitialised value(s)
==22293==    at 0x4C306D0: rindex (vg_replace_strmem.c:199)
==22293==    by 0x4EC55DD: basename (in /usr/lib64/libc-2.27.so)
==22293==    by 0x400744: running_under_gdb (in /tmp/a)

There's another problem with this function that it doesn't detect when
we are running gdb from a toolchain using a toolchain triplet, but
that's left for another patch.

v2: remove the fix for repeating the argument on readlink() since that
    landed in another patch

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_core.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 2d0d78a3..3d87123c 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1167,13 +1167,19 @@ bool igt_can_fail(void)
 	return !test_with_subtests || in_fixture || in_subtest;
 }
 
-static bool run_under_gdb(void)
+static bool running_under_gdb(void)
 {
 	char pathname[30], buf[1024];
+	ssize_t len;
 
 	sprintf(pathname, "/proc/%d/exe", getppid());
-	return (readlink(pathname, buf, sizeof (buf)) != -1 &&
-		strncmp(basename(buf), "gdb", 3) == 0);
+	len = readlink(pathname, buf, sizeof(buf) - 1);
+	if (len < 0)
+		return false;
+
+	buf[len] = '\0';
+
+	return strncmp(basename(buf), "gdb", 3) == 0;
 }
 
 static void __write_stderr(const char *str, size_t len)
@@ -1404,7 +1410,7 @@ void __igt_fail_assert(const char *domain, const char *file, const int line,
 
 	print_backtrace();
 
-	if (run_under_gdb())
+	if (running_under_gdb())
 		abort();
 	igt_fail(IGT_EXIT_FAILURE);
 }
-- 
2.17.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2)
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
                   ` (5 preceding siblings ...)
  2018-06-19  6:46 ` [igt-dev] [PATCH i-g-t 1/4] " Lucas De Marchi
@ 2018-07-11 23:21 ` Patchwork
  2018-07-12  0:14 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-07-11 23:21 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2)
URL   : https://patchwork.freedesktop.org/series/44375/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4469 -> IGTPW_1558 =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1558 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1558, 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/44375/revisions/2/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rpm@basic-rte:
      fi-hsw-peppy:       PASS -> SKIP +1
      fi-hsw-4770r:       PASS -> SKIP +1
      fi-bdw-5557u:       PASS -> SKIP +1
      fi-hsw-4770:        PASS -> SKIP +1

    


== Participating hosts (46 -> 42) ==

  Missing    (4): fi-ctg-p8600 fi-ilk-m540 fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * IGT: IGT_4546 -> IGTPW_1558

  CI_DRM_4469: 02e578b7aace48d33fa617dddb40621bd664c92c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1558: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1558/
  IGT_4546: e8905e756cf3640c66541e963ff97f8af2d98936 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2)
  2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
                   ` (6 preceding siblings ...)
  2018-07-11 23:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2) Patchwork
@ 2018-07-12  0:14 ` Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-07-12  0:14 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2)
URL   : https://patchwork.freedesktop.org/series/44375/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4546_full -> IGTPW_1558_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1558_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1558_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/44375/revisions/2/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-vebox:
      shard-kbl:          SKIP -> PASS

    igt@gem_mocs_settings@mocs-rc6-ctx-render:
      shard-kbl:          PASS -> SKIP

    igt@pm_rpm@cursor:
      shard-hsw:          PASS -> SKIP +34

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip_tiling@flip-to-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#103822, fdo#107161)

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-render:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

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

    
    ==== Possible fixes ====

    igt@drv_suspend@fence-restore-untiled:
      shard-glk:          FAIL (fdo#103375) -> PASS

    igt@kms_busy@basic-flip-e:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-glk:          INCOMPLETE (fdo#103359, k.org#198133) -> PASS

    igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105189) -> PASS

    igt@kms_flip@wf_vblank-ts-check-interruptible:
      shard-glk:          FAIL (fdo#103928) -> PASS

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          FAIL (fdo#103822, fdo#107161) -> PASS

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

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

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#107161 https://bugs.freedesktop.org/show_bug.cgi?id=107161
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4546 -> IGTPW_1558
    * Linux: CI_DRM_4466 -> CI_DRM_4469

  CI_DRM_4466: 40ea4d696481930682c782e8dd7bd0cdbdfad574 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4469: 02e578b7aace48d33fa617dddb40621bd664c92c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1558: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1558/
  IGT_4546: e8905e756cf3640c66541e963ff97f8af2d98936 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

end of thread, other threads:[~2018-07-12  0:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-06 22:27 [igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration Lucas De Marchi
2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 2/4] build: bump c std to gnu11 Lucas De Marchi
2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_core: fix check for running under gdb Lucas De Marchi
2018-07-11 21:25   ` [igt-dev] [PATCH i-g-t v2 " Lucas De Marchi
2018-06-06 22:27 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_kms: simplify pipe <-> name conversion Lucas De Marchi
2018-06-06 23:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration Patchwork
2018-06-07  1:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-06-19  6:46 ` [igt-dev] [PATCH i-g-t 1/4] " Lucas De Marchi
2018-06-19  7:37   ` Petri Latvala
2018-06-19 20:30     ` Lucas De Marchi
2018-06-20  9:57       ` Petri Latvala
2018-07-05 20:15         ` Lucas De Marchi
2018-07-11 23:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/sw_sync: fix pthread start_routine declaration (rev2) Patchwork
2018-07-12  0:14 ` [igt-dev] ✓ Fi.CI.IGT: " 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.