From patchwork Thu Oct 12 13:29:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10001983 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 52A556028A for ; Thu, 12 Oct 2017 13:29:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43D6528DD6 for ; Thu, 12 Oct 2017 13:29:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38DAD28DD9; Thu, 12 Oct 2017 13:29: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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable 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 DDFBF28DD6 for ; Thu, 12 Oct 2017 13:29:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DED66E83E; Thu, 12 Oct 2017 13:29:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1525F6E839; Thu, 12 Oct 2017 13:29:47 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id m189so1203807qke.4; Thu, 12 Oct 2017 06:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=v7EalncPbKkqYmOhgCqFXVg0SNLq/ZEbORuncv+LoN0=; b=MCURLVB+mO1YdKi5K7UPuPJTNtxy/nsOODc3ferj4W33X6zB78Ov9goQG0HZcN9YY3 goWQiSWAUIBazvKcvfM3w+Z4LWbuJSBsr6z1Lnru/bpElVso8I5hHV9UP3y516x9Tvvs miwOJl2AqiKq+YgTHL+N5ouqBKVZvGKAzXDw63gxyHdG1s9F8OPhb4kFX9UfI+s/rz3J U2G64iJY4fQyoO4xZol7ZgortRQIqJPKals4kgtIYKgZACyKGG6OsNsbuu5Bnv71Gt3y et9Oxa926DTkBnvuXv1d2FswJFzwKP7vtAcnCFtwWuveNmffHH022oau2D51Y/WZ1sEc N3Kw== 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=v7EalncPbKkqYmOhgCqFXVg0SNLq/ZEbORuncv+LoN0=; b=Us71otg6lSsPmiCaYe6HJWiWelf5HG/DnrKn4oDStQsbWxR3YxjXny+ydOLY5MlikH oqYhI6uUcdq3VBmIZIL7WLOB9cV0Rnxoojt6vY7ts83kYi12y6oggXa9/2w+xqD6NaQ9 ttsctSUZb391V8+SI7t1z/8n1AxjJeUqFfntF5X/LsQicdI5KQE1MxADOINkpCAkCFxt Y5y9ftH4WBtlCjcj407oZ6EogAvzSZVQO7pE/dATvlM8qvIK+QjeM16lPYqGI1sKnLfG 77SHkZhjjK71UOx5wnWwoxq7bnC/gql+1bhHO/mf1sXGGun/ujQEXK4EG+5WHDT/hLaV 4KHg== X-Gm-Message-State: AMCzsaXMCj2O3/0TTfPxJzL5359uVmIN71s0pmlL5BdMLAEXWUfGC2Wq ux33VOe8POoJXQQ+nTRAYktaOA== X-Google-Smtp-Source: AOwi7QCwCLiK560VIdjU0sjcaEEz2MJsI5cXjLqzNNsWYpr8Ki4zBp9v9o0MIV1SRyONc/L4fSpXAg== X-Received: by 10.55.214.156 with SMTP id p28mr452753qkl.199.1507814985994; Thu, 12 Oct 2017 06:29:45 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id t24sm3995635qkt.29.2017.10.12.06.29.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 06:29:45 -0700 (PDT) From: Thierry Reding To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2017 15:29:37 +0200 Message-Id: <20171012132943.28316-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems 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 From: Thierry Reding Data types are defined differently on 32-bit systems, causing gcc to complain about printf format specifiers not matching the size of the variables passed in. Use PRIu64 and %zu where appropriate. Signed-off-by: Thierry Reding Reviewed-by: Lionel Landwerlin Reviewed-by: Ville Syrjälä --- tests/perf.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index ad62319e1bbc..a161c45d7009 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -932,25 +932,25 @@ accumulator_print(struct accumulator *accumulator, const char *title) igt_debug("%s:\n", title); if (intel_gen(devid) >= 8) { - igt_debug("\ttime delta = %lu\n", deltas[idx++]); - igt_debug("\tclock cycle delta = %lu\n", deltas[idx++]); + igt_debug("\ttime delta = %"PRIu64"\n", deltas[idx++]); + igt_debug("\tclock cycle delta = %"PRIu64"\n", deltas[idx++]); for (int i = 0; i < format.n_a40; i++) - igt_debug("\tA%u = %lu\n", i, deltas[idx++]); + igt_debug("\tA%u = %"PRIu64"\n", i, deltas[idx++]); } else { - igt_debug("\ttime delta = %lu\n", deltas[idx++]); + igt_debug("\ttime delta = %"PRIu64"\n", deltas[idx++]); } for (int i = 0; i < format.n_a; i++) { int a_id = format.first_a + i; - igt_debug("\tA%u = %lu\n", a_id, deltas[idx++]); + igt_debug("\tA%u = %"PRIu64"\n", a_id, deltas[idx++]); } for (int i = 0; i < format.n_a; i++) - igt_debug("\tB%u = %lu\n", i, deltas[idx++]); + igt_debug("\tB%u = %"PRIu64"\n", i, deltas[idx++]); for (int i = 0; i < format.n_c; i++) - igt_debug("\tC%u = %lu\n", i, deltas[idx++]); + igt_debug("\tC%u = %"PRIu64"\n", i, deltas[idx++]); } /* The TestOa metric set is designed so */ @@ -2126,7 +2126,7 @@ test_oa_exponents(void) } igt_debug(" > report ts=%u" - " ts_delta_last=%8u ts_delta_last_periodic=%8u is_timer=%i ctx_id=%8x gpu_ticks=%u period=%.2f A0=%lu A%i=%lu\n", + " ts_delta_last=%8u ts_delta_last_periodic=%8u is_timer=%i ctx_id=%8x gpu_ticks=%u period=%.2f A0=%"PRIu64" A%i=%"PRIu64"\n", rpt[1], (last != NULL) ? (rpt[1] - last[1]) : 0, (last_periodic != NULL) ? (rpt[1] - last_periodic[1]) : 0, @@ -2796,7 +2796,7 @@ test_buffer_fill(void) do_ioctl(stream_fd, I915_PERF_IOCTL_DISABLE, 0); - igt_debug("fill_duration = %luns, oa_exponent = %u\n", + igt_debug("fill_duration = %"PRIu64"ns, oa_exponent = %u\n", fill_duration, oa_exponent); do_ioctl(stream_fd, I915_PERF_IOCTL_ENABLE, 0); @@ -2813,7 +2813,7 @@ test_buffer_fill(void) */ while (((last_timestamp - first_timestamp) * oa_period) < (fill_duration / 2)) { - igt_debug("dts=%u elapsed=%lu duration=%lu\n", + igt_debug("dts=%u elapsed=%"PRIu64" duration=%"PRIu64"\n", last_timestamp - first_timestamp, (last_timestamp - first_timestamp) * oa_period, fill_duration / 2); @@ -2881,7 +2881,7 @@ test_buffer_fill(void) do_ioctl(stream_fd, I915_PERF_IOCTL_DISABLE, 0); - igt_debug("%f < %lu < %f\n", + igt_debug("%f < %zu < %f\n", report_size * n_full_oa_reports * 0.45, n_periodic_reports * report_size, report_size * n_full_oa_reports * 0.55); @@ -3032,7 +3032,7 @@ test_enable_disable(void) do_ioctl(stream_fd, I915_PERF_IOCTL_DISABLE, 0); - igt_debug("%f < %lu < %f\n", + igt_debug("%f < %zu < %f\n", report_size * n_full_oa_reports * 0.45, n_periodic_reports * report_size, report_size * n_full_oa_reports * 0.55); @@ -3783,7 +3783,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void) memset(accumulator.deltas, 0, sizeof(accumulator.deltas)); accumulate_reports(&accumulator, report0_32, report1_32); - igt_debug("total: A0 = %lu, A21 = %lu, A26 = %lu\n", + igt_debug("total: A0 = %"PRIu64", A21 = %"PRIu64", A26 = %"PRIu64"\n", accumulator.deltas[2 + 0], /* skip timestamp + clock cycles */ accumulator.deltas[2 + 21], accumulator.deltas[2 + 26]); @@ -3905,7 +3905,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void) if (lprev) { memset(laccumulator.deltas, 0, sizeof(laccumulator.deltas)); accumulate_reports(&laccumulator, lprev, report); - igt_debug(" deltas: A0=%lu A21=%lu, A26=%lu\n", + igt_debug(" deltas: A0=%"PRIu64" A21=%"PRIu64", A26=%"PRIu64"\n", laccumulator.deltas[2 + 0], /* skip timestamp + clock cycles */ laccumulator.deltas[2 + 21], laccumulator.deltas[2 + 26]); @@ -3946,7 +3946,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void) if (!skip_reason) { accumulate_reports(&accumulator, prev, report); - igt_debug(" -> Accumulated deltas A0=%lu A21=%lu, A26=%lu\n", + igt_debug(" -> Accumulated deltas A0=%"PRIu64" A21=%"PRIu64", A26=%"PRIu64"\n", accumulator.deltas[2 + 0], /* skip timestamp + clock cycles */ accumulator.deltas[2 + 21], accumulator.deltas[2 + 26]); @@ -3974,7 +3974,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void) } } - igt_debug("n samples written = %ld/%lu (%ix%i)\n", + igt_debug("n samples written = %"PRIu64"/%"PRIu64" (%ix%i)\n", accumulator.deltas[2 + 21],/* skip timestamp + clock cycles */ accumulator.deltas[2 + 26], width, height);