~ubuntu-branches/ubuntu/karmic/sysstat/karmic

« back to all changes in this revision

Viewing changes to sar.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2009-06-07 21:37:20 UTC
  • mfrom: (1.1.15 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090607213720-4sixxpv1y32q27qn
Tags: 9.0.3-2
Remove some debugging cruft left by accident.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
 
238
238
/*
239
239
 ***************************************************************************
240
 
 * Fill rectime structure according to time data saved in current
241
 
 * structure.
 
240
 * Fill the rectime structure with current record's time, based on current
 
241
 * record's time data saved in file.
 
242
 * The resulting timestamp is expressed in the locale of the file creator
 
243
 * or in the user's own locale depending on whether option -t has been used
 
244
 * or not.
242
245
 *
243
246
 * IN:
244
247
 * @curr        Index in array for current sample statistics.
245
248
 ***************************************************************************
246
249
*/
247
 
void sar_set_rectime(int curr)
 
250
void sar_get_record_timestamp_struct(int curr)
248
251
{
249
252
        struct tm *ltm;
250
253
 
299
302
 
300
303
/*
301
304
 ***************************************************************************
302
 
 * Set timestamp string.
 
305
 * Set current record's timestamp string.
303
306
 *
304
307
 * IN:
305
308
 * @curr        Index in array for current sample statistics.
309
312
 * @cur_time    Timestamp string.
310
313
 ***************************************************************************
311
314
*/
312
 
void set_timestamp(int curr, char *cur_time, int len)
 
315
void set_record_timestamp_string(int curr, char *cur_time, int len)
313
316
{
314
 
        sar_set_rectime(curr);
 
317
        /* Fill timestamp structure */
 
318
        sar_get_record_timestamp_struct(curr);
315
319
 
316
320
        /* Set cur_time date value */
317
321
        strftime(cur_time, len, "%X", &rectime);
419
423
        }
420
424
 
421
425
        /* Set previous timestamp */
422
 
        set_timestamp(!curr, timestamp[!curr], 16);
 
426
        set_record_timestamp_string(!curr, timestamp[!curr], 16);
423
427
        /* Set current timestamp */
424
 
        set_timestamp(curr,  timestamp[curr],  16);
 
428
        set_record_timestamp_string(curr,  timestamp[curr],  16);
425
429
 
426
430
        /* Check if we are beginning a new day */
427
431
        if (use_tm_start && record_hdr[!curr].ust_time &&
566
570
        char cur_time[26];
567
571
        int dp = 1;
568
572
 
569
 
        set_timestamp(curr, cur_time, 26);
 
573
        set_record_timestamp_string(curr, cur_time, 26);
570
574
 
571
575
        /* The record must be in the interval specified by -s/-e options */
572
576
        if ((use_tm_start && (datecmp(&rectime, &tm_start) < 0)) ||
861
865
                                 */
862
866
                                read_file_stat_bunch(act, 0, ifd, file_hdr.sa_nr_act,
863
867
                                                     file_actlst);
864
 
                                sar_set_rectime(0);
 
868
                                sar_get_record_timestamp_struct(0);
865
869
                        }
866
870
                }
867
871
                while ((rtype == R_RESTART) || (rtype == R_COMMENT) ||