<!-- Kamailio Pull Request Template -->
<!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -->
#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #3440
#### Description
implemented a way to dump the names of the variables stored in pv_cache this helped me to find out what was filling the pv_cache
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3448
-- Commit Summary --
* core: pv_cache_dump
-- File Changes --
M src/core/cfg_core.c (4) M src/core/cfg_core.h (1) M src/core/pvapi.c (33) M src/core/pvapi.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3448.patch https://github.com/kamailio/kamailio/pull/3448.diff
Shouldn't the value changed back to 0 on dump callback? To allow setting it back to pid later ...
Uhm... I don't see that in mem_dump_pkg_cb
https://github.com/kamailio/kamailio/blob/6b4e3b4b227381bfe896b23af5c4ce996c...
Probably it is going to require two changes of the value for another dump, I guess the same happens for similar cases.
Likely they were considered like one time use for troubleshooting, so it is fine for me to merge and eventually improve later.
@linuxmaniac pushed 1 commit.
4828969aa17e52e25712708b84660dc684be01da core: pv_cache_dump
Ah, I see. So like this? Change already pushed ``` diff --git a/src/core/pvapi.c b/src/core/pvapi.c index b36c92b2be..c184db28d9 100644 --- a/src/core/pvapi.c +++ b/src/core/pvapi.c @@ -119,6 +119,7 @@ void pv_cache_dump_cb(str *gname, str *name) { if (cfg_get(core, core_cfg, pv_cache_dump) == my_pid()) { pv_cache_dump(cfg_get(core, core_cfg, memlog)); + cfg_get(core, core_cfg, pv_cache_dump) = 0; } } ```
@linuxmaniac pushed 1 commit.
925e9764254dd1cb9f7644c928d9c0762c8c2fab core: pv_cache_dump
@linuxmaniac pushed 1 commit.
efd0c0b160eb19e93e3447981dbb6bdc0b82c38f core: pv_cache_dump
@linuxmaniac pushed 1 commit.
aee1cc1de80291f80ff3f753391eaa8066eb6199 core: pv_cache_dump
@linuxmaniac pushed 1 commit.
b2188e30d3728a7f4bf5aec6359c92183becdc15 core: pv_cache_dump
@linuxmaniac pushed 1 commit.
ed29e2f1d4d600ae4899896668b0cd121064e4e4 core: pv_cache_dump
Fine for me. Thanks.
Merged #3448 into master.