All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATH i-g-t 2/2] core: Show backtrace from igt_skip_on_simulation
Date: Fri, 14 Sep 2018 11:12:43 +0200	[thread overview]
Message-ID: <20180914091242.GL11082@phenom.ffwll.local> (raw)
In-Reply-To: <20180912093306.23537-2-tvrtko.ursulin@linux.intel.com>

On Wed, Sep 12, 2018 at 10:33:06AM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> igt_skip_on_simulation is called both directly from tests but also from
> library helpers. In the latter case especially the logged caller name is
> useless since it is always the helper itself. What we instead want to know
> is who is the caller.
> 
> Trivial approach would be to move the helper to a header as static inline,
> but due the longjmp in it it can never be inlined. Alternative option is
> to print a backtrace from it.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>  lib/igt_core.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 23bb858fd886..990abc5a36b3 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -2065,14 +2065,26 @@ bool igt_run_in_simulation(void)
>   */
>  void igt_skip_on_simulation(void)
>  {
> +	bool in_simulation;
> +
>  	if (igt_only_list_subtests())
>  		return;
>  
> +	in_simulation = igt_run_in_simulation();
> +
>  	if (!igt_can_fail()) {
> -		igt_fixture
> -			igt_require(!igt_run_in_simulation());
> -	} else
> -		igt_require(!igt_run_in_simulation());
> +		igt_fixture {
> +			if (in_simulation) {
> +				print_backtrace();
> +				igt_require(!in_simulation);
> +			}
> +		}
> +	} else {
> +		if (in_simulation) {
> +			print_backtrace();
> +			igt_require(!in_simulation);

Hm, why don't we go right ahead and push this into igt_skip()? There's a
pile of other igt_require, and we tend to push a lot of these into the
library. So they have all the same problem.
-Daniel

> +		}
> +	}
>  }
>  
>  /* structured logging */
> -- 
> 2.17.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATH i-g-t 2/2] core: Show backtrace from igt_skip_on_simulation
Date: Fri, 14 Sep 2018 11:12:43 +0200	[thread overview]
Message-ID: <20180914091242.GL11082@phenom.ffwll.local> (raw)
In-Reply-To: <20180912093306.23537-2-tvrtko.ursulin@linux.intel.com>

On Wed, Sep 12, 2018 at 10:33:06AM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> igt_skip_on_simulation is called both directly from tests but also from
> library helpers. In the latter case especially the logged caller name is
> useless since it is always the helper itself. What we instead want to know
> is who is the caller.
> 
> Trivial approach would be to move the helper to a header as static inline,
> but due the longjmp in it it can never be inlined. Alternative option is
> to print a backtrace from it.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>  lib/igt_core.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 23bb858fd886..990abc5a36b3 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -2065,14 +2065,26 @@ bool igt_run_in_simulation(void)
>   */
>  void igt_skip_on_simulation(void)
>  {
> +	bool in_simulation;
> +
>  	if (igt_only_list_subtests())
>  		return;
>  
> +	in_simulation = igt_run_in_simulation();
> +
>  	if (!igt_can_fail()) {
> -		igt_fixture
> -			igt_require(!igt_run_in_simulation());
> -	} else
> -		igt_require(!igt_run_in_simulation());
> +		igt_fixture {
> +			if (in_simulation) {
> +				print_backtrace();
> +				igt_require(!in_simulation);
> +			}
> +		}
> +	} else {
> +		if (in_simulation) {
> +			print_backtrace();
> +			igt_require(!in_simulation);

Hm, why don't we go right ahead and push this into igt_skip()? There's a
pile of other igt_require, and we tend to push a lot of these into the
library. So they have all the same problem.
-Daniel

> +		}
> +	}
>  }
>  
>  /* structured logging */
> -- 
> 2.17.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-09-14  9:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12  9:33 [igt-dev] [PATH i-g-t 1/2] intel: Be consistent with test results on simulation Tvrtko Ursulin
2018-09-12  9:33 ` Tvrtko Ursulin
2018-09-12  9:33 ` [Intel-gfx] [PATH i-g-t 2/2] core: Show backtrace from igt_skip_on_simulation Tvrtko Ursulin
2018-09-12  9:33   ` Tvrtko Ursulin
2018-09-14  9:12   ` Daniel Vetter [this message]
2018-09-14  9:12     ` [igt-dev] " Daniel Vetter
2018-09-14  9:19     ` Tvrtko Ursulin
2018-09-14  9:19       ` Tvrtko Ursulin
2018-09-14  9:46       ` Daniel Vetter
2018-09-14  9:46         ` Daniel Vetter
2018-09-14  9:49         ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-09-14  9:49           ` [igt-dev] " Chris Wilson
2018-09-14 15:27           ` [igt-dev] [Intel-gfx] " Daniel Vetter
2018-09-14 15:27             ` [igt-dev] " Daniel Vetter
2018-09-12 10:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [PATH,i-g-t,1/2] intel: Be consistent with test results on simulation Patchwork
2018-09-12 12:02 ` [igt-dev] [Intel-gfx] [PATH i-g-t 1/2] " Chris Wilson
2018-09-12 12:02   ` Chris Wilson
2018-09-12 13:05 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [PATH,i-g-t,1/2] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180914091242.GL11082@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tursulin@ursulin.net \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.