From patchwork Wed Oct 4 11:19:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 9984263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A15C60365 for ; Wed, 4 Oct 2017 11:20:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF7428173 for ; Wed, 4 Oct 2017 11:20:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80901288BF; Wed, 4 Oct 2017 11:20: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=-4.2 required=2.0 tests=BAYES_00, 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 40C6128AA7 for ; Wed, 4 Oct 2017 11:20:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC0636E68F; Wed, 4 Oct 2017 11:19:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 605456E688 for ; Wed, 4 Oct 2017 11:19:58 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2017 04:19:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,477,1500966000"; d="scan'208";a="135066817" Received: from delly.ld.intel.com ([10.103.239.215]) by orsmga004.jf.intel.com with ESMTP; 04 Oct 2017 04:19:57 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Wed, 4 Oct 2017 12:19:38 +0100 Message-Id: <20171004111947.12639-4-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171004111947.12639-1-lionel.g.landwerlin@intel.com> References: <20171004111947.12639-1-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH i-g-t v6 03/12] tests/perf: update max buffer size for reading reports X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Make it clear that we're using a 16Mb buffer. Signed-off-by: Lionel Landwerlin Reviewed-by: Matthew Auld --- tests/perf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index 8644e252..bd139bde 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -1298,9 +1298,7 @@ read_2_oa_reports(int format_id, /* Note: we allocate a large buffer so that each read() iteration * should scrape *all* pending records. * - * The largest buffer the OA unit supports is 16MB and the smallest - * OA report format is 64bytes allowing up to 262144 reports to - * be buffered. + * The largest buffer the OA unit supports is 16MB. * * Being sure we are fetching all buffered reports allows us to * potentially throw away / skip all reports whenever we see @@ -1313,7 +1311,8 @@ read_2_oa_reports(int format_id, * to indicate that the OA unit may be over taxed if lots of reports * are being lost. */ - int buf_size = 262144 * (64 + sizeof(struct drm_i915_perf_record_header)); + int max_reports = (16 * 1024 * 1024) / format_size; + int buf_size = sample_size * max_reports * 1.5; uint8_t *buf = malloc(buf_size); int n = 0; @@ -1325,6 +1324,7 @@ read_2_oa_reports(int format_id, ; igt_assert(len > 0); + igt_debug("read %d bytes\n", (int)len); for (size_t offset = 0; offset < len; offset += header->size) { const uint32_t *report;