From: Andre Muezerie <andremue@linux.microsoft.com>
To: andremue@linux.microsoft.com
Cc: bruce.richardson@intel.com, dev@dpdk.org,
sameh.gobriel@intel.com, vladimir.medvedkin@intel.com,
yipeng1.wang@intel.com
Subject: [PATCH v4 3/3] hash_readwrite_autotest: fix printf parameters
Date: Thu, 13 Mar 2025 09:51:46 -0700 [thread overview]
Message-ID: <1741884706-21546-4-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1741884706-21546-1-git-send-email-andremue@linux.microsoft.com>
Compiling with MSVC logs the warnings below, which result in
build error:
../app/test/test_hash_readwrite.c(73): warning C4476: 'printf' :
unknown type field character ''' in format specifier
../app/test/test_hash_readwrite.c(75): warning C4474: 'printf' :
too many arguments passed for format string
../app/test/test_hash_readwrite.c(75): note: placeholders and
their parameters expect 2 variadic arguments, but 4 were provided
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
app/test/test_hash_readwrite.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index 1867376ade..82fe03cc5a 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -25,6 +25,8 @@
#define NUM_TEST 3
unsigned int core_cnt[NUM_TEST] = {2, 4, 8};
+#define OFFSET_STR_LEN 16
+
unsigned int worker_core_ids[RTE_MAX_LCORE];
struct perf {
uint32_t single_read;
@@ -57,10 +59,14 @@ static RTE_ATOMIC(uint64_t) gwrites;
static int
test_hash_readwrite_worker(__rte_unused void *arg)
{
+ char offset_start[OFFSET_STR_LEN];
+ char offset_end[OFFSET_STR_LEN];
uint64_t i, offset;
uint32_t lcore_id = rte_lcore_id();
uint64_t begin, cycles;
int *ret;
+ const bool use_iec = true;
+ const char *unit = NULL;
ret = rte_malloc(NULL, sizeof(int) *
tbl_rw_test_param.num_insert, 0);
@@ -70,9 +76,13 @@ test_hash_readwrite_worker(__rte_unused void *arg)
}
offset = tbl_rw_test_param.num_insert * i;
- printf("Core #%d inserting and reading %d: %'"PRId64" - %'"PRId64"\n",
+ rte_size_to_str(offset_start, RTE_DIM(offset_start), offset, use_iec, unit);
+ rte_size_to_str(offset_end, RTE_DIM(offset_end),
+ offset + tbl_rw_test_param.num_insert - 1, use_iec, unit);
+
+ printf("Core #%u inserting and reading %u: %s - %s\n",
lcore_id, tbl_rw_test_param.num_insert,
- offset, offset + tbl_rw_test_param.num_insert - 1);
+ offset_start, offset_end);
begin = rte_rdtsc_precise();
--
2.48.1.vfs.0.1
next prev parent reply other threads:[~2025-03-13 16:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 20:03 [PATCH] hash_readwrite_autotest: fix printf parameters Andre Muezerie
2025-03-07 9:01 ` Bruce Richardson
2025-03-07 22:34 ` Andre Muezerie
2025-03-10 10:51 ` Bruce Richardson
2025-03-10 15:36 ` Stephen Hemminger
2025-03-11 14:39 ` Andre Muezerie
2025-03-11 15:01 ` Morten Brørup
2025-03-11 15:33 ` [PATCH v2 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-11 15:33 ` [PATCH v2 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-11 15:33 ` [PATCH v2 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-03-11 15:49 ` [PATCH v2 1/3] eal: add function rte_size_to_str Stephen Hemminger
2025-03-11 15:51 ` Bruce Richardson
2025-03-11 16:21 ` Morten Brørup
2025-03-12 19:28 ` [PATCH v3 0/3] fix how large numbers are printed by hash tests Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-13 9:09 ` Bruce Richardson
2025-03-13 10:07 ` Morten Brørup
2025-03-13 10:35 ` Bruce Richardson
2025-03-14 11:56 ` Mattias Rönnblom
2025-03-13 10:41 ` Bruce Richardson
2025-03-13 14:06 ` Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-03-13 16:51 ` [PATCH v4 0/3] fix how large numbers are printed by hash tests Andre Muezerie
2025-03-13 16:51 ` [PATCH v4 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-13 16:59 ` Morten Brørup
2025-03-13 16:51 ` [PATCH v4 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-13 16:51 ` Andre Muezerie [this message]
2025-03-13 17:33 ` [PATCH v4 0/3] fix how large numbers are printed by hash tests Bruce Richardson
2025-04-09 1:20 ` [PATCH v5 " Andre Muezerie
2025-04-09 1:20 ` [PATCH v5 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-04-09 1:20 ` [PATCH v5 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-04-09 1:20 ` [PATCH v5 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-04-10 11:34 ` [PATCH v5 0/3] fix how large numbers are printed by hash tests David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1741884706-21546-4-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=sameh.gobriel@intel.com \
--cc=vladimir.medvedkin@intel.com \
--cc=yipeng1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.