From patchwork Wed Sep 5 13:49:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588869 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 3123815E9 for ; Wed, 5 Sep 2018 13:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 208462A1DA for ; Wed, 5 Sep 2018 13:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14A4A2A1E6; Wed, 5 Sep 2018 13:49:50 +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 D3B382A1DA for ; Wed, 5 Sep 2018 13:49:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 076A16E497; Wed, 5 Sep 2018 13:49:49 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2F6AF6E46D for ; Wed, 5 Sep 2018 13:49:47 +0000 (UTC) Received: by mail-wm0-x236.google.com with SMTP id 207-v6so7764996wme.5 for ; Wed, 05 Sep 2018 06:49:47 -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=kTXgxpeTt3HSanIZ68aHCompG5sUdKizZIKsPs8u3xA=; b=WK+9UcS4n2Oc3Qjk6SDOGl/0wj3NHNc7vxh95FvHlVMlEpUU2GZYMuGvp7Pw/Qou/p BI1hJDejMxtztH31gLigCP6/mlXHN+lBWBqvsQVlUTaWELzLjoTsXpM4vuZ78jyATTE7 P27ivfmQQ+2tDj7Z1i2kkqBPapn92I2r1H1MqNSufNE7az1fmcKonsM9CpI9F89oqjbN /fLOH+Lek4yx7VshqhjgQeXtc5fJfG/JxN0/rrIlcCeZrkktGiNmSgzmcwOWW9wLmhjC Ssyk2/FSs0PEdsbxIMoGDGEYn5s6wgK8U/PWkSndVrE91BEnF+YX7kqRHqwRuTjbsXib NUug== X-Gm-Message-State: APzg51CSd4GyGY9io27YlVW1aExJz9FAmaGVabPZSY/38qiGUEdoePpR CJAHVlsLK2Hy7jUsRsFgyRLdZHnnVr0= X-Google-Smtp-Source: ANB0Vdak8Cdmi53BfBU3Rr5fEEoU9lpOpxKnf4Qf/yq75LKHJY4MyJyAqu/DTCmM7T6wCLQAzX/9/w== X-Received: by 2002:a1c:e286:: with SMTP id z128-v6mr323892wmg.30.1536155385838; Wed, 05 Sep 2018 06:49:45 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:45 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:27 +0100 Message-Id: <20180905134939.2942-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 01/13] trace.pl: Fix frequency timeline 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 Frequency timeline needs to be finished with an entry spanning to the end of known time so that the last known frequency is displayed. Signed-off-by: Tvrtko Ursulin --- scripts/trace.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/trace.pl b/scripts/trace.pl index 1924333e12b6..2976cfdf585a 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -1201,6 +1201,8 @@ foreach my $key (sort sortQueue keys %db) { last if $i > $max_items; } +push @freqs, [$prev_freq_ts, $last_ts, $prev_freq] if $prev_freq; + foreach my $item (@freqs) { my ($start, $end, $freq) = @$item; my $startend; From patchwork Wed Sep 5 13:49:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588871 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 5A7085A4 for ; Wed, 5 Sep 2018 13:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A9502A1DA for ; Wed, 5 Sep 2018 13:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EA7A2A1E7; Wed, 5 Sep 2018 13:49:51 +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 F1B442A1DA for ; Wed, 5 Sep 2018 13:49:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C9A246E49A; Wed, 5 Sep 2018 13:49:49 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id F03406E499 for ; Wed, 5 Sep 2018 13:49:47 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id 20-v6so7719779wrb.12 for ; Wed, 05 Sep 2018 06:49:47 -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=swj6tuD7XnKetbQbajGKv2l1AJRsbqM7bbKcX8YVR6c=; b=nPAjbJ+Qw9hLEmQczQZn2lz7g0TjNuxS0wUdgR7ZOz+eRN2J5CXjHDpX07Jvdtn6LY OZgXN/4WGU4JRDxBT1bJGqzS1ayX68o50zstFKwokxeZwvb3wcpjo+UIr/lEU/vGNJ+m 1xgFRexu9AW4SLAbt95+k+GcVrkCt9llCo/QruWBuilZTOpl7KuyfjgAeyrar4aeqBYo 2YO0okXFXf2QjkWKhs+ZM8Eq7DWRNNoPhsFebSW7QygYBihZYcmLRPWzEQy4xZEHQ8IQ IKpcnqH7cyDJ2QqKITx7hDzTXs4l7HmvLLF776BUZMm58izjB6x+E/nUWhcyHpVBRH32 1N3g== X-Gm-Message-State: APzg51DfqL143H/ws5jxvPXa/UfzvaSXirYuC7tjQi+yuN+YbFgSIl8k 5917k3w7BUznugfqHh3asSyEyYu7Vss= X-Google-Smtp-Source: ANB0VdZfwj4fhhc7rB7ZjTMvao8mD4HMJYYSCZAsXGYudEgVGydfrysv1k35gxzud5WCQbeOI6FuGA== X-Received: by 2002:adf:f906:: with SMTP id b6-v6mr11810556wrr.28.1536155386656; Wed, 05 Sep 2018 06:49:46 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:46 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:28 +0100 Message-Id: <20180905134939.2942-3-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 02/13] trace.pl: Use undocumented -o to perf record to allow tee 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 Signed-off-by: Tvrtko Ursulin --- scripts/trace.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 2976cfdf585a..18f9f3b18396 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -170,8 +170,9 @@ sub arg_trace if ($_[0] eq '--trace') { shift @_; + unshift @_, '--'; unshift @_, join(',', @events); - unshift @_, ('perf', 'record', '-a', '-c', '1', '-q', '-e'); + unshift @_, ('perf', 'record', '-a', '-c', '1', '-q', '-o', 'perf.data', '-e'); exec @_; } From patchwork Wed Sep 5 13:49:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588873 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 88D7F180E for ; Wed, 5 Sep 2018 13:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 789DB2A1DA for ; Wed, 5 Sep 2018 13:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D48B2A1E6; Wed, 5 Sep 2018 13:49:51 +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 38D202A1DF for ; Wed, 5 Sep 2018 13:49:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DB2C6E489; Wed, 5 Sep 2018 13:49:49 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6E266E499 for ; Wed, 5 Sep 2018 13:49:48 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id j26-v6so7783042wre.2 for ; Wed, 05 Sep 2018 06:49:48 -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=SRwXvZFewr5wU0lt0zXIJIeulY6ZMZwOWt0pEuOTSiM=; b=BJusJ7xMzP73KhJTHjZEyg07caQ4s7bMY91LbZ0a0mvjlz4PtU+70dVaK5W/BpySsz T7z/NtV7XnUcupUBzAxBi3lROWMuXwNL/MiEBsC+pDVF9K1qpAw8PiPWi2R8Re7y+HfR a0u1nCrUJVngfBulekhsQZ7iFQiJ+WpNyVhU20KdT9JKOCq/oJJcCZb4CAGuFJ1MMAqt dmDBUg1/y5yjBi9V/dZG/1DxYTSPR+hyYj2vQI4b4qsPO4a8f0vMXE+mFrZoejrZi7+B MZ6CsvrfcWx3j15RL7kfl/MT19bMw4DX0Mmn5La9Q8l7dxXQV1oT9ZERTyXNQaKRmOMo vAhw== X-Gm-Message-State: APzg51A2DtWpK7zQiQmi3j/yRtcWdxCO/hVY2GRztFqLNbigCuMe37cJ bQKZNtJ/8pxWsdsOh4A9U2eUlQ== X-Google-Smtp-Source: ANB0Vdak2kANXE9KU8uotstNCPmTLoDOVz5byKrEUGTL8oyUJlvx5y7dj9GodLqECKcpeW9yOI8tuA== X-Received: by 2002:adf:a30a:: with SMTP id c10-v6mr28270465wrb.31.1536155387500; Wed, 05 Sep 2018 06:49:47 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:47 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:29 +0100 Message-Id: <20180905134939.2942-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 03/13] gem_wsim: Fix BCS usage under VCS2 remap warning 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 Need to check we actually are in VCS2 remapping mode! Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 80f180829241..25af4d678ba4 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -592,7 +592,7 @@ add_step: } } - if (bcs_used && verbose) + if (bcs_used && (flags & VCS2REMAP) && verbose) printf("BCS usage in workload with VCS2 remapping enabled!\n"); return wrk; From patchwork Wed Sep 5 13:49:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588877 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 BCFF05A4 for ; Wed, 5 Sep 2018 13:49:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC3E92A1F3 for ; Wed, 5 Sep 2018 13:49:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A07E42A1E7; Wed, 5 Sep 2018 13:49:55 +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 4C9E52A1DA for ; Wed, 5 Sep 2018 13:49:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F5296E4A3; Wed, 5 Sep 2018 13:49:53 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id E9C0C6E49C for ; Wed, 5 Sep 2018 13:49:49 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id m27-v6so7785651wrf.3 for ; Wed, 05 Sep 2018 06:49:49 -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=92H6ZFxNIoSNRSsz5pW7wtNYH0rQcm/x0l5sY6iUn+E=; b=bfB+4wSvXE3Ap8xPBopMLiuI/zaiIxHbJ6ON8NBMk8YCVjy6iGfxlhL/UIxmLPpsMH gp4MVoOvqi6OdeybR/ufYOSXpV2ba12OKIEuL3yX+1Ask787/sw/6piC+FgzwIpfwI7m ZOOeCRfM2NQiQI5zBPNv1bEA57M8II6kn0WLVix0yfbC8R604SHArFv5YxTV18KBAsJC hTTH7ZyTHwbTLhxGo0iscTuvesVPLV/ffeJ96owkQvODmku+vk/qD7/8Qcb2Z2zM0PyG vShs2Z1E9HjOQ3kn9/cNStXM6AENI0Zm3FInU9VkVrkS9GjEw6iISJMgOF96U7EugSKt EFPQ== X-Gm-Message-State: APzg51BAy7Boapxu77Z0jx9Qw4shuLhYUXDXVivpdE4LhtCPYg9Mpugu +UDvyU/QKeC4MlW9+8YHKP5JhMDA07A= X-Google-Smtp-Source: ANB0VdYVHh2EUlE5HV49Gdvh9v5gwnjJ6ml4p85pINhrZD4Yc2Jzp4ZhDU7EtxlXUAwOjB79R4POfw== X-Received: by 2002:adf:ce06:: with SMTP id p6-v6mr27745394wrn.118.1536155388602; Wed, 05 Sep 2018 06:49:48 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:47 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:30 +0100 Message-Id: <20180905134939.2942-5-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 04/13] gem_wsim: Check sleep times 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 Notice in more places if we are running behind. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 52 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 25af4d678ba4..b05e9760f419 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -1718,6 +1718,21 @@ static bool sync_deps(struct workload *wrk, struct w_step *w) return synced; } +static unsigned int measured_usleep(unsigned int usec) +{ + struct timespec ts = { }; + unsigned int slept; + + slept = igt_nsec_elapsed(&ts); + igt_assert(slept == 0); + do { + usleep(usec - slept); + slept = igt_nsec_elapsed(&ts) / 1000; + } while (slept < usec); + + return igt_nsec_elapsed(&ts); +} + static void *run_workload(void *data) { struct workload *wrk = (struct workload *)data; @@ -1739,7 +1754,7 @@ static void *run_workload(void *data) count++) { unsigned int cur_seqno = wrk->sync_seqno; - clock_gettime(CLOCK_MONOTONIC, &wrk->repeat_start); + igt_gettime(&wrk->repeat_start); for (i = 0, w = wrk->steps; wrk->run && (i < wrk->nr_steps); i++, w++) { @@ -1751,13 +1766,14 @@ static void *run_workload(void *data) } else if (w->type == PERIOD) { struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); + igt_gettime(&now); do_sleep = w->period - elapsed_us(&wrk->repeat_start, &now); if (do_sleep < 0) { - if (verbose > 1) - printf("%u: Dropped period @ %u/%u (%dus late)!\n", - wrk->id, count, i, do_sleep); + if (verbose > 1 && + -do_sleep > 10 * w->period / 100) + printf("%u: Missed period @ %u/%u (%dus late)!\n", + wrk->id, count, i, -do_sleep); continue; } } else if (w->type == SYNC) { @@ -1793,7 +1809,31 @@ static void *run_workload(void *data) } if (do_sleep || w->type == PERIOD) { - usleep(do_sleep); + long slept = measured_usleep(do_sleep) / 1000; + + if ( w->type == PERIOD) { + struct timespec now; + + igt_gettime(&now); + + slept = elapsed_us(&wrk->repeat_start, + &now); + + if (verbose > 1 && + slept > (110 * w->period / 100)) + printf("%u: Overslept period by %ldus @ %u/%u! (%uus)\n", + wrk->id, + -slept, count, + i, w->period); + } else { + if (verbose > 1 && + slept > (110 * do_sleep / 100)) + printf("%u: Overslept by %ldus @ %u/%u! (%uus)\n", + wrk->id, + slept - do_sleep, count, + i, do_sleep); + } + continue; } From patchwork Wed Sep 5 13:49:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588879 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 EE3EB5A4 for ; Wed, 5 Sep 2018 13:49:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE83E2A1E7 for ; Wed, 5 Sep 2018 13:49:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D33A12A209; Wed, 5 Sep 2018 13:49:56 +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 893482A1E7 for ; Wed, 5 Sep 2018 13:49:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE8386E4A6; Wed, 5 Sep 2018 13:49:53 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4CCA6E4A1 for ; Wed, 5 Sep 2018 13:49:50 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id w11-v6so7758350wrc.5 for ; Wed, 05 Sep 2018 06:49:50 -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=u95euLJSsSvGtHMLx6OZ9r28UQzGdIK8Tk1PuNgDB7k=; b=fCf/43ATIeGjwFbx5LckcBPDXUbKx9xGukP7+4iVa+0jBQYD9LQNRYQyGqx36cgHRG 65V6L26dTiKhb8NbDY5srbtKihyAOgg7oklaRtZhfLAnRGNBihPpUwHxxzZYxs3+2xgx Kih/RvMDKuznZXWBkJys9taYvmEF07WWcA/4f8xgAAEPU5ModnslW+2bliu3Z9GghE88 +WFmPCx2fXpxZByabj5p3aYb4INTValEVVc5R4Tru1ElKEocai2ZCarJBinKfuX6pe2q 98tumv6/l/ZtRiLfkY53j02ByYkXHJ1RwdJzqlnkB8wImTd+Qj4KkEhztgkCbYxDj1OC B84g== X-Gm-Message-State: APzg51ArHkBNMyWnmHR6uXUaqlvQVp882aIqlXVdqpNKtUD7Ck0OkVTz OoP1zr8CSHcl84a5T9do8Pxc5w== X-Google-Smtp-Source: ANB0VdYnP9aTfoSUkNEjZ4BPivdBd3Kb/jV0SWq8jyPBrDdUpXwkZOyiwVHB92fgL/Xr6m8vdHNSvw== X-Received: by 2002:a5d:4089:: with SMTP id o9-v6mr26726080wrp.133.1536155389524; Wed, 05 Sep 2018 06:49:49 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:49 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:31 +0100 Message-Id: <20180905134939.2942-6-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 05/13] gem_wsim: Make workload commands case sensitive 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 Need namespace for new commands and I never documented they are case insensitive so it is fine. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index b05e9760f419..fe9535df75c6 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -310,7 +310,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { fstart = NULL; - if (!strcasecmp(field, "d")) { + if (!strcmp(field, "d")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -326,7 +326,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.delay = tmp; goto add_step; } - } else if (!strcasecmp(field, "p")) { + } else if (!strcmp(field, "p")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -342,7 +342,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.period = tmp; goto add_step; } - } else if (!strcasecmp(field, "s")) { + } else if (!strcmp(field, "s")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -359,7 +359,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.target = tmp; goto add_step; } - } else if (!strcasecmp(field, "t")) { + } else if (!strcmp(field, "t")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -375,7 +375,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.throttle = tmp; goto add_step; } - } else if (!strcasecmp(field, "q")) { + } else if (!strcmp(field, "q")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -391,7 +391,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.throttle = tmp; goto add_step; } - } else if (!strcasecmp(field, "a")) { + } else if (!strcmp(field, "a")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { tmp = atoi(field); @@ -407,7 +407,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.target = tmp; goto add_step; } - } else if (!strcasecmp(field, "f")) { + } else if (!strcmp(field, "f")) { step.type = SW_FENCE; goto add_step; } From patchwork Wed Sep 5 13:49:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588875 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 E70395A4 for ; Wed, 5 Sep 2018 13:49:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D59D02A1E6 for ; Wed, 5 Sep 2018 13:49:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C77D12A1DA; Wed, 5 Sep 2018 13:49:54 +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 636942A1DA for ; Wed, 5 Sep 2018 13:49:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7958A6E49F; Wed, 5 Sep 2018 13:49:53 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E5D56E49E for ; Wed, 5 Sep 2018 13:49:52 +0000 (UTC) Received: by mail-wr1-x430.google.com with SMTP id o37-v6so7751018wrf.6 for ; Wed, 05 Sep 2018 06:49:52 -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=Dlym15nVUeycG9ypBhn/CsZVPRjVR0WjxTwlMOk9hqg=; b=CIuzoOIEr0CtX094kKniybGjyZNmYGg4bG6ngvAvYJnQb6ZpsAUFajozBv5T1PBLWs Ot0s5CA8g91jZzcG/7SQNY/GdxN0if9+odVUYv716TvW8OCqElJunJV1qXnnqgWm/Tt/ 8AGv6KO3piSis7dYbLy03IdpqJoc+FOZF0ovEg01KY0/y0kYrJQ+EnogcpoOyb41exiv dla2GWNIRLdGyPbpc6JW9eQozJEbu3fLQOxdUPkmUGakQ/GKX71rihzccOyMirYXTZMx //sm3WJdeNxEBLdZE6eldQ9YuKzO5S3MP7q5aHIPgK8izO9hvNG+OX51zXAWlbTpP/iV l72g== X-Gm-Message-State: APzg51D/zrz3sx7gQMKXF24ejJPuG03/LP9c3zR46D//Ezi6pmAMCY5f UOd/vn0Qr2s7zH4PJzIu+lhOdg== X-Google-Smtp-Source: ANB0VdaO8gSzVdSvTaDnvvvbavUrCUVBiiVEw7vqxEsXLHAjjhBudqUEUDEsMHsqPzKnPmoGH2Cmrw== X-Received: by 2002:a5d:6381:: with SMTP id p1-v6mr5325308wru.106.1536155390305; Wed, 05 Sep 2018 06:49:50 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:49 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:32 +0100 Message-Id: <20180905134939.2942-7-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 06/13] gem_wsim: Context priority support 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 A new workload command ('P') is added which enables per context dynamic priority control. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 48 +++++++++++++++++++++++++++++++++++++++++- benchmarks/wsim/README | 18 ++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index fe9535df75c6..0c52ec567430 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -82,7 +82,8 @@ enum w_type THROTTLE, QD_THROTTLE, SW_FENCE, - SW_FENCE_SIGNAL + SW_FENCE_SIGNAL, + CTX_PRIORITY }; struct deps @@ -114,6 +115,7 @@ struct w_step int target; int throttle; int fence_signal; + int priority; }; /* Implementation details */ @@ -162,6 +164,7 @@ struct workload unsigned int nr_ctxs; struct { uint32_t id; + int priority; unsigned int static_vcs; } *ctx_list; @@ -342,6 +345,36 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) step.period = tmp; goto add_step; } + } else if (!strcmp(field, "P")) { + unsigned int nr = 0; + while ((field = strtok_r(fstart, ".", &fctx)) != + NULL) { + tmp = atoi(field); + if (tmp <= 0 && nr == 0) { + if (verbose) + fprintf(stderr, + "Invalid context at step %u!\n", + nr_steps); + return NULL; + } + + if (nr == 0) { + step.context = tmp; + } else if (nr == 1) { + step.priority = tmp; + } else { + if (verbose) + fprintf(stderr, + "Invalid priority format at step %u!\n", + nr_steps); + return NULL; + } + + nr++; + } + + step.type = CTX_PRIORITY; + goto add_step; } else if (!strcmp(field, "s")) { if ((field = strtok_r(fstart, ".", &fctx)) != NULL) { @@ -1806,6 +1839,19 @@ static void *run_workload(void *data) inc = cur_seqno - wrk->sync_seqno; sw_sync_timeline_inc(wrk->sync_timeline, inc); continue; + } else if (w->type == CTX_PRIORITY) { + if (w->priority != wrk->ctx_list[w->context].priority) { + struct drm_i915_gem_context_param param = { + .ctx_id = wrk->ctx_list[w->context].id, + .param = I915_CONTEXT_PARAM_PRIORITY, + .value = w->priority, + }; + + gem_context_set_param(fd, ¶m); + wrk->ctx_list[w->context].priority = + w->priority; + } + continue; } if (do_sleep || w->type == PERIOD) { diff --git a/benchmarks/wsim/README b/benchmarks/wsim/README index 01766d37564f..fd9bff3401af 100644 --- a/benchmarks/wsim/README +++ b/benchmarks/wsim/README @@ -3,6 +3,7 @@ Workload descriptor format ctx.engine.duration_us.dependency.wait,... ..[-].[/][...].<0|1>,... +P.. d|p|s|t|q|a.,... f @@ -22,6 +23,7 @@ Additional workload steps are also supported: 'q' - Throttle to n max queue depth. 'f' - Create a sync fence. 'a' - Advance the previously created sync fence. + 'P' - Context priority. Engine ids: RCS, BCS, VCS, VCS1, VCS2, VECS @@ -110,3 +112,19 @@ created at the second step. They are submitted ahead of time while still not runnable. When the second RCS batch completes the standalone fence is signaled which allows the two VCS batches to be executed. Finally we wait until the both VCS batches have completed before starting the (optional) next iteration. + +Context priority +---------------- + + P.1.-1 + 1.RCS.1000.0.0 + P.2.1 + 2.BCS.1000.-2.0 + +Context 1 is marked as low priority (-1) and then a batch buffer is submitted +against it. Context 2 is marked as high priority (1) and then a batch buffer +is submitted against it which depends on the batch from context 1. + +Context priority command is executed at workload runtime and is valid until +overriden by another (optional) same context priority change. Actual driver +ioctls are executed only if the priority level has changed for the context. From patchwork Wed Sep 5 13:49:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588881 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 1D2F215E9 for ; Wed, 5 Sep 2018 13:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D58C2A1DF for ; Wed, 5 Sep 2018 13:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01AB82A1ED; Wed, 5 Sep 2018 13:49:57 +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 B17132A1E7 for ; Wed, 5 Sep 2018 13:49:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A90286E4AD; Wed, 5 Sep 2018 13:49:54 +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 A289F6E49E for ; Wed, 5 Sep 2018 13:49:52 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id n2-v6so7766511wrw.7 for ; Wed, 05 Sep 2018 06:49:52 -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=TW5YWU1Hbq+bnQz7QInybqVh9MytvhMzCZXRu8Toby4=; b=E+XyzY9cwRebZyRP7D4ZTR2CVgoTUV411PCqir3KIB9TJhKc2zJRpxS6PvDIsny7WY 820TZiCB4Zzg/KsEVZGRI4baKPxSNc0X3lSLA30N0G+6gxMPgQaKyWuj7HDCZjM5avLN aDtUQb3P447dDccK9pfPH4ejFSkTv9QFUjOJJX5EXI1cs32KO+CRVkssGIVCkkJ67E+9 IL2P1nzgTzOBjMyFEg7IoOY9bUzu0AA1PLsY5pLTel0fSogpzFTJ91kcuU8hIr06fKc7 4jfMUx3PeczUUIaEW16VE/gW+dJo9hX7JdFnhQpCX+E/yznLn1K3vjkUfAbzkLsrypJP ezIg== X-Gm-Message-State: APzg51AmQSBqmFhyg4CL6jNrQ8xgWyZiv0n9wX7bJravHiLX8xnXo6TO NIg2VVYImrxB1+wdupHY9L5AZvvnNXs= X-Google-Smtp-Source: ANB0VdYrDlXQO9UsutEh05mlBG+S2fctoiQKpTfEiZP47d2VCR3kTqLUENxLhqiB/GwXY4OxI67ltQ== X-Received: by 2002:adf:b243:: with SMTP id y3-v6mr26924693wra.90.1536155391205; Wed, 05 Sep 2018 06:49:51 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:50 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:33 +0100 Message-Id: <20180905134939.2942-8-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 07/13] gem_wsim: Make batches preemptable by default 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 MI_NOOP cannot be preempted which means up to now gem_wsim workloads were preemptable on batch buffer granularity only. Add MI_ARB_CHK every 100us so the new default is mid-batch preemption. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 0c52ec567430..7f2d0c83a0e7 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -685,6 +685,25 @@ static unsigned long get_bb_sz(unsigned int duration) nop_calibration_us, sizeof(uint32_t)); } +static void +init_bb(struct w_step *w, unsigned int flags) +{ + /* Preemption point every 100us. */ + const unsigned int arb_period = get_bb_sz(100) / sizeof(uint32_t); + unsigned int i; + uint32_t *ptr; + + gem_set_domain(fd, w->bb_handle, + I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC); + + ptr = gem_mmap__wc(fd, w->bb_handle, 0, w->bb_sz, PROT_WRITE); + + for (i = arb_period; i < w->bb_sz / sizeof(uint32_t); i += arb_period) + ptr[i] = 0x5 << 23; /* MI_ARB_CHK */ + + munmap(ptr, w->bb_sz); +} + static void terminate_bb(struct w_step *w, unsigned int flags) { @@ -839,6 +858,7 @@ alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags) w->bb_sz = get_bb_sz(w->duration.max); w->bb_handle = w->obj[j].handle = gem_create(fd, w->bb_sz); + init_bb(w, flags); terminate_bb(w, flags); if (flags & SEQNO) { From patchwork Wed Sep 5 13:49:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588885 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 9665915E9 for ; Wed, 5 Sep 2018 13:50:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D8E2A1DA for ; Wed, 5 Sep 2018 13:50:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A6B32A1EA; Wed, 5 Sep 2018 13:50:00 +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 0B2522A1DA for ; Wed, 5 Sep 2018 13:50:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B07A6E49C; Wed, 5 Sep 2018 13:49:57 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0C626E4A4 for ; Wed, 5 Sep 2018 13:49:53 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id z96-v6so7747492wrb.8 for ; Wed, 05 Sep 2018 06:49:53 -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=Nt9+Xrt3EbtMAHFZKTodaXtQ2ahViJV0kXMpOYztJxA=; b=WcT3vjrxJhahdTLOe86RATBId9d9sZpgAuB34pso6IBhm9dHIYEPoSCmESpIdZ4SN5 C+2XitOZMY6MZKQ+LRXSrpI262p5rVMnmUoWZZXqX8/NJbWCwuIliHgM60SjEEQt58tT JcLjMSwHKLzknSgRbPLnkp06PPhHbOyln7ziOJ1BPFEJ+WqJUpNiGHoSmFq6tqdoTpP2 GL4tIJSPCtYCXkqENEa309GQFW7OgZ8OIXxyySFxArvO2c7YGlwLteEcFAPVDf8fP3yz RhJ9gRNybjSAqe5GQbdU1rOnnGeIga3bekINHnmVrJIOs1YTmN2UMfCfs40aDuMgTwYF JrsQ== X-Gm-Message-State: APzg51B8ibKki3xzaSs3TUN+ZxEO7NKgmtjoKxo4gV2QZGodXoye1GjK C8+Otr2IuFS3/eygI+PzkzEXb4mHdho= X-Google-Smtp-Source: ANB0VdblC0KUj+vC9rB7Zk5z8AaZ7tfK6fxj5ApnNeK+Ze//yCUH9yd6/TiMCO7f1esIGqxQJ+oQlQ== X-Received: by 2002:a5d:5248:: with SMTP id p8-v6mr26730543wrv.198.1536155392151; Wed, 05 Sep 2018 06:49:52 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:51 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:34 +0100 Message-Id: <20180905134939.2942-9-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 08/13] gem_wsim: Per context preemption point control 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 Allow workloads to specify frequency of preemption points per context. New workload command ('X') is added to allow this. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson Acked-by: Chris Wilson --- benchmarks/gem_wsim.c | 84 ++++++++++++++++++++++++++++++++++++++++-- benchmarks/wsim/README | 18 ++++++++- 2 files changed, 98 insertions(+), 4 deletions(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 7f2d0c83a0e7..6b128a1e9d57 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -83,7 +83,8 @@ enum w_type QD_THROTTLE, SW_FENCE, SW_FENCE_SIGNAL, - CTX_PRIORITY + CTX_PRIORITY, + PREEMPTION }; struct deps @@ -122,6 +123,7 @@ struct w_step unsigned int idx; struct igt_list rq_link; unsigned int request; + unsigned int preempt_us; struct drm_i915_gem_execbuffer2 eb; struct drm_i915_gem_exec_object2 *obj; @@ -443,6 +445,42 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) } else if (!strcmp(field, "f")) { step.type = SW_FENCE; goto add_step; + } else if (!strcmp(field, "X")) { + unsigned int nr = 0; + while ((field = strtok_r(fstart, ".", &fctx)) != + NULL) { + tmp = atoi(field); + if (tmp <= 0 && nr == 0) { + if (verbose) + fprintf(stderr, + "Invalid context at step %u!\n", + nr_steps); + return NULL; + } else if (tmp < 0 && nr == 1) { + if (verbose) + fprintf(stderr, + "Invalid preemption period at step %u!\n", + nr_steps); + return NULL; + } + + if (nr == 0) { + step.context = tmp; + } else if (nr == 1) { + step.period = tmp; + } else { + if (verbose) + fprintf(stderr, + "Invalid preemption format at step %u!\n", + nr_steps); + return NULL; + } + + nr++; + } + + step.type = PREEMPTION; + goto add_step; } tmp = atoi(field); @@ -688,11 +726,14 @@ static unsigned long get_bb_sz(unsigned int duration) static void init_bb(struct w_step *w, unsigned int flags) { - /* Preemption point every 100us. */ - const unsigned int arb_period = get_bb_sz(100) / sizeof(uint32_t); + const unsigned int arb_period = + get_bb_sz(w->preempt_us) / sizeof(uint32_t); unsigned int i; uint32_t *ptr; + if (!arb_period) + return; + gem_set_domain(fd, w->bb_handle, I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC); @@ -968,6 +1009,41 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) } } + /* Record default preemption. */ + for (i = 0, w = wrk->steps; i < wrk->nr_steps; i++, w++) { + if (w->type == BATCH) + w->preempt_us = 100; + } + + /* + * Scan for contexts with modified preemption config and record their + * preemption period for the following steps belonging to the same + * context. + */ + for (i = 0, w = wrk->steps; i < wrk->nr_steps; i++, w++) { + struct w_step *w2; + int j; + + if (w->type != PREEMPTION) + continue; + + for (j = i + 1; j < wrk->nr_steps; j++) { + w2 = &wrk->steps[j]; + + if (w2->context != w->context) + continue; + else if (w2->type == PREEMPTION) + break; + else if (w2->type != BATCH) + continue; + + w2->preempt_us = w->period; + } + } + + /* + * Allocate batch buffers. + */ for (i = 0, w = wrk->steps; i < wrk->nr_steps; i++, w++) { unsigned int _flags = flags; enum intel_engine_id engine = w->engine; @@ -1872,6 +1948,8 @@ static void *run_workload(void *data) w->priority; } continue; + } else if (w->type == PREEMPTION) { + continue; } if (do_sleep || w->type == PERIOD) { diff --git a/benchmarks/wsim/README b/benchmarks/wsim/README index fd9bff3401af..205cd6c93afb 100644 --- a/benchmarks/wsim/README +++ b/benchmarks/wsim/README @@ -3,7 +3,7 @@ Workload descriptor format ctx.engine.duration_us.dependency.wait,... ..[-].[/][...].<0|1>,... -P.. +P|X.. d|p|s|t|q|a.,... f @@ -24,6 +24,7 @@ Additional workload steps are also supported: 'f' - Create a sync fence. 'a' - Advance the previously created sync fence. 'P' - Context priority. + 'X' - Context preemption control. Engine ids: RCS, BCS, VCS, VCS1, VCS2, VECS @@ -128,3 +129,18 @@ is submitted against it which depends on the batch from context 1. Context priority command is executed at workload runtime and is valid until overriden by another (optional) same context priority change. Actual driver ioctls are executed only if the priority level has changed for the context. + +Context preemption control +-------------------------- + + X.1.0 + 1.RCS.1000.0.0 + X.1.500 + 1.RCS.1000.0.0 + +Context 1 is marked as non-preemptable batches and a batch is sent against 1. +The same context is then marked to have batches which can be preempted every +500us and another batch is submitted. + +Same as with context priority, context preemption commands are valid until +optionally overriden by another preemption control change on the same context. From patchwork Wed Sep 5 13:49:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588883 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 5791415E9 for ; Wed, 5 Sep 2018 13:49:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46F702A1DF for ; Wed, 5 Sep 2018 13:49:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 458142A1F3; Wed, 5 Sep 2018 13:49:59 +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 E9D1E2A1DF for ; Wed, 5 Sep 2018 13:49:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21C0C6E4B3; Wed, 5 Sep 2018 13:49:57 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 514076E4A8 for ; Wed, 5 Sep 2018 13:49:54 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id u12-v6so7750491wrr.4 for ; Wed, 05 Sep 2018 06:49:54 -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=nZmuEJqeaZ6quJP78FwVF/20RrE4kXSCo5Q0n8aTALA=; b=rK8Q6awVWEGaDUQU/fLcxdq5w31VkDdPClrkIwi9eVgj/6q83LRxewInPe9g6BR662 UR/paRI4NSJPC7Ni/CSkct/sjJ1H+DtQ2yYDOmYlGED/o5i3TU8fS/FjwqDeOP9JEOvf mia5blXo22cIA2FJNDiMkUShDUHrT9R+rp8G2oAj4Yph1ij6gkh2JOZRQ8TZRCFlG8sJ ORoZnxkYt2olPobC3vVt6HB1Ao4KCVjftxJTa8l9UNTIgi3ushorRozWHHH20dh1dzDJ ACK2ZGFSsw8gl0kHgEx4aNJWPB/EKQodeHmKERale++4qr54/nQsK0IG0IYEHULBjVu+ x5Cw== X-Gm-Message-State: APzg51A2sg/lV0AjI3H51BrbLkSVEgPkDqClRs1N8QSUnVGkEZGBnT0h Q9nTpWi3uw3QOuExb8Cp/k+qxA== X-Google-Smtp-Source: ANB0VdZKYatGy0YYpxDr6XiyzJmQ/qrHo1h4uGoWTCIXCLF7505fKGbiF4E5hUfZ5ygipwjc9qbRGA== X-Received: by 2002:adf:8205:: with SMTP id 5-v6mr25832151wrb.160.1536155393021; Wed, 05 Sep 2018 06:49:53 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:52 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:35 +0100 Message-Id: <20180905134939.2942-10-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 09/13] media-bench: Update for engine=class:instance tracepoints 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 Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 375844d9cdf6..a3619ceb34cc 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -187,7 +187,7 @@ sub trace_workload open CMD, "$cmd |" or die; while () { chomp; - if (/Ring(\d+): (\d+) batches.*?(\d+\.?\d+)% idle,/) { + if (/Ring(\S+): (\d+) batches.*?(\d+\.?\d+)% idle,/) { if ($2 >= $min_batches) { $engines{$1} = $3; } else { @@ -542,7 +542,7 @@ foreach my $wrk (@workloads) { my ($r, $error, $c, $wps, $swps); my $saturated = 0; my $result = 'Pass'; - my $vcs2 = $gt2 ? '1' : '3'; + my $vcs2 = $gt2 ? '1:0' : '2:1'; my %problem; my $engines; @@ -575,11 +575,11 @@ foreach my $wrk (@workloads) { if ($saturated == 0) { # Not a single saturated engine $result = 'FAIL'; - } elsif (not exists $engines->{'2'} or not exists $engines->{$vcs2}) { + } elsif (not exists $engines->{'2:0'} or not exists $engines->{$vcs2}) { # VCS1 and VCS2 not present in a balancing workload $result = 'FAIL'; } elsif ($saturated == 1 and - ($engines->{'2'} < $idle_tolerance_pct or + ($engines->{'2:0'} < $idle_tolerance_pct or $engines->{$vcs2} < $idle_tolerance_pct)) { # Only one VCS saturated $result = 'WARN'; From patchwork Wed Sep 5 13:49:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588887 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 116E315E9 for ; Wed, 5 Sep 2018 13:50:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F33142A1DF for ; Wed, 5 Sep 2018 13:50:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74652A1EA; Wed, 5 Sep 2018 13:50:01 +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 AAB452A1DF for ; Wed, 5 Sep 2018 13:50:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19B976E4B4; Wed, 5 Sep 2018 13:49:58 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FF396E49C for ; Wed, 5 Sep 2018 13:49:55 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id t25-v6so7799929wmi.3 for ; Wed, 05 Sep 2018 06:49:55 -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=QXzzCTd9UZ3iH3c3jcuAret+ZOSyZw1S1+OrtQlcT9A=; b=QFHMEwhUbqmnoKIwQFbbx1LwJLACWzUa4H052Hh//vo97gNjPSwEDlctSYpfqamJYk HC6Rlv1QAOvnl6RmFFWIaP+M6xxVK4sy6sXuIjzt4NFAx2v+DX2nJBRYKBzxTlilAYmp wx3PTqa28Gp3P9dxoFf8A8Q5NzapJXeafnXYrUAJQ2D7pmSWeLWeOlCW7k9AOTX8HLJD fTSBVrJ/BM2MGBJPoomlOn+B3p50P82OQWeaO18p3GsMQmKgWKL74v8PndLE+lHglbGS XvZqL+c+n3XNQxm/QaiRQvekrZKjm5/8sd+1vC69pdnJLO4XXY1TzQjsr/wL4efyjBM7 7X+w== X-Gm-Message-State: APzg51DbcOCVFHNylHzc0NZzbDMPO3XEArfdLKeEpHhyIxJjdn/JlP52 lr3k7sUTf71O5/BKosXAaHUPkQ== X-Google-Smtp-Source: ANB0Vda4n+CQCJpuYXlmvCZMn3MnIlvUaIybzakjmq7ELECnL+uFiODZ+RZav3/QrXFcNnphQT/AGg== X-Received: by 2002:a1c:1c92:: with SMTP id c140-v6mr268277wmc.155.1536155393880; Wed, 05 Sep 2018 06:49:53 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:53 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:36 +0100 Message-Id: <20180905134939.2942-11-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 10/13] media-bench: Protect against incorrect -b syntax 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 -b is to pass the command argument directly to gem_wsim so must include another -b. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index a3619ceb34cc..5070cae088f3 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -341,7 +341,10 @@ ENDHELP $verbose = 1 if defined $opts{'v'}; $gt2 = 1 if defined $opts{'2'}; $show_cmds = 1 if defined $opts{'x'}; -$balancer = $opts{'b'} if defined $opts{'b'}; +if (defined $opts{'b'}) { + die unless substr($opts{'b'}, 0, 2) eq '-b'; + $balancer = $opts{'b'}; +} if (defined $opts{'B'}) { @balancers = split /,/, $opts{'B'}; } else { From patchwork Wed Sep 5 13:49:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588889 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 6DA3715E9 for ; Wed, 5 Sep 2018 13:50:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D6802A209 for ; Wed, 5 Sep 2018 13:50:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51CE72A1F3; Wed, 5 Sep 2018 13:50:04 +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 E27CC2A1DA for ; Wed, 5 Sep 2018 13:50:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1CF16E4B6; Wed, 5 Sep 2018 13:49:59 +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 7FC756E49C for ; Wed, 5 Sep 2018 13:49:56 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id a108-v6so7700706wrc.13 for ; Wed, 05 Sep 2018 06:49:56 -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=vQMgCkXhwMvBOHm/cDIIsMZGXoNL9B/LNMC8epTjA0Q=; b=pJCJPfsu09dhcSZRmj8/K432JqP5kpTNcFhVb0uVBiqjl+nhTQKS1Y98Z4qhcBBTJW q10HFLINSkblNSahmX26ycovSV2WqFBvSzLUkfc/0/SWj71JRRLithE1A3dhy4ACpC2v IF+qHSBHAkDWRS7AhFmujMXdwwgmE3JzVSnwZrAoB5AFU5VBuqlPf3Oame1SrJUVcweF KC9Yz7q5nSqno9bJxN5KAPNXB+QAdi4+F4w0Us236+LHwR+QtFzz0EjDeu9mkgk971UP 1r1fZ2aB+y8plrlIBkHtD8NBoI9ihffLeZCTW5a7fl0NLKGTVWr+nEUuhdB7sawx4x73 +fIw== X-Gm-Message-State: APzg51Dx+Hf7wW3AijC36+rdsZWcAAN74ZylyGT5czu6nkiFCAuyX7OD COJoa2j+D3bCJZoIbIeYjy5+5w== X-Google-Smtp-Source: ANB0VdayQUxDqfzPQsaGeKI8ZG+0fmjimB9ZJkaR9pZWuGkb+J1WSRWzWlkfgSa2hOnNJk0VuCkymg== X-Received: by 2002:a5d:4b52:: with SMTP id w18-v6mr26023485wrs.87.1536155395132; Wed, 05 Sep 2018 06:49:55 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:54 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:37 +0100 Message-Id: <20180905134939.2942-12-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 11/13] media-bench: Fix tracing of direct workloads 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 Build argument list properly and check exit codes when executing sub-commands. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 54 +++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 5070cae088f3..9bf8c8789fe2 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -131,7 +131,8 @@ sub add_wps_arg return @args if $realtime_target <= 0; $period = int(1000000 / $realtime_target); - push @args, "-a p.$period"; + push @args, '-a'; + push @args, 'p.$period'; return @args; } @@ -144,7 +145,7 @@ sub run_workload @args = add_wps_arg(@args); push @args, '-2' if $gt2; - unshift @args, "$wsim"; + unshift @args, $wsim; $cmd = join ' ', @args; show_cmd($cmd); @@ -164,23 +165,31 @@ sub run_workload sub trace_workload { my ($wrk, $b, $r, $c) = @_; - my @args = ( "-n $nop", "-r $r", "-c $c"); + my @args = ($tracepl, '--trace', $wsim, '-q', '-n', $nop, '-r', $r, '-c', $c); my $min_batches = 16 + $r * $c / 2; my @skip_engine; my %engines; my ($cmd, $file); - my $warg = defined $w_direct ? $wrk : "-w $wrk_root/$wrk"; - push @args, "$b -R" unless $b eq ''; push @args, '-2' if $gt2; - push @args, $warg; - unshift @args, '-q'; - unshift @args, "$tracepl --trace $wsim"; + unless ($b eq '') { + push @args, '-R'; + push @args, split /\s+/, $b; + } - $cmd = join ' ', @args; - show_cmd($cmd); - system($cmd); + if (defined $w_direct) { + push @args, split /\s+/, $wrk; + } else { + push @args, '-w'; + push @args, $wrk_root . '/' . $wrk; + } + + show_cmd(join ' ', @args); + if (-e 'perf.data') { + unlink 'perf.data' or die; + } + system(@args) == 0 or die; $cmd = "perf script | $tracepl"; show_cmd($cmd); @@ -205,13 +214,13 @@ sub trace_workload $cmd = "perf script > ${file}.trace"; show_cmd($cmd); - system($cmd); + system($cmd) == 0 or die; $cmd = "perf script | $tracepl --html -x ctxsave -s -c "; $cmd .= join ' ', map("-i $_", @skip_engine); $cmd .= " > ${file}.html"; show_cmd($cmd); - system($cmd); + system($cmd) == 0 or die; return \%engines; } @@ -219,7 +228,6 @@ sub trace_workload sub calibrate_workload { my ($wrk) = @_; - my $warg = defined $w_direct ? $wrk : "-w $wrk_root/$wrk"; my $tol = $tolerance; my $loops = 0; my $error; @@ -227,9 +235,16 @@ sub calibrate_workload $r = $realtime_target > 0 ? $realtime_target * $client_target_s : 23; for (;;) { - my @args = ( "-n $nop", "-r $r", $warg); + my @args = ('-n', $nop, '-r', $r); my ($time, $wps); + if (defined $w_direct) { + push @args, split /\s+/, $wrk; + } else { + push @args, '-w'; + push @args, $wrk_root . '/' . $wrk; + } + ($time, $wps) = run_workload(@args); $error = abs($time - $client_target_s) / $client_target_s; @@ -254,23 +269,24 @@ sub find_saturation_point my ($last_wps, $c, $swps); my $target = $realtime_target > 0 ? $realtime_target : $wps_target; my $r = $rr; - my ($warg, $wcnt); + my $wcnt; my $maxc; my $max = 0; if (defined $w_direct) { - $warg = $wrk; + push @args, split /\s+/, $wrk; $wcnt = () = $wrk =~ /-[wW]/gi; } else { - $warg = "-w $wrk_root/$wrk"; + push @args, '-w'; + push @args, $wrk_root . '/' . $wrk; $wcnt = 1; } for ($c = 1; ; $c = $c + 1) { my ($time, $wps); - ($time, $wps) = run_workload((@args, ($warg, "-r $r", "-c $c"))); + ($time, $wps) = run_workload((@args, ('-r', $r, '-c', $c))); say " $c clients is $wps wps." if $verbose; From patchwork Wed Sep 5 13:49:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588891 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 5B1B85A4 for ; Wed, 5 Sep 2018 13:50:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 404212A223 for ; Wed, 5 Sep 2018 13:50:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E7932A227; Wed, 5 Sep 2018 13:50:07 +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 E91CA2A217 for ; Wed, 5 Sep 2018 13:50:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1BCB6E4BB; Wed, 5 Sep 2018 13:50:04 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43AB36E4B4 for ; Wed, 5 Sep 2018 13:49:57 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id 207-v6so7765574wme.5 for ; Wed, 05 Sep 2018 06:49:57 -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=nxMD7EMvd2UMJe7lVb30WFAgQmySrljr24IVJIwOCwY=; b=J8aUa5BBY3b+YRByLMxGzTymLTzRRxCqiNTzZyKf75ud2EnX5myHlAkjAARMp6LeOG g7ewslJs2uOZxUQT3Tbw2QN/VTpf1xpdpLtk6mXESZMpxPyZXvcg9QbDkvFXVfuAr8we bv8K6hpPGh4PmK/QAF24uNTAunV0WXFeECxRDnmQGpnZcgufi6GAA8Iq5a0cGQ9aF3e7 KfNQTHguwxAnj93/ultQjQ/ZhrwLz+Z8SI5WMSWZD7cGyNO6/3TAZ2Ut8UguQOl7Az8+ Ss/xquxrVguX1S/2FY+92JrgMPWRSf+8mMjJtKgZ3CsxfPkjBEUdr8fu7XheuS0khMZm tIkg== X-Gm-Message-State: APzg51AcdZumi5TuirUvPlyraRjsqVeVnkVLRk4LkiFNQDrLTwjKZ8rE KRzfc8af/Uf8PICT86Th3dNIRiPK5ns= X-Google-Smtp-Source: ANB0VdbpxtiDg4sz7ydswZ+X79/3tz1sKrcnM6z4ChqRpldYNShPd4kojEZhsZ9qejLMruQsnUNAEA== X-Received: by 2002:a1c:68f:: with SMTP id 137-v6mr325304wmg.82.1536155395904; Wed, 05 Sep 2018 06:49:55 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:55 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:38 +0100 Message-Id: <20180905134939.2942-13-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 12/13] media-bench: Write out trace files directly. 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 Instead of relying on shell redirection. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 9bf8c8789fe2..77e75c78b113 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -162,6 +162,21 @@ sub run_workload return ($time, $wps); } +sub dump_cmd +{ + my ($cmd, $file) = @_; + + show_cmd("$cmd > $file"); + + open FOUT, '>', $file or die; + open TIN, "$cmd |" or die; + while () { + print FOUT $_; + } + close TIN; + close FOUT; +} + sub trace_workload { my ($wrk, $b, $r, $c) = @_; @@ -212,15 +227,12 @@ sub trace_workload $b =~ s/[ <>]/_/g; $file = "${wrk}_${b}_-r${r}_-c${c}"; - $cmd = "perf script > ${file}.trace"; - show_cmd($cmd); - system($cmd) == 0 or die; + dump_cmd('perf script', "${file}.trace"); $cmd = "perf script | $tracepl --html -x ctxsave -s -c "; $cmd .= join ' ', map("-i $_", @skip_engine); - $cmd .= " > ${file}.html"; - show_cmd($cmd); - system($cmd) == 0 or die; + + dump_cmd($cmd, "${file}.html"); return \%engines; } From patchwork Wed Sep 5 13:49:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10588893 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 27E0B5A4 for ; Wed, 5 Sep 2018 13:50:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15FDC2A21E for ; Wed, 5 Sep 2018 13:50:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 147252A242; Wed, 5 Sep 2018 13:50:12 +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 4C4CD2A21E for ; Wed, 5 Sep 2018 13:50:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 771FE6E4BF; Wed, 5 Sep 2018 13:50:07 +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 620476E4B6 for ; Wed, 5 Sep 2018 13:49:58 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id j192-v6so7871821wmj.1 for ; Wed, 05 Sep 2018 06:49:58 -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=Gkj/1+pNuPkYyVEUdmtBJsAE+lfWePKjxD3acbWhmCk=; b=jjENx4fMTAz4M4gYWa1vCYVAX0a+NewMdO8R8zT7yYqBz9/XNyHQ8nkch+zjIEmMcP DIvPFqUlfEM3F8TvRLFBq4WO/C7Zm+CLUaFSNHpvvDv7WtTTXoBaSz3kg4zBClDmZpQZ QMHvMSug5sCAHHZymHaPV/c000IcpBXct2j28zgwRbwIWVA7FWwwdVgr+W4OrYiSLljW w0N8xp2qIYVOqWDXkZQfTvxjmoEbAZQcCYOWeo2rMoAoe6Y7+FRLXRs+ZFclvuEW/6Al /Y6WNIqpKgz9YchTVNNwZcMGFDrD0EMAPljR4PirrnXdbb18I8q1sGIXp5Tw1uQHT5AV OOBA== X-Gm-Message-State: APzg51BFu5CCVqdYe+vrWoQmBAGgVgIrpPh0CpFS+QbOjml89AwVUT/w 5XjzszDYWFCDcBK7vVfTAxfM2w== X-Google-Smtp-Source: ANB0VdYwzO8SDf9B7/gyRzvm8aNRtJ2fqDWK43SgpM/40CvBGXBwQEdd7lomKPVpDGI+1uoYjckeuQ== X-Received: by 2002:a1c:e0d7:: with SMTP id x206-v6mr291504wmg.74.1536155396806; Wed, 05 Sep 2018 06:49:56 -0700 (PDT) Received: from localhost.localdomain ([95.144.165.37]) by smtp.gmail.com with ESMTPSA id j66-v6sm2701639wrj.28.2018.09.05.06.49.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 06:49:56 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 5 Sep 2018 14:49:39 +0100 Message-Id: <20180905134939.2942-14-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> References: <20180905134939.2942-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATH i-g-t 13/13] media-bench: Add mixed mode evaluation 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 Mixed mode (-m) enables evaluation of different workload sets against one or more load balancing strategies. Contrary to the default mode which runs all selected workloads serialy, mixed mode runs a second stage where they are all run in parallel. The performance difference between the two passes is then used for the scoring metric. First metric is the normalized aggregate throughput, and second is balancer "fairness" as approximated by throughput achieved in mixed mode, relative to the best individual balancer for each workload. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 150 +++++++++++++++++++++++++++++++++-------- 1 file changed, 121 insertions(+), 29 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 77e75c78b113..066b542f95df 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -41,6 +41,8 @@ my $show_cmds = 0; my $realtime_target = 0; my $wps_target = 0; my $wps_target_param = 0; +my $multi_mode = 0; +my @multi_workloads; my $w_direct; my $balancer; my $nop; @@ -141,6 +143,7 @@ sub run_workload { my (@args) = @_; my ($time, $wps, $cmd); + my @ret; @args = add_wps_arg(@args); push @args, '-2' if $gt2; @@ -155,11 +158,13 @@ sub run_workload if (/^(\d+\.\d+)s elapsed \((\d+\.?\d+) workloads\/s\)$/) { $time = $1; $wps = $2; + } elsif (/(\d+)\: \d+\.\d+s elapsed \(\d+ cycles, (\d+\.?\d+) workloads\/s\)/) { + $ret[$1] = $2; } } close WSIM; - return ($time, $wps); + return ($time, $wps, \@ret); } sub dump_cmd @@ -223,7 +228,11 @@ sub trace_workload } close CMD; - $wrk =~ s/ /_/g; + $wrk =~ s/$wrk_root//g; + $wrk =~ s/\.wsim//g; + $wrk =~ s/-w/W/g; + $wrk =~ s/[ -]/_/g; + $wrk =~ s/\//-/g; $b =~ s/[ <>]/_/g; $file = "${wrk}_${b}_-r${r}_-c${c}"; @@ -259,6 +268,7 @@ sub calibrate_workload ($time, $wps) = run_workload(@args); + $wps = $r / $time if $w_direct; $error = abs($time - $client_target_s) / $client_target_s; last if $error <= $tol; @@ -278,13 +288,15 @@ sub calibrate_workload sub find_saturation_point { my ($wrk, $rr, $verbose, @args) = @_; - my ($last_wps, $c, $swps); + my ($last_wps, $c, $swps, $wwps); my $target = $realtime_target > 0 ? $realtime_target : $wps_target; my $r = $rr; my $wcnt; my $maxc; my $max = 0; + push @args, '-v' if $multi_mode and $w_direct; + if (defined $w_direct) { push @args, split /\s+/, $wrk; $wcnt = () = $wrk =~ /-[wW]/gi; @@ -297,8 +309,9 @@ sub find_saturation_point for ($c = 1; ; $c = $c + 1) { my ($time, $wps); + my @args_ = (@args, ('-r', $r, '-c', $c)); - ($time, $wps) = run_workload((@args, ('-r', $r, '-c', $c))); + ($time, $wps, $wwps) = run_workload(@args_); say " $c clients is $wps wps." if $verbose; @@ -324,21 +337,23 @@ sub find_saturation_point $r = int($rr * ($client_target_s / $time)); } elsif ($c == 1) { $swps = $wps; - return ($c, $wps, $swps) if $wcnt > 1 or - ($wps_target_param < 0 and $wps_target == 0); + return ($c, $wps, $swps, $wwps) if $wcnt > 1 or + $multi_mode or + ($wps_target_param < 0 and + $wps_target == 0); } $last_wps = $wps; } if ($target <= 0) { - return ($maxc, $max, $swps); + return ($maxc, $max, $swps, $wwps); } else { - return ($c - 1, $last_wps, $swps); + return ($c - 1, $last_wps, $swps, $wwps); } } -getopts('hv2xn:b:W:B:r:t:i:R:T:w:', \%opts); +getopts('hv2xmn:b:W:B:r:t:i:R:T:w:', \%opts); if (defined $opts{'h'}) { print < 0; say "Wps target is ${wps_target} wps." if $wps_target > 0; +say "Multi-workload mode." if $multi_mode; $nop = $opts{'n'}; $nop = calibrate_nop() unless $nop; say "Nop calibration is $nop."; goto VERIFY if defined $balancer; -my %best_bal; +my (%best_bal, %best_bid); my %results; my %scores; my %wscores; @@ -438,13 +464,22 @@ sub add_points } } -foreach my $wrk (@workloads) { +my @saturation_workloads = $multi_mode ? @multi_workloads : @workloads; +my %allwps; +my $widx = 0; + +push @saturation_workloads, '-w ' . join ' -w ', map("$wrk_root/$_", @workloads) + if $multi_mode; + +foreach my $wrk (@saturation_workloads) { my @args = ( "-n $nop"); my ($r, $error, $should_b, $best); my (%wps, %cwps, %mwps); my @sorted; my $range; + $w_direct = $wrk if $multi_mode and $widx == $#saturation_workloads; + $should_b = 1; $should_b = can_balance_workload($wrk) unless defined $w_direct; @@ -459,7 +494,7 @@ foreach my $wrk (@workloads) { GBAL: foreach my $G ('', '-G', '-d', '-G -d') { foreach my $H ('', '-H') { my @xargs; - my ($w, $c, $s); + my ($w, $c, $s, $bwwps); my $bid; if ($bal ne '') { @@ -476,21 +511,67 @@ foreach my $wrk (@workloads) { $wps_target = 0 if $wps_target_param < 0; - ($c, $w, $s) = find_saturation_point($wrk, $r, - 0, - (@args, - @xargs)); + ($c, $w, $s, $bwwps) = + find_saturation_point($wrk, $r, 0, + (@args, @xargs)); if ($wps_target_param < 0) { $wps_target = $s / -$wps_target_param; - ($c, $w, $s) = + ($c, $w, $s, $bwwps) = find_saturation_point($wrk, $r, 0, (@args, @xargs)); } + if ($multi_mode and $w_direct) { + my $widx; + + die unless scalar(@multi_workloads) == + scalar(@{$bwwps}); + die unless scalar(@multi_workloads) == + scalar(keys %allwps); + + # Total of all workload wps from the + # mixed run. + $w = 0; + foreach $widx (0..$#{$bwwps}) { + $w += $bwwps->[$widx]; + } + + # Total of all workload wps from when + # ran individually with the best + # balancer. + my $tot = 0; + foreach my $wrk (@multi_workloads) { + $tot += $allwps{$wrk}->{$best_bid{$wrk}}; + } + + # Normalize mixed sum with sum of + # individual runs. + $w *= 100; + $w /= $tot; + + # Second metric is average of each + # workload wps normalized by their + # individual run performance with the + # best balancer. + $s = 0; + $widx = 0; + foreach my $wrk (@multi_workloads) { + $s += 100 * $bwwps->[$widx] / + $allwps{$wrk}->{$best_bid{$wrk}}; + $widx++; + } + $s /= scalar(@multi_workloads); + + say sprintf('Aggregate (normalized) %.2f%%; fairness %.2f%%', + $w, $s); + } else { + $allwps{$wrk} = \%wps; + } + $wps{$bid} = $w; $cwps{$bid} = $s; @@ -500,7 +581,8 @@ foreach my $wrk (@workloads) { $mwps{$bid} = $w + $s; } - say "$c clients ($w wps, $s wps single client, score=$mwps{$bid})."; + say "$c clients ($w wps, $s wps single client, score=$mwps{$bid})." + unless $multi_mode and $w_direct; last BAL unless $should_b; next BAL if $bal eq ''; @@ -509,19 +591,24 @@ foreach my $wrk (@workloads) { } } + $widx++; + @sorted = sort { $mwps{$b} <=> $mwps{$a} } keys %mwps; - $best = $sorted[0]; + $best_bid{$wrk} = $sorted[0]; @sorted = sort { $b <=> $a } values %mwps; $range = 1 - $sorted[-1] / $sorted[0]; $best_bal{$wrk} = $sorted[0]; - say " Best balancer is '$best' (range=$range)."; + + next if $multi_mode and not $w_direct; + + say " Best balancer is '$best_bid{$wrk}' (range=$range)."; $results{$wrk} = \%mwps; add_points(\%wps, \%scores, \%wscores); - add_points(\%cwps, \%cscores, \%cwscores); add_points(\%mwps, \%mscores, \%mwscores); + add_points(\%cwps, \%cscores, \%cwscores); } sub dump_scoreboard @@ -552,12 +639,12 @@ sub dump_scoreboard return $balancer; } -dump_scoreboard('Total wps', \%scores); -dump_scoreboard('Total weighted wps', \%wscores); -dump_scoreboard('Per client wps', \%cscores); -dump_scoreboard('Per client weighted wps', \%cwscores); -dump_scoreboard('Combined wps', \%mscores); -$balancer = dump_scoreboard('Combined weighted wps', \%mwscores); +dump_scoreboard($multi_mode ? 'Throughput' : 'Total wps', \%scores); +dump_scoreboard('Total weighted wps', \%wscores) unless $multi_mode; +dump_scoreboard($multi_mode ? 'Fairness' : 'Per client wps', \%cscores); +dump_scoreboard('Per client weighted wps', \%cwscores) unless $multi_mode; +$balancer = dump_scoreboard($multi_mode ? 'Combined' : 'Combined wps', \%mscores); +$balancer = dump_scoreboard('Combined weighted wps', \%mwscores) unless $multi_mode; VERIFY: @@ -568,6 +655,11 @@ die unless defined $balancer; say "\nBalancer is '$balancer'."; say "Idleness tolerance is $idle_tolerance_pct%."; +if ($multi_mode) { + $w_direct = '-w ' . join ' -w ', map("$wrk_root/$_", @workloads); + @workloads = ($w_direct); +} + foreach my $wrk (@workloads) { my @args = ( "-n $nop" ); my ($r, $error, $c, $wps, $swps);