Sunday, July 16, 2017

[389-commits] [389-ds-base] 01/01: Ticket 49310 - remove sds logging in debug builds

This is an automated email from the git hooks/post-receive script.

firstyear pushed a commit to branch master
in repository 389-ds-base.

commit 8f42060fa5c34fcb78f1e0a9a7d62fda030c6258
Author: William Brown <firstyear@redhat.com>
Date: Tue Jul 4 13:33:15 2017 +1000

Ticket 49310 - remove sds logging in debug builds

Bug Description: During a load test we noticed that debug builds
would output a large amount of sds logging. Because this uses
stdout, this locks the print buffer causing a serialisation point.

Fix Description: Macro the SDS logging to -DSDS_DEBUG which is
only required for working on the library.

https://pagure.io/389-ds-base/issue/49310

Author: wibrown

Review by: mreynolds (Thanks!)
---
src/libsds/external/csiphash/csiphash.c | 12 +++---
src/libsds/include/sds.h | 4 +-
src/libsds/sds/bpt/bpt.c | 38 +++++++++---------
src/libsds/sds/bpt/bpt.h | 2 +-
src/libsds/sds/bpt/common.c | 70 ++++++++++++++++-----------------
src/libsds/sds/bpt/map.c | 24 +++++------
src/libsds/sds/bpt/search.c | 20 +++++-----
src/libsds/sds/bpt/set.c | 6 ++-
src/libsds/sds/bpt/verify.c | 2 +-
src/libsds/sds/bpt_cow/bpt_cow.c | 54 +++++++++++++------------
src/libsds/sds/bpt_cow/bpt_cow.h | 2 +-
src/libsds/sds/bpt_cow/delete.c | 6 +--
src/libsds/sds/bpt_cow/insert.c | 12 +++---
src/libsds/sds/bpt_cow/node.c | 24 +++++------
src/libsds/sds/bpt_cow/search.c | 8 ++--
src/libsds/sds/bpt_cow/txn.c | 40 +++++++++----------
src/libsds/sds/bpt_cow/verify.c | 10 +++--
src/libsds/sds/core/utils.c | 43 +++++++++++---------
src/libsds/sds/ht/ht.c | 8 ++--
src/libsds/sds/ht/map.c | 8 ++--
src/libsds/sds/ht/node.c | 10 ++---
src/libsds/sds/ht/op.c | 62 ++++++++++++++---------------
src/libsds/sds/ht/verify.c | 22 +++++++++--
src/libsds/sds/queue/lqueue.c | 12 +++---
src/libsds/sds/queue/queue.c | 22 +++++------
src/libsds/sds/queue/tqueue.c | 4 +-
src/libsds/sds/sds_internal.h | 2 +
src/libsds/test/benchmark_parwrap.c | 2 +-
src/libsds/test/test_fixtures.c | 4 +-
src/libsds/test/test_sds_bpt.c | 46 ++++++++++++++++++++--
src/libsds/test/test_sds_cow.c | 2 +-
31 files changed, 325 insertions(+), 256 deletions(-)

diff --git a/src/libsds/external/csiphash/csiphash.c b/src/libsds/external/csiphash/csiphash.c
index d7a3c94..345b69b 100644
--- a/src/libsds/external/csiphash/csiphash.c
+++ b/src/libsds/external/csiphash/csiphash.c
@@ -97,13 +97,13 @@ uint64_t sds_siphash13(const void *src, size_t src_sz, const char key[16]) {
uint8_t *m = (uint8_t *)in;

switch (src_sz) {
- case 7: pt[6] = m[6];
- case 6: pt[5] = m[5];
- case 5: pt[4] = m[4];
+ case 7: pt[6] = m[6]; /* FALLTHRU */
+ case 6: pt[5] = m[5]; /* FALLTHRU */
+ case 5: pt[4] = m[4]; /* FALLTHRU */
case 4: *((uint32_t*)&pt[0]) = *((uint32_t*)&m[0]); break;
- case 3: pt[2] = m[2];
- case 2: pt[1] = m[1];
- case 1: pt[0] = m[0];
+ case 3: pt[2] = m[2]; /* FALLTHRU */
+ case 2: pt[1] = m[1]; /* FALLTHRU */
+ case 1: pt[0] = m[0]; /* FALLTHRU */
}
b |= _le64toh(t);

diff --git a/src/libsds/include/sds.h b/src/libsds/include/sds.h
index c3bae8d..d5fb876 100644
--- a/src/libsds/include/sds.h
+++ b/src/libsds/include/sds.h
@@ -426,7 +426,7 @@ typedef struct _sds_bptree_transaction {
* and leaves of the structure.
*/
typedef struct _sds_bptree_node {
-#ifdef DEBUG
+#ifdef SDS_DEBUG
/**
* checksum of the structure data to detect errors. Must be the first element
* in the struct.
@@ -1367,7 +1367,7 @@ typedef struct _sds_ht_node {
uint32_t checksum;
uint64_t txn_id;
uint_fast32_t count;
-#ifdef DEBUG
+#ifdef SDS_DEBUG
uint64_t depth;

No comments:

Post a Comment