From ee151845bb4b3e735676bef9607a3774a7c0995d Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Mon, 13 Jan 2020 16:23:56 +0000 Subject: [PATCH 06/32] Fix several printf format specifiers There are several format specifiers that are incorrect, use %zu for size_t values and %lx for u64 values. Signed-off-by: Colin Ian King --- common/os/pfwrapper.c | 10 +++++----- common/os/sym.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/os/pfwrapper.c b/common/os/pfwrapper.c index d6102be..943820e 100644 --- a/common/os/pfwrapper.c +++ b/common/os/pfwrapper.c @@ -166,7 +166,7 @@ pf_profiling_setup(struct _perf_cpu *cpu, int idx, pf_conf_t *conf) PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING; attr.size = sizeof(attr); - debug_print(NULL, 2, "pf_profiling_setup: attr.type = 0x%lx, " + debug_print(NULL, 2, "pf_profiling_setup: attr.type = 0x%x, " "attr.config = 0x%lx, attr.config1 = 0x%lx\n", attr.type, attr.config, attr.config1); @@ -773,14 +773,14 @@ pf_uncoreqpi_setup(struct _node *node) if ((qpi->qpi_info[i].fd = pf_event_open(&attr, -1, node->cpus[0].cpuid, -1, 0)) < 0) { debug_print(NULL, 2, "pf_uncoreqpi_setup: pf_event_open is failed " - "for node %d, qpi %d, cpu %d, type %d, config 0x%x\n", + "for node %d, qpi %d, cpu %d, type %d, config 0x%lx\n", node->nid, i, node->cpus[0].cpuid, attr.type, attr.config); qpi->qpi_info[i].fd = INVALID_FD; return (-1); } debug_print(NULL, 2, "pf_uncoreqpi_setup: pf_event_open is successful " - "for node %d, qpi %d, cpu %d, type %d, config 0x%x, fd %d\n", + "for node %d, qpi %d, cpu %d, type %d, config 0x%lx, fd %d\n", node->nid, i, node->cpus[0].cpuid, attr.type, attr.config, qpi->qpi_info[i].fd); } @@ -897,14 +897,14 @@ pf_uncoreimc_setup(struct _node *node) if ((imc->imc_info[i].fd = pf_event_open(&attr, -1, node->cpus[0].cpuid, -1, 0)) < 0) { debug_print(NULL, 2, "pf_uncoreimc_setup: pf_event_open is failed " - "for node %d, imc %d, cpu %d, type %d, config 0x%x\n", + "for node %d, imc %d, cpu %d, type %d, config 0x%lx\n", node->nid, i, node->cpus[0].cpuid, attr.type, attr.config); imc->imc_info[i].fd = INVALID_FD; return (-1); } debug_print(NULL, 2, "pf_uncoreimc_setup: pf_event_open is successful " - "for node %d, imc %d, cpu %d, type %d, config 0x%x, fd %d\n", + "for node %d, imc %d, cpu %d, type %d, config 0x%lx, fd %d\n", node->nid, i, node->cpus[0].cpuid, attr.type, attr.config, imc->imc_info[i].fd); } diff --git a/common/os/sym.c b/common/os/sym.c index 9ead1fb..949ce7a 100644 --- a/common/os/sym.c +++ b/common/os/sym.c @@ -384,7 +384,7 @@ elf32_binary_read(sym_binary_t *binary, sym_type_t sym_type) } if (ehdr.e_shentsize != sizeof (Elf32_Shdr)) { - debug_print(NULL, 2, "elf32_binary_read: ehdr.e_shentsize != %d\n", + debug_print(NULL, 2, "elf32_binary_read: ehdr.e_shentsize != %zu\n", sizeof (Elf32_Shdr)); return (-1); } @@ -481,7 +481,7 @@ elf64_binary_read(sym_binary_t *binary, unsigned int sym_type) } if (ehdr.e_shentsize != sizeof (Elf64_Shdr)) { - debug_print(NULL, 2, "elf64_binary_read: ehdr.e_shentsize != %d\n", + debug_print(NULL, 2, "elf64_binary_read: ehdr.e_shentsize != %zu\n", sizeof (Elf64_Shdr)); return (-1); } -- 2.41.0