From patchwork Wed Sep 12 09:33:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10597205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D264920 for ; Wed, 12 Sep 2018 09:33:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECE3A21327 for ; Wed, 12 Sep 2018 09:33:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE4C3260CD; Wed, 12 Sep 2018 09:33:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F90821327 for ; Wed, 12 Sep 2018 09:33:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4B776E4CF; Wed, 12 Sep 2018 09:33:14 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD4E06E187 for ; Wed, 12 Sep 2018 09:33:12 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id t25-v6so1580199wmi.3 for ; Wed, 12 Sep 2018 02:33:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ejuz+lB15Lo2hDm66Dt6quiAeNIDF1KS1kWWo1/73Ww=; b=TvqMu1rIB3Nh0qmg9zRZy9qwvndJLBM3Qi1LxpNS2jOIfooKxPiqfUAkOYm4IhYMuk GW0HgKs0go9mDEzo0wlz41/7J8nKUEiK6BzKGlN5tmj6/yIfINNFXvbTZaE6Vm/GcKg9 Dy+7oT6FSnPXJ9TtkEqGQEt5pMtXWPI+W9o/qzWN2qD+9PJijtC8ZAh3khMDrGQGFO7k FySAGlya+MV3v4hvrb+NECz/4OQ+jNNM3HfB3E4KTjmpF4l/YBb1bh2Dhgrt+WWzMDBu tnt+Qnp666bjz7x0DSbqWQzGUW401XH/rI10SGS96z6D0gNB4mcjoTKLYSmlZCGJ5l5O V52A== X-Gm-Message-State: APzg51ADn4gxQ6cwp+K5byRnrCgrjWu4/RZwXwRHoxYDtdP04OBDdAd5 JLGbnAKLuUwMRJKNRss5iKa3AQ== X-Google-Smtp-Source: ANB0Vdbx2FfFiyq4cvn/Uh3shIrc/4gSO1gsCP1tBrILHL+Posa8mFYRE2srmccIMjfsKRVQZK7zmQ== X-Received: by 2002:a1c:8f0e:: with SMTP id r14-v6mr946255wmd.79.1536744791320; Wed, 12 Sep 2018 02:33:11 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j6-v6sm355316wrq.25.2018.09.12.02.33.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 02:33:10 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 12 Sep 2018 10:33:05 +0100 Message-Id: <20180912093306.23537-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 Subject: [Intel-gfx] [PATH i-g-t 1/2] intel: Be consistent with test results on simulation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Tests which call intel_require_memory currently always skip on simulation, unless they fail first due insufficient memory. This can create different outcomes depending on the simulation environment so move the simulation skip to the start of the function for 100% consistency in results. Signed-off-by: Tvrtko Ursulin Cc: Radoslaw Szwichtenberg Reviewed-by: Chris Wilson --- lib/intel_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/intel_os.c b/lib/intel_os.c index 29a27272e782..e1e31e23069b 100644 --- a/lib/intel_os.c +++ b/lib/intel_os.c @@ -375,6 +375,8 @@ void intel_require_memory(uint64_t count, uint64_t size, unsigned mode) uint64_t required, total; bool sufficient_memory; + igt_skip_on_simulation(); + sufficient_memory = __intel_check_memory(count, size, mode, &required, &total); if (!sufficient_memory) { @@ -406,8 +408,6 @@ void intel_require_memory(uint64_t count, uint64_t size, unsigned mode) mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", mode & CHECK_SWAP ? " + swap": "", (long long)vfs_file_max()); - - igt_skip_on_simulation(); } void intel_purge_vm_caches(int drm_fd) From patchwork Wed Sep 12 09:33:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10597207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8AD6920 for ; Wed, 12 Sep 2018 09:33:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9762C21327 for ; Wed, 12 Sep 2018 09:33:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BFD6260CD; Wed, 12 Sep 2018 09:33:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C06421327 for ; Wed, 12 Sep 2018 09:33:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B33F76E4D6; Wed, 12 Sep 2018 09:33:17 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FB716E187 for ; Wed, 12 Sep 2018 09:33:13 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id w11-v6so1262760wrc.5 for ; Wed, 12 Sep 2018 02:33:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kH9grRLFuSuRY65hpSLAv8m26sTpJ/AjtGsZQNv1wMk=; b=GGAp/5abmno0rgltyO0RTD4fYXx4jNn1Szhx6Wyz3clYXrjeZmvryLHH695q7YV+nj MXwDbaT+KW98hKlrjNfXaQvza8KjgMwQ29NpORpH8FcKLK6rQNRe4/DuT9pRScTnig3n DM2K0v1iL6NKOra66TulZSonKdpoX1xu6Q2Pdh7H/MEw1Uk5JFEXh4eRvSIoHE+mdawv IG7AuAEkrJjCAKEoIgoFDlxlEW1s32YTipPxW782wNGFUXGCllMv/lnUs8KMU7nFL/XT uZ+iOKX9TVpes9gcgRdx2TO/B+zkQF9XQih0yYIY3z05D7wA9v77wJ4kOpmYlmLy3WKW 95Gg== X-Gm-Message-State: APzg51AiQlFdf4SAV3CE2ckBD2yKMSc5h8pqS2aUrHqwxbe87dCOLkAV eu9PUUa6dJ558BtWqTKNDXranA== X-Google-Smtp-Source: ANB0VdYaC5wMP/kZR7IHy5G29fnd54HxjCW0EQWOXMiS3VMIWglL1WWrjW4yyh60MQsUpZdqOKRy0A== X-Received: by 2002:adf:f1cc:: with SMTP id z12-v6mr802310wro.214.1536744792008; Wed, 12 Sep 2018 02:33:12 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j6-v6sm355316wrq.25.2018.09.12.02.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 02:33:11 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 12 Sep 2018 10:33:06 +0100 Message-Id: <20180912093306.23537-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180912093306.23537-1-tvrtko.ursulin@linux.intel.com> References: <20180912093306.23537-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 2/2] core: Show backtrace from igt_skip_on_simulation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin 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 Cc: Radoslaw Szwichtenberg --- 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); + } + } } /* structured logging */