summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-02-07 11:02:10 +0530
committerVijay Bellur <vbellur@redhat.com>2014-04-30 23:52:28 -0700
commit630d46d714a233919664c035f2c5c48c028777e8 (patch)
treee7e79b240e23fde447989a4e1adc625b1858d17d /api/src/glfs.c
parentf63fbca7540a4c9ce090e1ed5941ed8777ff6316 (diff)
logging: Introduce suppression of repetitive log messages
Change-Id: I8efa08cc9832ad509fba65a88bb0cddbaf056404 BUG: 1075611 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7475 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r--api/src/glfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 73c46517dad..b69d785a8ab 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -129,6 +129,11 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx)
if (!ctx->dict_data_pool)
goto err;
+ ctx->logbuf_pool = mem_pool_new (log_buf_t,
+ GF_MEMPOOL_COUNT_OF_LRU_BUF_T);
+ if (!ctx->logbuf_pool)
+ goto err;
+
INIT_LIST_HEAD (&pool->all_frames);
INIT_LIST_HEAD (&ctx->cmd_args.xlator_options);
INIT_LIST_HEAD (&ctx->cmd_args.volfile_servers);
@@ -157,6 +162,8 @@ err:
mem_pool_destroy (ctx->dict_data_pool);
if (ctx->dict_pair_pool)
mem_pool_destroy (ctx->dict_pair_pool);
+ if (ctx->logbuf_pool)
+ mem_pool_destroy (ctx->logbuf_pool);
}
return ret;
@@ -590,6 +597,10 @@ glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel)
if (ret)
goto out;
+ ret = gf_log_inject_timer_event (fs->ctx);
+ if (ret)
+ goto out;
+
out:
return ret;
}