Skip to content

Commit

Permalink
Partial backport of debug macro patch
Browse files Browse the repository at this point in the history
Required-githooks: true

Change-Id: Ifd3f793661ea9f64aa47162a791b17b4987164ba
Signed-off-by: Jeff Olivier <[email protected]>
  • Loading branch information
jolivier23 committed Dec 11, 2024
1 parent f943797 commit b3041bd
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/include/daos_srv/rebuild.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2017-2023 Intel Corporation.
* (C) Copyright 2017-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -34,6 +34,37 @@ typedef enum {
(rb_op) == RB_OP_UPGRADE ? "Upgrade" : \
(rb_op) == RB_OP_NONE ? "None" : \
"Unknown")
/* Common rebuild identifying information for INFO/DEBUG logging:
* rb=<pool_uuid>/<rebuild_ver>/<rebuild_gen>/<opstring>
*/
#define DF_RB "rb=" DF_UUID "/%u/%u/%s"

/* Full rebuild identifying information includes <leader_rank>/<term>
* Instead of this, use DF_RB most of the time (use this for leader change scenarios, etc.)
*/
#define DF_RBF DF_RB " ld=%u/" DF_U64

/* arguments for log rebuild identifier given a struct rebuild_global_pool_tracker * */
#define DP_RB_RGT(rgt) \
DP_UUID((rgt)->rgt_pool_uuid), (rgt)->rgt_rebuild_ver, (rgt)->rgt_rebuild_gen, \
RB_OP_STR((rgt)->rgt_opc)

/* arguments for log rebuild identifier given a struct rebuild_tgt_pool_tracker *rpt */
#define DP_RB_RPT(rpt) \
DP_UUID((rpt)->rt_pool_uuid), (rpt)->rt_rebuild_ver, (rpt)->rt_rebuild_gen, \
RB_OP_STR((rpt)->rt_rebuild_op)
#define DP_RBF_RPT(rpt) DP_RB_RPT(rpt), (rpt)->rt_leader_rank, (rpt)->rt_leader_term

/* arguments for log rebuild identifier given a struct rebuild_scan_in *rsin */
#define DP_RB_RSI(rsi) \
DP_UUID((rsi)->rsi_pool_uuid), (rsi)->rsi_rebuild_ver, (rsi)->rsi_rebuild_gen, \
RB_OP_STR((rsi)->rsi_rebuild_op)
#define DP_RBF_RSI(rsi) DP_RB_RSI(rsi), (rsi)->rsi_master_rank, (rsi)->rsi_leader_term

/* arguments for log rebuild identifier given a struct migrate_query_arg * */
#define DP_RB_MQA(mqa) \
DP_UUID((mqa)->pool_uuid), (mqa)->version, (mqa)->generation, RB_OP_STR((mqa)->rebuild_op)
#define DP_RBF_MQA(mqa) DP_RB_MQA(mqa), (mqa)->leader_rank, (mqa)->leader_term

int ds_rebuild_schedule(struct ds_pool *pool, uint32_t map_ver,
daos_epoch_t stable_eph, uint32_t layout_version,
Expand Down

0 comments on commit b3041bd

Please sign in to comment.