From 14d9c6179715205fb6ac816d4621dd087f5afbb2 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 27 May 2019 11:43:26 +0530 Subject: stack: Make sure to have unique call-stacks in all cases At the moment new stack doesn't populate frame->root->unique in all cases. This makes it difficult to debug hung frames by examining successive state dumps. Fuse and server xlators populate it whenever they can, but other xlators won't be able to assign 'unique' when they need to create a new frame/stack because they don't know what 'unique' fuse/server xlators already used. What we need is for unique to be correct. If a stack with same unique is present in successive statedumps, that means the same operation is still in progress. This makes 'finding hung frames' part of debugging hung frames easier. fixes bz#1714098 Change-Id: I3e9a8f6b4111e260106c48a2ac3a41ef29361b9e Signed-off-by: Pranith Kumar K --- libglusterfs/src/stack.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c index 82b35772d6e..371f60c4436 100644 --- a/libglusterfs/src/stack.c +++ b/libglusterfs/src/stack.c @@ -17,6 +17,7 @@ create_frame(xlator_t *xl, call_pool_t *pool) { call_stack_t *stack = NULL; call_frame_t *frame = NULL; + static uint64_t unique = 0; if (!xl || !pool) { return NULL; @@ -52,6 +53,7 @@ create_frame(xlator_t *xl, call_pool_t *pool) { list_add(&stack->all_frames, &pool->all_frames); pool->cnt++; + stack->unique = unique++; } UNLOCK(&pool->lock); GF_ATOMIC_INC(pool->total_count); -- cgit