From: Sebastien GODARD Date: Wed, 7 Jun 2017 08:12:42 +0000 (+0200) Subject: sar: Update "sar -d" output contents X-Git-Tag: v11.5.7~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d635e0863163ae5eb0f58fccd1fb88e5d303f19;p=sysstat sar: Update "sar -d" output contents Replace "rd_sec/s" and "wr_sec/s" fields with "rkB/s" and "wkB/s". These fields are now expressed in kilobytes instead of sectors. This also make them consistent with iostat's output. Replace "avgrq-sz" field with "areq-sz". This field is now expressed in kilobytes instead of sectors and make it consistent with iostat's output. Rename "avgqu-sz" field to "aqu-sz" to make it consistent with iostat's output. Notes: 1) All those changes don't break the format of sar's binary data files. The values for rkB/s, wkB/s and areq-sz fields are still saved as a number of sectors. Only the output displayed onto the screen changes. 2) I plan to keep the original field names (in addition to the new ones) in sadf's XML and JSON output to keep backward compatibility. This means you will still get fields named rd_sec, wr_sec and avgrq-sz (expressed in sectors) in XML and JSON output in addition to the new fields rkB, wkB and areq-sz expressed in kB. Field avgqu-sz will still exist too. Signed-off-by: Sebastien GODARD --- diff --git a/activity.c b/activity.c index 12c5c16..dc28642 100644 --- a/activity.c +++ b/activity.c @@ -458,7 +458,7 @@ struct activity disk_act = { .f_print_avg = print_disk_stats, #endif #if defined(SOURCE_SAR) || defined(SOURCE_SADF) - .hdr_line = "DEV;tps;rd_sec/s;wr_sec/s;avgrq-sz;avgqu-sz;await;svctm;%util", + .hdr_line = "DEV;tps;rkB/s;wkB/s;areq-sz;aqu-sz;await;svctm;%util", #endif #ifdef SOURCE_SADF .f_render = render_disk_stats, diff --git a/pr_stats.c b/pr_stats.c index a80f474..50e2830 100644 --- a/pr_stats.c +++ b/pr_stats.c @@ -969,8 +969,8 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr, memset(&sdpzero, 0, STATS_DISK_SIZE); if (DISPLAY_UNIT(flags)) { - /* Default values unit is sectors */ - unit = 0; + /* Default values unit is kB */ + unit = 2; } if (dis) { @@ -1023,11 +1023,11 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr, cprintf_f(-1, 1, 9, 2, S_VALUE(sdp->nr_ios, sdc->nr_ios, itv)); cprintf_f(unit, 2, 9, 2, - S_VALUE(sdp->rd_sect, sdc->rd_sect, itv), - S_VALUE(sdp->wr_sect, sdc->wr_sect, itv)); + S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2, + S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2); cprintf_f(-1, 4, 9, 2, /* See iostat for explanations */ - xds.arqsz, + xds.arqsz / 2, S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0, xds.await, xds.svctm);