summaryrefslogtreecommitdiffstats
path: root/vpp/api/gmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'vpp/api/gmon.c')
-rw-r--r--vpp/api/gmon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vpp/api/gmon.c b/vpp/api/gmon.c
index 8ab890fceb4..9d37155f005 100644
--- a/vpp/api/gmon.c
+++ b/vpp/api/gmon.c
@@ -165,6 +165,13 @@ gmon_init (vlib_main_t *vm)
api_main_t * am = &api_main;
pid_t *swp = 0;
f64 *v = 0;
+ clib_error_t * error;
+
+ if ((error = vlib_call_init_function(vm, vpe_api_init)))
+ return(error);
+
+ /* Make sure that /global-vm is owned as directed */
+ svm_region_init_chroot_uid_gid (am->root_path, am->api_uid, am->api_gid);
gm->vlib_main = vm;
gm->svmdb_client = svmdb_map_chroot(am->root_path);
@@ -223,7 +230,8 @@ static clib_error_t *gmon_exit (vlib_main_t *vm)
*gm->vpef_pid_ptr = 0;
*gm->input_rate_ptr = 0.0;
*gm->sig_error_rate_ptr = 0.0;
- svmdb_unmap (gm->svmdb_client);
+ svm_region_unmap ((void *) gm->svmdb_client->db_rp);
+ vec_free(gm->svmdb_client);
}
return 0;
}