summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2013-02-16 22:51:10 +0530
committerVijay Bellur <vbellur@redhat.com>2013-03-03 06:18:59 -0800
commit67ded86802f6f086af9ec6b21837920dba600241 (patch)
tree35ccba5a41a74e7c9cddc5fde96a38c46c3c137a /libglusterfs
parent1ed69b917a7a798b1a468615e9b6163cc2a1ab4f (diff)
Better mechanism to handle memory accounting
Memory accounting will now be enabled if: 1) Any glusterfs process is spawned with argument --mem-accounting. 2) DEBUG is defined. Change-Id: I3345e114127a57ce61916be0e2c4e0049a4c3432 BUG: 834465 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/4527 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/mem-pool.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index 755e739449b..e35a599e679 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -33,22 +33,13 @@
void
gf_mem_acct_enable_set (void *data)
{
- char *opt = NULL;
- long val = -1;
glusterfs_ctx_t *ctx = NULL;
ctx = data;
- if (ctx->mem_acct_enable) {
- return;
- }
+ GF_ASSERT (ctx);
- opt = getenv (GLUSTERFS_ENV_MEM_ACCT_STR);
- if (opt) {
- val = strtol (opt, NULL, 0);
- if (val)
- ctx->mem_acct_enable = 1;
- }
+ ctx->mem_acct_enable = 1;
return;
}