All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems
@ 2017-10-12 13:29 Thierry Reding
  2017-10-12 13:29 ` [PATCH i-g-t 2/7] tools/aubdump: Avoid ISO C90 warning Thierry Reding
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Thierry Reding @ 2017-10-12 13:29 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
 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);
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-10-17 22:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 13:29 [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 2/7] tools/aubdump: Avoid ISO C90 warning Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 3/7] lib: Fix compilation on non-x86 Thierry Reding
2017-10-12 13:44   ` Ville Syrjälä
2017-10-12 13:56     ` [Intel-gfx] " Thierry Reding
2017-10-17 22:05   ` Chris Wilson
2017-10-12 13:29 ` [PATCH i-g-t 4/7] lib/drmtest: Fix typo Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 5/7] lib/drmtest: Support nouveau Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 6/7] lib/drmtest: Support Tegra Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 7/7] lib/drmtest: Allow the test device to be overridden Thierry Reding
2017-10-12 13:38 ` [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Lionel Landwerlin
2017-10-12 13:42 ` Ville Syrjälä
2017-10-12 14:08 ` ✓ Fi.CI.BAT: success for series starting with [1/7] " Patchwork
2017-10-12 19:55 ` ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.