summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/stack.c')
-rw-r--r--libglusterfs/src/stack.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c
index fc8af2ec85c..1531f0da43f 100644
--- a/libglusterfs/src/stack.c
+++ b/libglusterfs/src/stack.c
@@ -8,15 +8,16 @@
cases as published by the Free Software Foundation.
*/
-#include "statedump.h"
-#include "stack.h"
-#include "libglusterfs-messages.h"
+#include "glusterfs/statedump.h"
+#include "glusterfs/stack.h"
+#include "glusterfs/libglusterfs-messages.h"
call_frame_t *
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);
@@ -85,9 +87,12 @@ gf_proc_dump_call_frame(call_frame_t *call_frame, const char *key_buf, ...)
{
char prefix[GF_DUMP_MAX_BUF_LEN];
va_list ap;
- call_frame_t my_frame;
+ call_frame_t my_frame = {
+ 0,
+ };
+
int ret = -1;
- char timestr[256] = {
+ char timestr[GF_TIMESTR_SIZE] = {
0,
};
int len;
@@ -157,7 +162,7 @@ gf_proc_dump_call_stack(call_stack_t *call_stack, const char *key_buf, ...)
va_list ap;
call_frame_t *trav;
int32_t i = 1, cnt = 0;
- char timestr[256] = {
+ char timestr[GF_TIMESTR_SIZE] = {
0,
};
int len;
@@ -324,6 +329,8 @@ gf_proc_dump_call_frame_to_dict(call_frame_t *call_frame, char *prefix,
if (tmp_frame.unwind_to) {
snprintf(key, sizeof(key), "%s.unwind_to", prefix);
ret = dict_set_dynstr(dict, key, gf_strdup(tmp_frame.unwind_to));
+ if (ret)
+ return;
}
return;