Changeset 870e501
- Timestamp:
- 12/24/06 17:14:50 (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:
- e2d49d5
- Parents:
- 4bd8a5b
- Location:
- tools/tracereport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/dir_report.c
ra7282fb r870e501 12 12 void dir_per_packet(struct libtrace_packet_t *packet) 13 13 { 14 if (trace_get_direction(packet)== -1)14 if (trace_get_direction(packet)==~0U) 15 15 return; 16 16 dir_bytes[trace_get_direction(packet)]+=trace_get_wire_length(packet); -
tools/tracereport/tracereport.c
ra7282fb r870e501 105 105 fprintf(stderr,"Usage:\n" 106 106 "%s flags traceuri [traceuri...]\n" 107 "-f --filter =bpfApply BPF filter. Can be specified multiple times\n"107 "-f --filter Apply BPF filter. Can be specified multiple times\n" 108 108 "-H --libtrace-help Print libtrace runtime documentation\n" 109 109 ,argv0); … … 113 113 int main(int argc, char *argv[]) { 114 114 115 int i;115 libtrace_filter_t *filter = NULL; 116 116 117 /*char *filterstring="host 130.197.127.210"; */ 117 if (argc<2) 118 usage(argv[0]); 118 119 119 libtrace_filter_t *filter = NULL;/*trace_bpf_setfilter(filterstring); */ 120 while(1) { 121 int option_index; 122 struct option long_options[] = { 123 { "filter", 1, 0, 'f' }, 124 { "libtrace-help", 0, 0, 'H' }, 125 {NULL, 0, 0, 0 }, 126 }; 127 int c = getopt_long(argc, argv, "f:H", 128 long_options, &option_index); 129 if (c == -1) 130 break; 131 switch(c) { 132 case 'f': 133 if (filter != NULL) { 134 fprintf(stderr,"You can only have one filter\n"); 135 usage(argv[0]); 136 } 137 filter=trace_create_filter(optarg); 138 break; 139 case 'H': 140 trace_help(); 141 exit(1); 142 break; 143 default: 144 printf("Unknown option: %c\n", c); 145 usage(argv[0]); 146 } 147 } 120 148 121 for(i=1;i<argc;++i) {122 run_trace(argv[ i],filter,(1<<30));149 while(optind < argc) { 150 run_trace(argv[optind++],filter,(1<<30)); 123 151 } 124 152 … … 131 159 dir_report(); 132 160 133 134 161 return 0; 135 162 }
Note: See TracChangeset
for help on using the changeset viewer.