From: Sebastien Date: Fri, 20 Jul 2012 19:44:43 +0000 (+0200) Subject: Some sadf options have been renamed. X-Git-Tag: v10.1.1~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58beca1602a4f78d99fc1a7a7f08d91fc928f58a;p=sysstat Some sadf options have been renamed. 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. --- diff --git a/CHANGES b/CHANGES index 034dd1f..7ff7357 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,8 @@ xxxx/xx/xx: Version 10.1.1 - Sebastien Godard (sysstat 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. diff --git a/man/sadf.in b/man/sadf.in index d65ce84..577f0bb 100644 --- a/man/sadf.in +++ b/man/sadf.in @@ -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 26df8b9..4525ad6 100644 --- 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 { [,...] | ALL } ] [ -s [ ] ] [ -e [ ] ]\n" "[ -- ]\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 8987ce5..9c9f20b 100644 --- a/sadf.h +++ b/sadf.h @@ -1,6 +1,6 @@ /* * sadf: System activity data formatter - * (C) 1999-2011 by Sebastien Godard (sysstat orange.fr) + * (C) 1999-2012 by Sebastien Godard (sysstat 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