From: Lee Daly <lee.daly@intel.com>
To: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com
Cc: dev@dpdk.org, Lee Daly <lee.daly@intel.com>
Subject: [dpdk-dev] [PATCH] test/compress: improve debug trace setup
Date: Mon, 19 Nov 2018 13:52:53 +0000 [thread overview]
Message-ID: <1542635573-85083-1-git-send-email-lee.daly@intel.com> (raw)
This removes the magic number from the assignment of the engine variable,
which is used in the debug trace.
Signed-off-by: Lee Daly <lee.daly@intel.com>
---
test/test/test_compressdev.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index b9748ce..a53e946 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -881,11 +881,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
&compress_xforms[xform_idx]->compress;
enum rte_comp_huffman huffman_type =
compress_xform->deflate.huffman;
- char engine[22];
- if (zlib_dir == ZLIB_COMPRESS || zlib_dir == ZLIB_ALL)
- strlcpy(engine, "zlib (direct, no pmd)", 22);
- else
- strlcpy(engine, "pmd", 22);
+ char engine[] = "zlib (directly, not PMD)";
+ if (zlib_dir != ZLIB_COMPRESS || zlib_dir != ZLIB_ALL)
+ strlcpy(engine, "PMD", sizeof(engine));
RTE_LOG(DEBUG, USER1, "Buffer %u compressed by %s from %u to"
" %u bytes (level = %d, huffman = %s)\n",
@@ -1092,11 +1090,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)(ops_processed[i] + 1);
- char engine[22];
- if (zlib_dir == ZLIB_DECOMPRESS || zlib_dir == ZLIB_ALL)
- strlcpy(engine, "zlib (direct, no pmd)", 22);
- else
- strlcpy(engine, "pmd", 22);
+ char engine[] = "zlib, (directly, no PMD)";
+ if (zlib_dir != ZLIB_DECOMPRESS || zlib_dir != ZLIB_ALL)
+ strlcpy(engine, "pmd", sizeof(engine));
RTE_LOG(DEBUG, USER1,
"Buffer %u decompressed by %s from %u to %u bytes\n",
buf_idx[priv_data->orig_idx], engine,
--
2.7.4
next reply other threads:[~2018-11-19 13:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 13:52 Lee Daly [this message]
2018-11-27 13:24 ` Jozwiak, TomaszX
2018-12-18 10:19 ` Akhil Goyal
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=1542635573-85083-1-git-send-email-lee.daly@intel.com \
--to=lee.daly@intel.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=tomaszx.jozwiak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).