]> granicus.if.org Git - sysstat/commitdiff
sadf: Don't set timestamps twice
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 16 Jan 2016 13:29:37 +0000 (14:29 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 16 Jan 2016 13:29:37 +0000 (14:29 +0100)
Remove call to sadf_get_record_timestamp_struct() function as it has
already been called in read_next_sample() function.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sadf.c

diff --git a/sadf.c b/sadf.c
index 54c1dbfca0ff7c2ed456c456b78895c7369aacd5..cce220c481b9cf89df1d8f82b6a1813b3374fbd3 100644 (file)
--- a/sadf.c
+++ b/sadf.c
@@ -628,9 +628,9 @@ void write_mech_stats(int curr, unsigned long dt, unsigned long long itv,
  * @cpu_nr             Number of processors for current activity data file.
  * @rectime            Structure where timestamp (expressed in local time
  *                     or in UTC depending on whether options -T/-t have
- *                     been used or not) can be saved for current record.
+ *                     been used or not) has been saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
- *                     can be saved for current record.
+ *                     has been saved for current record.
  * @reset_cd           TRUE if static cross_day variable should be reset.
  *
  * OUT:
@@ -670,9 +670,6 @@ int write_parsable_stats(int curr, int reset, long *cnt, int use_tm_start,
                /* Not close enough to desired interval */
                return 0;
 
-       /* Fill timestamp structure for current record */
-       sadf_get_record_timestamp_struct(curr, rectime, loctime);
-
        /* Check if we are beginning a new day */
        if (use_tm_start && record_hdr[!curr].ust_time &&
            (record_hdr[curr].ust_time > record_hdr[!curr].ust_time) &&
@@ -733,9 +730,9 @@ int write_parsable_stats(int curr, int reset, long *cnt, int use_tm_start,
  * @cpu_nr             Number of processors.
  * @rectime            Structure where timestamp (expressed in local time
  *                     or in UTC depending on whether options -T/-t have
- *                     been used or not) can be saved for current record.
+ *                     been used or not) has been saved for current record.
  * @loctime            Structure where timestamp (expressed in local time)
- *                     can be saved for current record.
+ *                     has been saved for current record.
  *
  * OUT:
  * @cnt                        Set to 0 to indicate that no other lines of stats
@@ -754,9 +751,6 @@ int write_textual_stats(int curr, int use_tm_start, int use_tm_end, int reset,
        char cur_date[32], cur_time[32];
        static int cross_day = FALSE;
 
-       /* Fill timestamp structure (rectime) for current record */
-       sadf_get_record_timestamp_struct(curr, rectime, loctime);
-
        /*
         * Check time (1).
         * For this first check, we use the time interval entered on