]> granicus.if.org Git - sysstat/commitdiff
Some sadf options have been renamed.
authorSebastien <seb@kluane.home>
Fri, 20 Jul 2012 19:44:43 +0000 (21:44 +0200)
committerSebastien <seb@kluane.home>
Fri, 20 Jul 2012 19:44:43 +0000 (21:44 +0200)
sadf option -T has been renamed into -U, and option -t has been
renamed into -T. This was made compulsory to add a new option -t
consistent with that of sar.

CHANGES
man/sadf.in
sadf.c
sadf.h

diff --git a/CHANGES b/CHANGES
index 034dd1f63ef2ec2530ef1109f9c2a5fe0ba31674..7ff7357f7974888d6dc3ab685cffef40fbe26eea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,8 @@ xxxx/xx/xx: Version 10.1.1 - Sebastien Godard (sysstat <at> orange.fr)
          to determine devices real name.
        * Part of 'sadf -H' output was written to stderr instead of
          stdout. This is now fixed.
+       * Warning: sadf: Option '-T' has been renamed into '-U', and
+         optin '-t' has been renamed into '-T'.
        * [Peter Schiffer]: Various cosmetic changes in manual pages
          and usage messages displayed by sysstat commands.
        * sar and iostat manual pages updated.
index d65ce8488524fc3b3e38d534151426014577c9cf..577f0bb2b82ca7070193fbfcfc739027f2dfbc22 100644 (file)
@@ -2,7 +2,7 @@
 .SH NAME
 sadf \- Display data collected by sar in multiple formats.
 .SH SYNOPSIS
-.B sadf [ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T ] [ -t ] [ -V ] [ -P {
+.B sadf [ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T ] [ -U ] [ -V ] [ -P {
 .I cpu
 .B [,...] | ALL } ] [ -s [
 .I hh:mm:ss
@@ -120,10 +120,10 @@ command to extract records time-tagged at, or following, the time
 specified. The default starting time is 08:00:00.
 Hours must be given in 24-hour format.
 .IP -T
+Display timestamp in local time instead of UTC (Coordinated Universal Time).
+.IP -U
 Display timestamp (UTC - Coordinated Universal Time) in seconds from
 the epoch.
-.IP -t
-Display timestamp in local time instead of UTC (Coordinated Universal Time).
 .IP -V
 Print version number then exit.
 .IP -x
diff --git a/sadf.c b/sadf.c
index 26df8b9fc3b2ce4a34190635a3fde03e56c2a002..4525ad6218bbca5cdc07241eb4994cb1ae80d7e1 100644 (file)
--- a/sadf.c
+++ b/sadf.c
@@ -87,7 +87,7 @@ void usage(char *progname)
                progname);
 
        fprintf(stderr, _("Options are:\n"
-                         "[ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T ] [ -t ] [ -V ]\n"
+                         "[ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T ] [ -U ] [ -V ]\n"
                          "[ -P { <cpu> [,...] | ALL } ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]\n"
                          "[ -- <sar_options> ]\n"));
        exit(1);
@@ -167,11 +167,11 @@ void check_format_options(void)
                flags &= ~S_F_HORIZONTALLY;
        }
        if (!ACCEPT_TRUE_TIME(fmt[f_position]->options)) {
-               /* Remove option -t */
+               /* Remove option -T */
                flags &= ~S_F_TRUE_TIME;
        }
        if (!ACCEPT_SEC_EPOCH(fmt[f_position]->options)) {
-               /* Remove option -T */
+               /* Remove option -U */
                flags &= ~S_F_SEC_EPOCH;
        }
 }
@@ -182,12 +182,12 @@ void check_format_options(void)
  * time, based on current record's "number of seconds since the epoch" saved
  * in file.
  * The resulting timestamp is expressed in UTC or in local time, depending
- * on whether option -t has been used or not.
+ * on whether option -T has been used or not.
  *
  * IN:
  * @curr       Index in array for current sample statistics.
  * @rectime    Structure where timestamp (expressed in local time or in UTC
- *             depending on whether option -t has been used or not) can be
+ *             depending on whether option -T has been used or not) can be
  *             saved for current record.
  * @loctime    Structure where timestamp (expressed in local time) can be
  *             saved for current record.
@@ -206,7 +206,7 @@ void sadf_get_record_timestamp_struct(int curr, struct tm *rectime, struct tm *l
        }
 
        if (!PRINT_TRUE_TIME(flags)) {
-               /* Option -t not used: Display timestamp in UTC */
+               /* Option -T not used: Display timestamp in UTC */
                ltm = gmtime((const time_t *) &record_hdr[curr].ust_time);
        }
 
@@ -218,7 +218,7 @@ void sadf_get_record_timestamp_struct(int curr, struct tm *rectime, struct tm *l
 /*
  ***************************************************************************
  * Set current record's timestamp strings (date and time). This timestamp is
- * expressed in UTC or in local time, depending on whether option -t has
+ * expressed in UTC or in local time, depending on whether option -T has
  * been used or not.
  *
  * IN:
@@ -227,13 +227,13 @@ void sadf_get_record_timestamp_struct(int curr, struct tm *rectime, struct tm *l
  * @cur_time   String where timestamp's time will be saved.
  * @len                Maximum length of timestamp strings.
  * @rectime    Structure with current timestamp (expressed in local time or
- *             in UTC depending on whether option -t has been used or not)
+ *             in UTC depending on whether option -T has been used or not)
  *             that should be broken down in date and time strings.
  *
  * OUT:
  * @cur_date   Timestamp's date string.
  * @cur_time   Timestamp's time string. May contain the number of seconds
- *             since the epoch (01-01-1970) if option -T has been used.
+ *             since the epoch (01-01-1970) if option -U has been used.
  ***************************************************************************
 */
 void set_record_timestamp_string(int curr, char *cur_date, char *cur_time, int len,
@@ -246,7 +246,7 @@ void set_record_timestamp_string(int curr, char *cur_date, char *cur_time, int l
        }
        else {
                /*
-                * If PRINT_TRUE_TIME(flags) is true (ie. option -t has been used) then
+                * If PRINT_TRUE_TIME(flags) is true (ie. option -T has been used) then
                 * cur_time is expressed in local time. Else it is expressed in UTC.
                 */
                strftime(cur_date, len, "%Y-%m-%d", rectime);
@@ -327,7 +327,7 @@ void xprintf(int nr_tab, const char *fmtf, ...)
  * @use_tm_end         Set to TRUE if option -e has been used.
  * @tab                        Number of tabulations to print.
  * @rectime            Structure where timestamp (expressed in local time
- *                     or in UTC depending on whether option -t has been
+ *                     or in UTC depending on whether option -T has been
  *                     used or not) can be saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
  *                     can be saved for current record.
@@ -371,7 +371,7 @@ void write_textual_restarts(int curr, int use_tm_start, int use_tm_end, int tab,
  * @tab                        Number of tabulations to print.
  * @ifd                        Input file descriptor.
  * @rectime            Structure where timestamp (expressed in local time
- *                     or in UTC depending on whether option -t has been
+ *                     or in UTC depending on whether option -T has been
  *                     used or not) can be saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
  *                     can be saved for current record.
@@ -526,7 +526,7 @@ void write_mech_stats(int curr, unsigned long dt, unsigned long long itv,
  * @act_id             Activities to display.
  * @cpu_nr             Number of processors for current activity data file.
  * @rectime            Structure where timestamp (expressed in local time
- *                     or in UTC depending on whether option -t has been
+ *                     or in UTC depending on whether option -T has been
  *                     used or not) can be saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
  *                     can be saved for current record.
@@ -621,7 +621,7 @@ int write_parsable_stats(int curr, int reset, long *cnt, int use_tm_start,
  * @tab                        Number of tabulations to print.
  * @cpu_nr             Number of processors.
  * @rectime            Structure where timestamp (expressed in local time
- *                     or in UTC depending on whether option -t has been
+ *                     or in UTC depending on whether option -T has been
  *                     used or not) can be saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
  *                     can be saved for current record.
@@ -757,7 +757,7 @@ int write_textual_stats(int curr, int use_tm_start, int use_tm_end, int reset,
  * @rtype              Record type (RESTART or COMMENT).
  * @ifd                        Input file descriptor.
  * @rectime            Structure where timestamp (expressed in local time
- *                     or in UTC depending on whether option -t has been
+ *                     or in UTC depending on whether option -T has been
  *                     used or not) can be saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
  *                     can be saved for current record.
@@ -819,7 +819,7 @@ void sadf_print_special(int curr, int use_tm_start, int use_tm_end, int rtype, i
  * @file_actlst        List of (known or unknown) activities in file.
  * @cpu_nr     Number of processors for current activity data file.
  * @rectime    Structure where timestamp (expressed in local time or in UTC
- *             depending on whether option -t has been used or not) can be
+ *             depending on whether option -T has been used or not) can be
  *             saved for current record.
  * @loctime    Structure where timestamp (expressed in local time) can be
  *             saved for current record.
@@ -911,7 +911,7 @@ void rw_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf,
  * @file_magic System activity file magic header.
  * @cpu_nr     Number of processors for current activity data file.
  * @rectime    Structure where timestamp (expressed in local time or in UTC
- *             depending on whether option -t has been used or not) can be
+ *             depending on whether option -T has been used or not) can be
  *             saved for current record.
  * @loctime    Structure where timestamp (expressed in local time) can be
  *             saved for current record.
@@ -1139,7 +1139,7 @@ void textual_display_loop(int ifd, struct file_activity *file_actlst, char *dfil
  * @file_actlst        List of (known or unknown) activities in file.
  * @cpu_nr     Number of processors for current activity data file.
  * @rectime    Structure where timestamp (expressed in local time or in UTC
- *             depending on whether option -t has been used or not) can be
+ *             depending on whether option -T has been used or not) can be
  *             saved for current record.
  * @loctime    Structure where timestamp (expressed in local time) can be
  *             saved for current record.
@@ -1471,11 +1471,11 @@ int main(int argc, char **argv)
                                                format = F_PPC_OUTPUT;
                                                break;
 
-                                       case 't':
+                                       case 'T':
                                                flags |= S_F_TRUE_TIME;
                                                break;
                                        
-                                       case 'T':
+                                       case 'U':
                                                flags |= S_F_SEC_EPOCH;
                                                break;
 
diff --git a/sadf.h b/sadf.h
index 8987ce55f8bdd8439aa0e2beeab562add5a85c60..9c9f20b39369f75ff2716f474fdcb14019536093 100644 (file)
--- a/sadf.h
+++ b/sadf.h
@@ -1,6 +1,6 @@
 /*
  * sadf: System activity data formatter
- * (C) 1999-2011 by Sebastien Godard (sysstat <at> orange.fr)
+ * (C) 1999-2012 by Sebastien Godard (sysstat <at> orange.fr)
  */
 
 #ifndef _SADF_H
@@ -71,7 +71,7 @@
 
 /*
  * Indicate that timestamp can be displayed in local time instead of UTC
- * if option -t has been used.
+ * if option -T has been used.
  */
 #define FO_TRUE_TIME           0x08
 
@@ -83,7 +83,7 @@
 
 /*
  * Indicate that the timestamp can be displayed in seconds since the epoch
- * if option -T has been used.
+ * if option -U has been used.
  */
 #define FO_SEC_EPOCH           0x20