Hi,
ÂÂÂ I think I have a pretty good version of the dynamic proc
metrics implemented as they relate to anything with a PID
instance. My tree is here:
https://github.com/ubccr/pcp/tree/dynamic_proc
Âsrc/pmdas/linux_proc/GNUmakefileÂÂÂ |ÂÂÂ 2 +-
Âsrc/pmdas/linux_proc/helpÂÂÂÂÂÂÂÂÂÂ |Â 140 ----------
Âsrc/pmdas/linux_proc/help_text.hÂÂÂ |Â 121 +++++++++
Âsrc/pmdas/linux_proc/pmda.cÂÂÂÂÂÂÂÂ |ÂÂ 13 +-
Âsrc/pmdas/linux_proc/proc_dynamic.c |Â 477
+++++++++++++++++++++++++++++++++++
Âsrc/pmdas/linux_proc/root_procÂÂÂÂÂ |Â 129 +---------
Â6 files changed, 614 insertions(+), 268 deletions(-)
Âcreate mode 100644 src/pmdas/linux_proc/help_text.h
Âcreate mode 100644 src/pmdas/linux_proc/proc_dynamic.c
If this all looks generally ok, I'll submit my hotprocs changes on
top of this. I modeled it on the basic structure of
linux/interrupts.c. A couple things:
1. I ran the existing QA tests (./check -g pmda.proc) and
everything seemed to be OK, except for the ordering of the metrics
in 022 and 943. I don't think this can be fixed since it would
mean some non-dynamic metrics would have to come in the middle.Â
Let me know if there is a way/desire to fix the ordering.
2. I needed to use pmdaTreeRebuildHash while the interrupts code
didn't. Joe pointed out that this is likely due to that fact that
the linux pmda runs as a dso and proc does not. So there may be
some other code that handles the dso case differently. I couldn't
find this documented anywhere.
3. Couldn't find any precedent for handling long form help text
for dynamic pmdas. So I just generated a header file from the
existing help file and used that. Let me know if you want
something different. Attached is the perl script I wrote for that
in case it is generally useful.
4. I left a few commented code sections that will show where
hotprocs will hook in. Will add another root node, and all other
stuff ( help, etc ) will be shared.
If this looks ok, it will probably take another day to update
hotprocs. Let me know if there is anything that looks wrong or
needs to be changed.
Thanks
Martins