Changeset e991529 for tools/tracereport/dir_report.c
- Timestamp:
- 04/27/07 11:52:15 (15 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/dir_report.c
rd4336d5 re991529 20 20 { 21 21 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"); 24 28 for(i=0;i<8;++i) { 25 29 if (!dir_packets[i]) 26 30 continue; 27 31 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]); 30 34 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]); 33 37 break; 34 default: printf("%20i:\t%12" PRIu64 "\t%12" PRIu64 "\n",38 default: fprintf(out, "%20i:\t%12" PRIu64 "\t%12" PRIu64 "\n", 35 39 i,dir_bytes[i],dir_packets[i]); 36 40 break; 37 41 } 38 42 } 43 fclose(out); 39 44 }
Note: See TracChangeset
for help on using the changeset viewer.