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);
From: Thierry Reding treding@nvidia.com
GCC will warn about ISO C90 forbidding to mix declarations and code. Declare the variable at the beginning of the function to suppress the warning.
Signed-off-by: Thierry Reding treding@nvidia.com --- tools/aubdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/aubdump.c b/tools/aubdump.c index 1aeff5f4532c..6ba3cb66256e 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -407,6 +407,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) uint32_t offset = gtt_size(); struct drm_i915_gem_exec_object2 *obj; struct bo *bo, *batch_bo; + int batch_index; void *data;
/* We can't do this at open time as we're not yet authenticated. */ @@ -460,7 +461,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmap failed\n"); }
- int batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 : + batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 : execbuffer2->buffer_count - 1; batch_bo = get_bo(exec_objects[batch_index].handle); for (uint32_t i = 0; i < execbuffer2->buffer_count; i++) {
From: Thierry Reding treding@nvidia.com
The meson build avoids the failure by excluding the igt_x86.c file from the compilation. autotools being what they are don't support that in an easy way, so just use the preprocessor to avoid the duplicate function definitions.
Since igt_x86.c will now be ignored for non-x86 builds, the meson work- around can be removed.
Signed-off-by: Thierry Reding treding@nvidia.com --- lib/igt_x86.c | 2 ++ lib/igt_x86.h | 2 +- lib/meson.build | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/igt_x86.c b/lib/igt_x86.c index 0f0963ced044..0ed3c6f1d356 100644 --- a/lib/igt_x86.c +++ b/lib/igt_x86.c @@ -93,6 +93,7 @@
#define has_YMM 0x1
+#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void) { unsigned max = __get_cpuid_max(BASIC_CPUID, 0); @@ -172,3 +173,4 @@ char *igt_x86_features_to_string(unsigned features, char *line)
return ret; } +#endif diff --git a/lib/igt_x86.h b/lib/igt_x86.h index d6dcfa108331..27b7f0fd5837 100644 --- a/lib/igt_x86.h +++ b/lib/igt_x86.h @@ -40,7 +40,7 @@ #define AVX 0x80 #define AVX2 0x100
-#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void); char *igt_x86_features_to_string(unsigned features, char *line); #else diff --git a/lib/meson.build b/lib/meson.build index 42919eef52a8..e89d4bdf8278 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -56,6 +56,7 @@ lib_sources = [ 'igt_stats.c', 'igt_sysfs.c', 'igt_vgem.c', + 'igt_x86.c', 'instdone.c', 'intel_batchbuffer.c', 'intel_chipset.c', @@ -88,10 +89,6 @@ lib_sources = [ 'igt_kmod.c', ]
-if ['x86', 'x86_64'].contains(host_machine.cpu_family()) - lib_sources += 'igt_x86.c' -endif - lib_deps = [ cairo, glib,
On Thu, Oct 12, 2017 at 03:29:39PM +0200, Thierry Reding wrote:
From: Thierry Reding treding@nvidia.com
The meson build avoids the failure by excluding the igt_x86.c file from the compilation. autotools being what they are don't support that in an easy way,
There is some kind of build_x86 thing in autotools stuff.
But this looks OK to me as well so Reviewed-by: Ville Syrjälä ville.syrjala@linux.intel.com
so just use the preprocessor to avoid the duplicate function definitions.
Since igt_x86.c will now be ignored for non-x86 builds, the meson work- around can be removed.
Signed-off-by: Thierry Reding treding@nvidia.com
lib/igt_x86.c | 2 ++ lib/igt_x86.h | 2 +- lib/meson.build | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/igt_x86.c b/lib/igt_x86.c index 0f0963ced044..0ed3c6f1d356 100644 --- a/lib/igt_x86.c +++ b/lib/igt_x86.c @@ -93,6 +93,7 @@
#define has_YMM 0x1
+#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void) { unsigned max = __get_cpuid_max(BASIC_CPUID, 0); @@ -172,3 +173,4 @@ char *igt_x86_features_to_string(unsigned features, char *line)
return ret; } +#endif diff --git a/lib/igt_x86.h b/lib/igt_x86.h index d6dcfa108331..27b7f0fd5837 100644 --- a/lib/igt_x86.h +++ b/lib/igt_x86.h @@ -40,7 +40,7 @@ #define AVX 0x80 #define AVX2 0x100
-#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void); char *igt_x86_features_to_string(unsigned features, char *line); #else diff --git a/lib/meson.build b/lib/meson.build index 42919eef52a8..e89d4bdf8278 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -56,6 +56,7 @@ lib_sources = [ 'igt_stats.c', 'igt_sysfs.c', 'igt_vgem.c',
- 'igt_x86.c', 'instdone.c', 'intel_batchbuffer.c', 'intel_chipset.c',
@@ -88,10 +89,6 @@ lib_sources = [ 'igt_kmod.c', ]
-if ['x86', 'x86_64'].contains(host_machine.cpu_family())
- lib_sources += 'igt_x86.c'
-endif
lib_deps = [ cairo, glib, -- 2.14.1
Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Thu, Oct 12, 2017 at 04:44:14PM +0300, Ville Syrjälä wrote:
On Thu, Oct 12, 2017 at 03:29:39PM +0200, Thierry Reding wrote:
From: Thierry Reding treding@nvidia.com
The meson build avoids the failure by excluding the igt_x86.c file from the compilation. autotools being what they are don't support that in an easy way,
There is some kind of build_x86 thing in autotools stuff.
Indeed. I'm not sure it could be used, though, because the sources are listed in Makefile.sources which is also used by the Android build. I don't think it would understand the conditional.
Thierry
Quoting Thierry Reding (2017-10-12 14:29:39)
diff --git a/lib/igt_x86.h b/lib/igt_x86.h index d6dcfa108331..27b7f0fd5837 100644 --- a/lib/igt_x86.h +++ b/lib/igt_x86.h @@ -40,7 +40,7 @@ #define AVX 0x80 #define AVX2 0x100
-#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void); char *igt_x86_features_to_string(unsigned features, char *line);
This by itself is a build regression from 2a74ae550842. Would be nice to get this fixed irrespective of the meson fixes. -Chris
From: Thierry Reding treding@nvidia.com
"other" was misspelled as "otehr". Fix it.
Signed-off-by: Thierry Reding treding@nvidia.com --- lib/drmtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c index 8a07152c701a..24a5ea0f6a0f 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -355,7 +355,7 @@ static const char *chipset_to_str(int chipset) case DRIVER_ANY: return "any"; default: - return "otehr"; + return "other"; } }
From: Thierry Reding treding@nvidia.com
Add a driver definition for nouveau and wire up all the necessary pieces to identify its devices.
Signed-off-by: Thierry Reding treding@nvidia.com --- lib/drmtest.c | 14 ++++++++++++-- lib/drmtest.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c index 24a5ea0f6a0f..f46419ec36cf 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -80,7 +80,7 @@ static int __get_drm_device_name(int fd, char *name) drm_version_t version;
memset(&version, 0, sizeof(version)); - version.name_len = 4; + version.name_len = 8; version.name = name;
if (!drmIoctl(fd, DRM_IOCTL_VERSION, &version)){ @@ -92,7 +92,7 @@ static int __get_drm_device_name(int fd, char *name)
static bool __is_device(int fd, const char *expect) { - char name[5] = ""; + char name[9] = "";
if (__get_drm_device_name(fd, name)) return false; @@ -125,6 +125,11 @@ static bool is_amd_device(int fd) return __is_device(fd, "amdg"); }
+static bool is_nouveau_device(int fd) +{ + return __is_device(fd, "nouveau"); +} + static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; @@ -277,6 +282,9 @@ int __drm_open_driver(int chipset) if (chipset & DRIVER_AMDGPU && is_amd_device(fd)) return fd;
+ if (chipset & DRIVER_NOUVEAU && is_nouveau_device(fd)) + return fd; + /* Only VGEM-specific tests should be run on VGEM */ if (chipset == DRIVER_ANY && !is_vgem_device(fd)) return fd; @@ -352,6 +360,8 @@ static const char *chipset_to_str(int chipset) return "virtio"; case DRIVER_AMDGPU: return "amdgpu"; + case DRIVER_NOUVEAU: + return "nouveau"; case DRIVER_ANY: return "any"; default: diff --git a/lib/drmtest.h b/lib/drmtest.h index a86799d54834..e54e1b6756af 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -43,6 +43,7 @@ #define DRIVER_VGEM (1 << 2) #define DRIVER_VIRTIO (1 << 3) #define DRIVER_AMDGPU (1 << 4) +#define DRIVER_NOUVEAU (1 << 5) /* * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system * with vgem as well as a supported driver, you can end up with a
From: Thierry Reding treding@nvidia.com
Add a driver definition for Tegra and wire up all the necessary pieces to identify its devices.
Signed-off-by: Thierry Reding treding@nvidia.com --- lib/drmtest.c | 10 ++++++++++ lib/drmtest.h | 1 + 2 files changed, 11 insertions(+)
diff --git a/lib/drmtest.c b/lib/drmtest.c index f46419ec36cf..e05f88d4a887 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -130,6 +130,11 @@ static bool is_nouveau_device(int fd) return __is_device(fd, "nouveau"); }
+static bool is_tegra_device(int fd) +{ + return __is_device(fd, "tegra"); +} + static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; @@ -285,6 +290,9 @@ int __drm_open_driver(int chipset) if (chipset & DRIVER_NOUVEAU && is_nouveau_device(fd)) return fd;
+ if (chipset & DRIVER_TEGRA && is_tegra_device(fd)) + return fd; + /* Only VGEM-specific tests should be run on VGEM */ if (chipset == DRIVER_ANY && !is_vgem_device(fd)) return fd; @@ -362,6 +370,8 @@ static const char *chipset_to_str(int chipset) return "amdgpu"; case DRIVER_NOUVEAU: return "nouveau"; + case DRIVER_TEGRA: + return "tegra"; case DRIVER_ANY: return "any"; default: diff --git a/lib/drmtest.h b/lib/drmtest.h index e54e1b6756af..bdb938ffd9ab 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -44,6 +44,7 @@ #define DRIVER_VIRTIO (1 << 3) #define DRIVER_AMDGPU (1 << 4) #define DRIVER_NOUVEAU (1 << 5) +#define DRIVER_TEGRA (1 << 6) /* * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system * with vgem as well as a supported driver, you can end up with a
From: Thierry Reding treding@nvidia.com
On setups where the device to be tested is not the first one, allow users to override it using the IGT_DEVICE environment variable.
Signed-off-by: Thierry Reding treding@nvidia.com --- lib/drmtest.c | 91 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 35 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c index e05f88d4a887..1d814734162c 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -245,6 +245,47 @@ static int modprobe(const char *driver) return igt_kmod_load(driver, ""); }
+static int __drm_open_device(const char *device, int chipset) +{ + int fd; + + fd = open(device, O_RDWR); + if (fd == -1) + return fd; + + if (chipset & DRIVER_INTEL && is_i915_device(fd) && + has_known_intel_chipset(fd)) + return fd; + + if (chipset & DRIVER_VC4 && + is_vc4_device(fd)) + return fd; + + if (chipset & DRIVER_VGEM && + is_vgem_device(fd)) + return fd; + + if (chipset & DRIVER_VIRTIO && + is_virtio_device(fd)) + return fd; + + if (chipset & DRIVER_AMDGPU && is_amd_device(fd)) + return fd; + + if (chipset & DRIVER_NOUVEAU && is_nouveau_device(fd)) + return fd; + + if (chipset & DRIVER_TEGRA && is_tegra_device(fd)) + return fd; + + /* Only VGEM-specific tests should be run on VGEM */ + if (chipset == DRIVER_ANY && !is_vgem_device(fd)) + return fd; + + close(fd); + return -1; +} + /** * __drm_open_driver: * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL @@ -256,48 +297,25 @@ static int modprobe(const char *driver) */ int __drm_open_driver(int chipset) { + char *name = getenv("IGT_DEVICE"); + + if (name) + return __drm_open_device(name, chipset); + if (chipset & DRIVER_VGEM) modprobe("vgem");
for (int i = 0; i < 16; i++) { - char name[80]; - int fd; + int fd, ret;
- sprintf(name, "/dev/dri/card%u", i); - fd = open(name, O_RDWR); - if (fd == -1) - continue; - - if (chipset & DRIVER_INTEL && is_i915_device(fd) && - has_known_intel_chipset(fd)) - return fd; - - if (chipset & DRIVER_VC4 && - is_vc4_device(fd)) - return fd; - - if (chipset & DRIVER_VGEM && - is_vgem_device(fd)) - return fd; - - if (chipset & DRIVER_VIRTIO && - is_virtio_device(fd)) - return fd; - - if (chipset & DRIVER_AMDGPU && is_amd_device(fd)) - return fd; - - if (chipset & DRIVER_NOUVEAU && is_nouveau_device(fd)) - return fd; + ret = asprintf(&name, "/dev/dri/card%u", i); + igt_assert(ret != -1);
- if (chipset & DRIVER_TEGRA && is_tegra_device(fd)) - return fd; + fd = __drm_open_device(name, chipset); + free(name);
- /* Only VGEM-specific tests should be run on VGEM */ - if (chipset == DRIVER_ANY && !is_vgem_device(fd)) + if (fd >= 0) return fd; - - close(fd); }
return -1; @@ -305,9 +323,12 @@ int __drm_open_driver(int chipset)
static int __drm_open_driver_render(int chipset) { - char *name; + char *name = getenv("IGT_DEVICE"); int i, fd;
+ if (name) + return __drm_open_device(name, chipset); + for (i = 128; i < (128 + 16); i++) { int ret;
Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com
Thanks!
On 12/10/17 14:29, Thierry Reding wrote:
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++]);
} else {igt_debug("\tA%u = %"PRIu64"\n", i, deltas[idx++]);
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);
On Thu, Oct 12, 2017 at 03:29:37PM +0200, Thierry Reding wrote:
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.
I periodically fix these but someone keeps sneaking in new ones :( Would be nice if ci actually made sure no new warnings get added..
Based on a quick glance this looks good so Reviewed-by: Ville Syrjälä ville.syrjala@linux.intel.com
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++]);
} else {igt_debug("\tA%u = %"PRIu64"\n", i, deltas[idx++]);
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
dri-devel@lists.freedesktop.org