Module: kamailio Branch: master Commit: 0e9a0c237ffe5d335b39270d681ce49be18b903f URL: https://github.com/kamailio/kamailio/commit/0e9a0c237ffe5d335b39270d681ce49b...
Author: Stefan Mititelu stefan.mititelu@1and1.ro Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-11-02T13:43:05+01:00
core: mem/pkg - api to get per module use/free stats
---
Modified: mem/pkg.c Modified: mem/pkg.h
---
Diff: https://github.com/kamailio/kamailio/commit/0e9a0c237ffe5d335b39270d681ce49b... Patch: https://github.com/kamailio/kamailio/commit/0e9a0c237ffe5d335b39270d681ce49b...
---
diff --git a/mem/pkg.c b/mem/pkg.c index f754327..a4f0906 100644 --- a/mem/pkg.c +++ b/mem/pkg.c @@ -46,6 +46,8 @@ int pkg_init_api(sr_pkg_api_t *ap) _pkg_root.xavailable = ap->xavailable; _pkg_root.xsums = ap->xsums; _pkg_root.xdestroy = ap->xdestroy; + _pkg_root.xstats = ap->xstats; + _pkg_root.xfstats = ap->xfstats; return 0; }
diff --git a/mem/pkg.h b/mem/pkg.h index dd062bb..82e430a 100644 --- a/mem/pkg.h +++ b/mem/pkg.h @@ -28,11 +28,11 @@ extern sr_pkg_api_t _pkg_root;
#ifdef DBG_SR_MEMORY # define pkg_malloc(s) _pkg_root.xmalloc(_pkg_root.mem_block, (s), _SRC_LOC_, \ - _SRC_FUNCTION_, _SRC_LINE_) + _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_) # define pkg_free(p) _pkg_root.xfree(_pkg_root.mem_block, (p), _SRC_LOC_, \ - _SRC_FUNCTION_, _SRC_LINE_) + _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_) # define pkg_realloc(p, s) _pkg_root.xrealloc(_pkg_root.mem_block, (p), (s), \ - _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_) + _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_) #else # define pkg_malloc(s) _pkg_root.xmalloc(_pkg_root.mem_block, (s)) # define pkg_realloc(p, s) _pkg_root.xrealloc(_pkg_root.mem_block, (p), (s)) @@ -43,6 +43,8 @@ extern sr_pkg_api_t _pkg_root; # define pkg_info(mi) _pkg_root.xinfo(_pkg_root.mem_block, mi) # define pkg_available() _pkg_root.xavailable(_pkg_root.mem_block) # define pkg_sums() _pkg_root.xsums(_pkg_root.mem_block) +# define pkg_mod_get_stats(x) _pkg_root.xstats(_pkg_root.mem_block, x) +# define pkg_mod_free_stats(x) _pkg_root.xfstats(x)
int pkg_init_api(sr_pkg_api_t *ap); int pkg_init_manager(char *name);