Fix the recursive expansion of child cgroups
Fix the recursive expansion of child cgroups

I was investigating how to get the linux_proc pmda to generate cgroup
metrics for child cgroups (in my case to view the cgroups created by
slurm). The source code in cgroup.c in the linux_proc pmda appeared
to support creating metrics for child cgroups, but the pmda was not
producing any of these metrics on my system.

The problem was caused because the full directory path (including the
mount point) is passed to cgroup_scan() when it is called recursively.
The recursively called cgroup_scan() prepends the mount point again to
the path and then fails trying to open the non-existant directory. There
was also a follow-on bug where the cgroupname was not set correctly when
processing a subdirectory.

This change enables the pmda to parse cgroup subdirectories and create
metrics for all the child cgroups.

wuliming/pcp,andyvand/cygpcpfans,aeg-aeg/pcpfans,andyvand/cygpcpfans,adfernandes/pcp,adfernandes/pcp,edwardt/pcp,mbaldessari/pcp,tjanez/pcp,edwardt/pcp,aeg-aeg/pcpfans,edwardt/pcp,adfernandes/pcp,mbaldessari/pcp,mbaldessari/pcp,tjanez/pcp,andyvand/cygpcpfans,wuliming/pcp,adfernandes/pcp,andyvand/cygpcpfans,andyvand/cygpcpfans,mbaldessari/pcp,tjanez/pcp,prasincs/pcp,edwardt/pcp,andyvand/cygpcpfans,tjanez/pcp,adfernandes/pcp,andyvand/cygpcpfans,adfernandes/pcp,edwardt/pcp,prasincs/pcp,tjanez/pcp,aeg-aeg/pcpfans,mbaldessari/pcp,aeg-aeg/pcpfans,prasincs/pcp,aeg-aeg/pcpfans,wuliming/pcp,prasincs/pcp,prasincs/pcp,wuliming/pcp,aeg-aeg/pcpfans,tjanez/pcp,aeg-aeg/pcpfans,tjanez/pcp,prasincs/pcp,andyvand/cygpcpfans,prasincs/pcp,adfernandes/pcp,wuliming/pcp,aeg-aeg/pcpfans,prasincs/pcp,adfernandes/pcp,tjanez/pcp,edwardt/pcp,edwardt/pcp,wuliming/pcp,wuliming/pcp,edwardt/pcp,wuliming/pcp,mbaldessari/pcp