Ignore:
Timestamp:
04/27/07 11:52:15 (14 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
bd4bec9
Parents:
1dc58e0
Message:

Updated some reports to output to files rather than stdout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereport/dir_report.c

    rd4336d5 re991529  
    2020{
    2121        int i;
    22         printf("# Direction\n");
    23         printf("%-20s \t%12s\t%12s\n","Direction","bytes","packets");
     22        FILE *out = fopen("dir.out", "w");
     23        if (!out) {
     24                perror("fopen");
     25                return;
     26        }
     27        fprintf(out, "%-20s \t%12s\t%12s\n","DIRECTION","BYTES","PACKETS");
    2428        for(i=0;i<8;++i) {
    2529                if (!dir_packets[i])
    2630                        continue;
    2731                switch(i) {
    28                         case 0: printf("%20s:\t%12" PRIu64 "\t%12" PRIu64 "\n",
    29                                         "in",dir_bytes[i],dir_packets[i]);
     32                        case 0: fprintf(out, "%20s:\t%12" PRIu64 "\t%12" PRIu64 "\n",
     33                                        "Incoming",dir_bytes[i],dir_packets[i]);
    3034                                break;
    31                         case 1: printf("%20s:\t%12" PRIu64 "\t%12" PRIu64 "\n",
    32                                         "out",dir_bytes[i],dir_packets[i]);
     35                        case 1: fprintf(out, "%20s:\t%12" PRIu64 "\t%12" PRIu64 "\n",
     36                                        "Outgoing",dir_bytes[i],dir_packets[i]);
    3337                                break;
    34                         default: printf("%20i:\t%12" PRIu64 "\t%12" PRIu64 "\n",
     38                        default: fprintf(out, "%20i:\t%12" PRIu64 "\t%12" PRIu64 "\n",
    3539                                        i,dir_bytes[i],dir_packets[i]);
    3640                                break;
    3741                }
    3842        }
     43        fclose(out);
    3944}
Note: See TracChangeset for help on using the changeset viewer.