From def09c4fbb2805618715c5a125ddf482d7e53de3 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 25 Jul 2017 18:07:05 +0530 Subject: Infra to indentify process Problem: currently we can't identify which process is running and how many instances of it are available. Fix: name the process when its spawned and send it to the server and save it in the client_t The processes that abide by this change from this patch are: 1) fuse mount, 2) rebalance, 3) selfheal, 4) tier, 5) quota, 6) snapshot, 7) brick. 8) gfapi (by default. gfapi. if processname is found) Note: fuse gets a process name as native-fuse-client by default. If the user gives a name for the fuse and spawns it, it will be of this type --process-name native-fuse-client.. This can be made use by the process like aux mount done by quota, geo-rep, etc by adding another option in the aux mount " -o process-name=gsync_mount" Updates: #178 Signed-off-by: hari gowtham Change-Id: Ie4d02257216839338043737691753bab9a974d5e Reviewed-on: https://review.gluster.org/17957 Smoke: Gluster Build System Tested-by: hari gowtham Reviewed-by: Amar Tumballi CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Aravinda VK Reviewed-by: Niels de Vos --- libglusterfs/src/client_t.c | 1 + libglusterfs/src/client_t.h | 1 + libglusterfs/src/glusterfs.h | 2 ++ 3 files changed, 4 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c index eda1c465827..a51fb7a88c0 100644 --- a/libglusterfs/src/client_t.c +++ b/libglusterfs/src/client_t.c @@ -386,6 +386,7 @@ client_destroy (client_t *client) GF_FREE (client->scratch_ctx.ctx); GF_FREE (client->client_uid); GF_FREE (client->subdir_mount); + GF_FREE (client->client_name); GF_FREE (client); out: return; diff --git a/libglusterfs/src/client_t.h b/libglusterfs/src/client_t.h index 530c0a331ea..dff812b0602 100644 --- a/libglusterfs/src/client_t.h +++ b/libglusterfs/src/client_t.h @@ -33,6 +33,7 @@ typedef struct _client { xlator_t *this; int tbl_index; char *client_uid; + char *client_name; struct { int flavour; size_t len; diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 8dcc4a367d0..8a55d724c6e 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -421,6 +421,8 @@ struct _cmd_args { /* For the subdir mount */ char *subdir_mount; + + char *process_name; }; typedef struct _cmd_args cmd_args_t; -- cgit