Prefix all warnings and error messages with plugin name
[collectd.git] / src / zone.c
index 21a9497..1781775 100644 (file)
@@ -86,7 +86,7 @@ zone_submit_value(char *zone, gauge_t value)
        vl.values_len = 1; /*STATIC_ARRAY_SIZE (values);*/
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "zone", sizeof (vl.plugin));
-       sstrncpy (vl.type, "zone_cpu", sizeof (vl.type));
+       sstrncpy (vl.type, "percent", sizeof (vl.type));
        sstrncpy (vl.type_instance, zone, sizeof (vl.type_instance));
 
        return(plugin_dispatch_values (&vl));
@@ -100,16 +100,16 @@ zone_find_stats(c_avl_tree_t *tree, zoneid_t zoneid)
 
        if (c_avl_get(tree, (void **)&zoneid, (void **)&ret)) {
                if (!(ret = malloc(sizeof(zone_stats_t)))) {
-                       WARNING("no memory");
+                       WARNING("zone plugin: no memory");
                        return(NULL);
                }
                if (!(key = malloc(sizeof(zoneid_t)))) {
-                       WARNING("no memory");
+                       WARNING("zone plugin: no memory");
                        return(NULL);
                }
                *key = zoneid;
                if (c_avl_insert(tree, key, ret)) {
-                       WARNING("error inserting into tree");
+                       WARNING("zone plugin: error inserting into tree");
                        return(NULL);
                }
        }
@@ -144,9 +144,8 @@ zone_scandir(DIR *procdir)
        zone_stats_t *stats;
 /*     size_t    physmem = sysconf(_SC_PHYS_PAGES) * pagesize;*/
 
-       if (!(tree=c_avl_create((int (*)
-                                (const void *, const void *))zone_compare))) {
-               WARNING("Failed to create tree");
+       if (!(tree=c_avl_create((void *) zone_compare))) {
+               WARNING("zone plugin: Failed to create tree");
                return(NULL);
        }
 
@@ -175,7 +174,7 @@ static int zone_read (void)
 
        pagesize = sysconf(_SC_PAGESIZE);
        if ((procdir = opendir("/proc")) == NULL) {
-               ERROR("cannot open /proc directory\n");
+               ERROR("zone plugin: cannot open /proc directory\n");
                exit(1);
        }