- Fixing sysinfo - devices with length exceeding 15 chars are not displayed in vmstat -d
This commit is contained in:
parent
ee1fd80fc0
commit
47497dd240
@ -951,7 +951,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
||||
int cPartition = 0;
|
||||
int fields;
|
||||
unsigned dummy;
|
||||
char devname[32];
|
||||
char devname[35];
|
||||
|
||||
*disks = NULL;
|
||||
*partitions = NULL;
|
||||
@ -964,10 +964,10 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
||||
fclose(fd);
|
||||
break;
|
||||
}
|
||||
fields = sscanf(buff, " %*d %*d %15s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", devname, &dummy);
|
||||
fields = sscanf(buff, " %*d %*d %34s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", devname, &dummy);
|
||||
if (fields == 2 && is_disk(devname)){
|
||||
(*disks) = xrealloc(*disks, (cDisk+1)*sizeof(struct disk_stat));
|
||||
sscanf(buff, " %*d %*d %15s %u %u %llu %u %u %u %llu %u %u %u %u",
|
||||
sscanf(buff, " %*d %*d %31s %u %u %llu %u %u %u %llu %u %u %u %u",
|
||||
//&disk_major,
|
||||
//&disk_minor,
|
||||
(*disks)[cDisk].disk_name,
|
||||
@ -989,8 +989,8 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
||||
(*partitions) = xrealloc(*partitions, (cPartition+1)*sizeof(struct partition_stat));
|
||||
fflush(stdout);
|
||||
sscanf(buff, (fields == 2)
|
||||
? " %*d %*d %15s %u %*u %llu %*u %u %*u %llu %*u %*u %*u %*u"
|
||||
: " %*d %*d %15s %u %llu %u %llu",
|
||||
? " %*d %*d %34s %u %*u %llu %*u %u %*u %llu %*u %*u %*u %*u"
|
||||
: " %*d %*d %34s %u %llu %u %llu",
|
||||
//&part_major,
|
||||
//&part_minor,
|
||||
(*partitions)[cPartition].partition_name,
|
||||
|
@ -101,7 +101,7 @@ extern void vminfo(void);
|
||||
typedef struct disk_stat{
|
||||
unsigned long long reads_sectors;
|
||||
unsigned long long written_sectors;
|
||||
char disk_name [16];
|
||||
char disk_name [32];
|
||||
unsigned inprogress_IO;
|
||||
unsigned merged_reads;
|
||||
unsigned merged_writes;
|
||||
@ -115,7 +115,7 @@ typedef struct disk_stat{
|
||||
}disk_stat;
|
||||
|
||||
typedef struct partition_stat{
|
||||
char partition_name [16];
|
||||
char partition_name [35];
|
||||
unsigned long long reads_sectors;
|
||||
unsigned parent_disk; // index into a struct disk_stat array
|
||||
unsigned reads;
|
||||
|
Loading…
Reference in New Issue
Block a user