~ubuntu-branches/ubuntu/raring/sysstat/raring

« back to all changes in this revision

Viewing changes to iostat.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2011-06-15 07:27:46 UTC
  • mfrom: (1.1.21 upstream) (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110615072746-a9dwjap7jeb2odey
Tags: 10.0.1-1
* New upstream (stable) release.
* Add Danish translation of debconf templates (closes: #621367).
* Standards-Version: 3.9.2 (no changes).
* sysstat.{postinst,postrm}: register the ucf-managed file with ucfr.
* Sort dependency fields with wrap-and-sort command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
                progname);
82
82
#ifdef DEBUG
83
83
        fprintf(stderr, _("Options are:\n"
84
 
                          "[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n"
 
84
                          "[ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n"
85
85
                          "[ <device> [...] | ALL ] [ -p [ <device> [,...] | ALL ] ] [ --debuginfo ]\n"));
86
86
#else
87
87
        fprintf(stderr, _("Options are:\n"
88
 
                          "[ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n"
 
88
                          "[ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ]\n"
89
89
                          "[ <device> [...] | ALL ] [ -p [ <device> [,...] | ALL ] ]\n"));
90
90
#endif
91
91
        exit(1);
827
827
                  (ioi->wr_ticks - ioj->wr_ticks) /
828
828
                  ((double) (ioi->wr_ios - ioj->wr_ios)) : 0.0;
829
829
 
830
 
        /*      DEV   rrq/s wrq/s   r/s   w/s  rsec  wsec  rqsz  qusz await r_await w_await svctm %util */
831
 
        printf("%-13s %8.2f %8.2f %7.2f %7.2f %8.2f %8.2f %8.2f %8.2f %7.2f %7.2f %7.2f %6.2f %6.2f\n",
832
 
               shi->name,
 
830
        /* Print device name */
 
831
        if (DISPLAY_HUMAN_READ(flags)) {
 
832
                printf("%s\n%13s", shi->name, "");
 
833
        }
 
834
        else {
 
835
                printf("%-13s", shi->name);
 
836
        }
 
837
 
 
838
        /*       rrq/s wrq/s   r/s   w/s  rsec  wsec  rqsz  qusz await r_await w_await svctm %util */
 
839
        printf(" %8.2f %8.2f %7.2f %7.2f %8.2f %8.2f %8.2f %8.2f %7.2f %7.2f %7.2f %6.2f %6.2f\n",
833
840
               S_VALUE(ioj->rd_merges, ioi->rd_merges, itv),
834
841
               S_VALUE(ioj->wr_merges, ioi->wr_merges, itv),
835
842
               S_VALUE(ioj->rd_ios, ioi->rd_ios, itv),
866
873
{
867
874
        unsigned long long rd_sec, wr_sec;
868
875
 
869
 
        printf("%-13s", shi->name);
 
876
        /* Print device name */
 
877
        if (DISPLAY_HUMAN_READ(flags)) {
 
878
                printf("%s\n%13s", shi->name, "");
 
879
        }
 
880
        else {
 
881
                printf("%-13s", shi->name);
 
882
        }
870
883
 
871
884
        /* Print stats coming from /sys or /proc/diskstats */
872
885
        rd_sec = ioi->rd_sectors - ioj->rd_sectors;
1193
1206
                                        flags |= I_D_DISK;
1194
1207
                                        report_set = TRUE;
1195
1208
                                        break;
 
1209
                                
 
1210
                                case 'h':
 
1211
                                        /*
 
1212
                                         * Display device utilization report
 
1213
                                         * in a human readable format.
 
1214
                                         */
 
1215
                                        flags |= I_D_HUMAN_READ;
 
1216
                                        break;
1196
1217
 
1197
1218
                                case 'k':
1198
1219
                                        if (DISPLAY_MEGABYTES(flags)) {