Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virt plugin: Add physical cpu reporting #2175

Merged
merged 3 commits into from Feb 15, 2017

Conversation

ffromani
Copy link
Contributor

Add a metric to report physical cpu consumed by the hypervisor,
split per user/system time. This is provided by libvirt since version
0.9.11, and used by oVirt.

We also extend the newly-added 'ExtraStats' option to allow
users to toggle on/off the new metric. Default is off.

Signed-off-by: Francesco Romani fromani@redhat.com

Add a metric to report physical cpu consumed by the hypervisor,
split per user/system time. This is provided by libvirt since version
0.9.11, and used by oVirt.

We also extend the newly-added 'ExtraStats' option to allow
users to toggle on/off the new metric. Default is off.

Signed-off-by: Francesco Romani <fromani@redhat.com>
@rubenk
Copy link
Contributor

rubenk commented Feb 15, 2017

src/virt.c: In function 'parse_ex_stats_flags':
src/virt.c:491:22: error: passing argument 1 of 'strcasecmp' makes pointer from integer without a cast [-Werror]
       if (strcasecmp(exstats[i], ex_stats_table[j].name) == 0) {
                      ^
In file included from ./src/daemon/collectd.h:45:0,
                 from src/virt.c:22:
/usr/include/string.h:534:12: note: expected 'const char *' but argument is of type 'char'
 extern int strcasecmp (const char *__s1, const char *__s2)
            ^
src/virt.c: In function 'lv_config':
src/virt.c:702:42: error: passing argument 1 of 'parse_ex_stats_flags' from incompatible pointer type [-Werror]
       extra_stats = parse_ex_stats_flags(exstats, numexstats);
                                          ^
src/virt.c:487:21: note: expected 'const char *' but argument is of type 'char **'
 static unsigned int parse_ex_stats_flags(const char *exstats, int numexstats) {
                     ^
cc1: all warnings being treated as errors
Makefile:6081: recipe for target 'src/virt_la-virt.lo' failed
make[1]: *** [src/virt_la-virt.lo] Error 1

Previously it failed to compile, even though somehow gcc 6.3.1 liked it.
src/virt.c Outdated
@@ -409,6 +484,21 @@ static void disk_submit(struct lv_block_info *binfo, virDomainPtr dom,
}
}

static unsigned int parse_ex_stats_flags(char **exstats, int numexstats) {
int extra_stats = ex_stats_none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shadows the global extra_stats, which is an unsigned int.

and use a matching type for local one.
@rubenk rubenk merged commit d45a55e into collectd:master Feb 15, 2017
@rubenk
Copy link
Contributor

rubenk commented Feb 15, 2017

Thanks again!

Copy link

@rjkmurray rjkmurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

116 files changed and 29 removed

@rubenk
Copy link
Contributor

rubenk commented Feb 19, 2017

@fromanirh so, what's next? ;)

@ffromani
Copy link
Contributor Author

Hi @rubenk! Next in lines are just fixes, we believe we filled all the gaps we had, so from now on it's polishing. I'll be in touch!
Thanks for your help!

@octo octo added this to the 5.8 milestone Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants