~ubuntu-branches/ubuntu/maverick/sysstat/maverick

« back to all changes in this revision

Viewing changes to sa_common.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:
350
350
 
351
351
/*
352
352
 ***************************************************************************
353
 
 * Fill rectime structure according to data saved in file header.
 
353
 * Fill the rectime structure with the file's creation date, based on file's
 
354
 * time data saved in file header.
 
355
 * The resulting timestamp is expressed in the locale of the file creator or
 
356
 * in the user's own locale, depending on whether option -t has been used
 
357
 * or not.
354
358
 *
355
359
 * IN:
356
360
 * @flags       Flags for common options and system state.
360
364
 * @rectime     Date and time from file header.
361
365
 ***************************************************************************
362
366
 */
363
 
void set_hdr_rectime(unsigned int flags, struct tm *rectime,
364
 
                     struct file_header *file_hdr)
 
367
void get_file_timestamp_struct(unsigned int flags, struct tm *rectime,
 
368
                               struct file_header *file_hdr)
365
369
{
366
370
        struct tm *loc_t;
367
371
 
368
372
        if (PRINT_TRUE_TIME(flags)) {
369
 
                /* Get local time */
 
373
                /* Get local time. This is just to fill HH:MM:SS fields */
370
374
                get_time(rectime);
371
375
 
372
376
                rectime->tm_mday = file_hdr->sa_day;
405
409
                      struct file_header *file_hdr, int cpu_nr)
406
410
{
407
411
 
408
 
        set_hdr_rectime(flags, rectime, file_hdr);
 
412
        /* Get date of file creation */
 
413
        get_file_timestamp_struct(flags, rectime, file_hdr);
409
414
 
 
415
        /* Display the header */
410
416
        print_gal_header(rectime, file_hdr->sa_sysname, file_hdr->sa_release,
411
417
                         file_hdr->sa_nodename, file_hdr->sa_machine,
412
418
                         cpu_nr > 1 ? cpu_nr - 1 : 1);
444
450
                         * If a counter has decreased, then we may assume that the
445
451
                         * corresponding interface was unregistered, then registered again.
446
452
                         */
447
 
                        if ((sndc->rx_packets        < sndp->rx_packets)        ||
448
 
                            (sndc->tx_packets        < sndp->tx_packets)        ||
449
 
                            (sndc->rx_bytes          < sndp->rx_bytes)          ||
450
 
                            (sndc->tx_bytes          < sndp->tx_bytes)          ||
451
 
                            (sndc->rx_compressed     < sndp->rx_compressed)     ||
452
 
                            (sndc->tx_compressed     < sndp->tx_compressed)     ||
453
 
                            (sndc->multicast         < sndp->multicast)) {
 
453
                        if ((sndc->rx_packets    < sndp->rx_packets)    ||
 
454
                            (sndc->tx_packets    < sndp->tx_packets)    ||
 
455
                            (sndc->rx_bytes      < sndp->rx_bytes)      ||
 
456
                            (sndc->tx_bytes      < sndp->tx_bytes)      ||
 
457
                            (sndc->rx_compressed < sndp->rx_compressed) ||
 
458
                            (sndc->tx_compressed < sndp->tx_compressed) ||
 
459
                            (sndc->multicast     < sndp->multicast)) {
454
460
 
455
461
                                /*
456
462
                                 * Special processing for rx_bytes (_packets) and
743
749
        }
744
750
 
745
751
        if (i == NR_ACT)
 
752
        {
 
753
                abort();
746
754
                return -1;
 
755
        }
747
756
 
748
757
        return i;
749
758
}
1367
1376
                        SELECT_ACTIVITY(A_NET_TCP);
1368
1377
                        SELECT_ACTIVITY(A_NET_ETCP);
1369
1378
                        SELECT_ACTIVITY(A_NET_UDP);
1370
 
 
 
1379
                        SELECT_ACTIVITY(A_NET_SOCK6);
 
1380
                        SELECT_ACTIVITY(A_NET_IP6);
 
1381
                        SELECT_ACTIVITY(A_NET_EIP6);
 
1382
                        SELECT_ACTIVITY(A_NET_ICMP6);
 
1383
                        SELECT_ACTIVITY(A_NET_EICMP6);
 
1384
                        SELECT_ACTIVITY(A_NET_UDP6);
1371
1385
                }
1372
1386
                else
1373
1387
                        return 1;