|
|
@@ -29,6 +29,8 @@ |
|
|
#include "indom.h"
|
|
|
#include "proc_partitions.h"
|
|
|
|
|
|
+int _pm_have_kernel_2_6_partition_stats;
|
|
|
+
|
|
|
extern int _pm_numdisks;
|
|
|
|
|
|
/*
|
|
|
@@ -353,6 +355,9 @@ refresh_proc_partitions(pmInDom disk_indom, pmInDom partitions_indom, pmInDom dm |
|
|
&p->wr_ios, &p->wr_merges, &p->wr_sectors, &p->wr_ticks,
|
|
|
&p->ios_in_flight, &p->io_ticks, &p->aveq);
|
|
|
if (n != 14) {
|
|
|
+ /* In 2.6.25, the full statistic set is again available for partitions and
|
|
|
+ disk and partition statistics are consistent again. */
|
|
|
+ _pm_have_kernel_2_6_partition_stats = 1;
|
|
|
p->rd_merges = p->wr_merges = p->wr_ticks =
|
|
|
p->ios_in_flight = p->io_ticks = p->aveq = 0;
|
|
|
/* Linux source: block/genhd.c::diskstats_show(2) */
|
|
|
@@ -445,6 +450,13 @@ static pmID disk_metric_table[] = { |
|
|
/* disk.partitions.read_bytes */ PMDA_PMID(CLUSTER_PARTITIONS,6),
|
|
|
/* disk.partitions.write_bytes */PMDA_PMID(CLUSTER_PARTITIONS,7),
|
|
|
/* disk.partitions.total_bytes */PMDA_PMID(CLUSTER_PARTITIONS,8),
|
|
|
+ /* disk.partitions.read_merge */ PMDA_PMID(CLUSTER_PARTITIONS,9),
|
|
|
+ /* disk.partitions.write_merge */PMDA_PMID(CLUSTER_PARTITIONS,10),
|
|
|
+ /* disk.partitions.avactive */ PMDA_PMID(CLUSTER_PARTITIONS,11),
|
|
|
+ /* disk.partitions.aveq */ PMDA_PMID(CLUSTER_PARTITIONS,12),
|
|
|
+ /* disk.partitions.read_rawactive */ PMDA_PMID(CLUSTER_PARTITIONS,13),
|
|
|
+ /* disk.partitions.write_rawactive */ PMDA_PMID(CLUSTER_PARTITIONS,14),
|
|
|
+
|
|
|
|
|
|
/* hinv.ndisk */ PMDA_PMID(CLUSTER_STAT,33),
|
|
|
|
|
|
@@ -735,6 +747,42 @@ proc_partitions_fetch(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom) |
|
|
atom->ul = (p->rd_sectors +
|
|
|
p->wr_sectors) / 2;
|
|
|
break;
|
|
|
+ case 9: /* disk.partitions.read_merge */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no read_merge for partition in 2.6 */
|
|
|
+ else
|
|
|
+ _pm_assign_ulong(atom, p->rd_merges);
|
|
|
+ break;
|
|
|
+ case 10: /* disk.partitions.write_merge */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no write_merge for partition in 2.6 */
|
|
|
+ else
|
|
|
+ _pm_assign_ulong(atom, p->wr_merges);
|
|
|
+ break;
|
|
|
+ case 11: /* disk.partitions.avactive */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no avactive for partition in 2.6 */
|
|
|
+ else
|
|
|
+ atom->ull = p->io_ticks;
|
|
|
+ break;
|
|
|
+ case 12: /* disk.partitions.aveq */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no aveq for partition in 2.6 */
|
|
|
+ else
|
|
|
+ atom->ull = p->aveq;
|
|
|
+ break;
|
|
|
+ case 13: /* disk.partitions.read_rawactive */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no read_rawactive for partition in 2.6 */
|
|
|
+ else
|
|
|
+ atom->ul = p->rd_ticks;
|
|
|
+ break;
|
|
|
+ case 14: /* disk.partitions.write_rawactive */
|
|
|
+ if (_pm_have_kernel_2_6_partition_stats)
|
|
|
+ return PM_ERR_APPVERSION; /* no write_rawactive for partition in 2.6 */
|
|
|
+ else
|
|
|
+ atom->ul = p->wr_ticks;
|
|
|
+ break;
|
|
|
default:
|
|
|
return PM_ERR_PMID;
|
|
|
}
|
|
|
|