< prev index next >

src/hotspot/os/linux/perfMemory_linux.cpp

Print this page

 612 
 613         // don't follow symbolic links for the file
 614         RESTARTABLE(::lstat(filename, &statbuf), result);
 615         if (result == OS_ERR) {
 616            FREE_C_HEAP_ARRAY(char, filename);
 617            continue;
 618         }
 619 
 620         // skip over files that are not regular files.
 621         if (!S_ISREG(statbuf.st_mode)) {
 622           FREE_C_HEAP_ARRAY(char, filename);
 623           continue;
 624         }
 625 
 626         // compare and save filename with latest creation time
 627         if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) {
 628 
 629           if (statbuf.st_ctime > oldest_ctime) {
 630             char* user = strchr(dentry->d_name, '_') + 1;
 631 
 632             if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
 633             oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
 634 
 635             strcpy(oldest_user, user);
 636             oldest_ctime = statbuf.st_ctime;
 637           }
 638         }
 639 
 640         FREE_C_HEAP_ARRAY(char, filename);
 641       }
 642     }
 643     os::closedir(subdirp);
 644     FREE_C_HEAP_ARRAY(char, usrdir_name);
 645   }
 646   os::closedir(tmpdirp);
 647 
 648   return(oldest_user);
 649 }
 650 
 651 // Determine if the vmid is the parent pid
 652 // for a child in a PID namespace.

 612 
 613         // don't follow symbolic links for the file
 614         RESTARTABLE(::lstat(filename, &statbuf), result);
 615         if (result == OS_ERR) {
 616            FREE_C_HEAP_ARRAY(char, filename);
 617            continue;
 618         }
 619 
 620         // skip over files that are not regular files.
 621         if (!S_ISREG(statbuf.st_mode)) {
 622           FREE_C_HEAP_ARRAY(char, filename);
 623           continue;
 624         }
 625 
 626         // compare and save filename with latest creation time
 627         if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) {
 628 
 629           if (statbuf.st_ctime > oldest_ctime) {
 630             char* user = strchr(dentry->d_name, '_') + 1;
 631 
 632             FREE_C_HEAP_ARRAY(char, oldest_user);
 633             oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
 634 
 635             strcpy(oldest_user, user);
 636             oldest_ctime = statbuf.st_ctime;
 637           }
 638         }
 639 
 640         FREE_C_HEAP_ARRAY(char, filename);
 641       }
 642     }
 643     os::closedir(subdirp);
 644     FREE_C_HEAP_ARRAY(char, usrdir_name);
 645   }
 646   os::closedir(tmpdirp);
 647 
 648   return(oldest_user);
 649 }
 650 
 651 // Determine if the vmid is the parent pid
 652 // for a child in a PID namespace.
< prev index next >