]> arthur.barton.de Git - netdata.git/commitdiff
minor optimizations at diskstats
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 22 Oct 2016 23:31:35 +0000 (02:31 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 22 Oct 2016 23:31:35 +0000 (02:31 +0300)
src/proc_diskstats.c
src/proc_self_mountinfo.c

index 96cece6cbd183f141040a83bb46b2e361491ee8e..85da496a7ddfee403b75d6284aa65a3070e180b1 100644 (file)
@@ -260,13 +260,13 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
 
     // mountinfo_find() can be called with NULL disk_mountinfo_root
     struct mountinfo *mi = mountinfo_find(disk_mountinfo_root, d->major, d->minor);
-    if(unlikely(!mi)) {
+/*    if(unlikely(!mi)) {
         mountinfo_reload(1);
 
         // search again for this disk
         mi = mountinfo_find(disk_mountinfo_root, d->major, d->minor);
     }
-
+*/
     if(mi) {
         d->mount_point = strdupz(mi->mount_point);
         d->mount_point_hash = mi->mount_point_hash;
@@ -770,14 +770,14 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
             }
         }
 
-        /*
+/*
         // --------------------------------------------------------------------------
         // space metrics
 
         if(d->mount_point && (d->do_space || d->do_inodes) ) {
             do_disk_space_stats(d, d->mount_point, disk, disk, family, update_every, dt);
         }
-        */
+*/
     }
 
     // --------------------------------------------------------------------------
@@ -785,10 +785,10 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
 
     struct mountinfo *mi;
     for(mi = disk_mountinfo_root; mi ;mi = mi->next) {
-        if(unlikely(mi->flags & MOUNTINFO_IS_DUMMY || mi->flags & MOUNTINFO_IS_BIND || mi->flags & MOUNTINFO_IS_SAME_DEV || mi->flags & MOUNTINFO_NO_STAT || mi->flags & MOUNTINFO_NO_SIZE))
+        if(unlikely(mi->flags & (MOUNTINFO_IS_DUMMY|MOUNTINFO_IS_BIND|MOUNTINFO_IS_SAME_DEV|MOUNTINFO_NO_STAT|MOUNTINFO_NO_SIZE)))
             continue;
 
-        /*
+/*
         // skip the ones with block devices
         int skip = 0;
         struct disk *d;
@@ -801,9 +801,10 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
 
         if(unlikely(skip))
             continue;
-        */
 
         // fprintf(stderr, "Will process mount point '%s', source '%s', filesystem '%s'\n", mi->mount_point, mi->mount_source, mi->filesystem);
+*/
+
         do_disk_space_stats(NULL, mi->mount_point, mi->mount_source, mi->persistent_id, mi->mount_point , update_every, dt);
     }
 
index 3c3e5af8922d98c8ebcbba4b7445826fa05daaef..22be1aa630a51718bf49b8d5f1aa608afae620e1 100644 (file)
@@ -343,7 +343,7 @@ struct mountinfo *mountinfo_read() {
 */
     }
 
-/*
+/* find if the mount options have "bind" in them
     {
         FILE *fp = setmntent(MOUNTED, "r");
         if (fp != NULL) {