Changeset 1373
- Timestamp:
- 28/10/08 12:51:53 (2 months ago)
- Files:
-
- trunk/tools/tracemerge/tracemerge.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/tracemerge/tracemerge.c
r1260 r1373 12 12 "%s flags outputuri traceuri [traceuri...]\n" 13 13 "-i [interfaces_per_input] --set-interface [interfaces_per_input]\n" 14 " Each trace is allocated an interface. Default leaves this flag as read from the original traces, if appropriate\n" 14 " Each trace is allocated an interface. Default leaves this flag as\n" 15 " read from the original traces, if appropriate\n" 15 16 "-u --unique-packets Discard duplicate packets\n" 17 "-z [level] --compression [level]\n" 18 " Compression level\n" 16 19 "-H --libtrace-help Print libtrace runtime documentation\n" 17 20 ,argv0); … … 38 41 uint64_t last_ts=0; 39 42 struct sigaction sigact; 43 int compression=6; 40 44 41 45 while (1) { … … 45 49 { "unique-packets", 0, 0, 'u' }, 46 50 { "libtrace-help", 0, 0, 'H' }, 51 { "compression", 2, 0, 'z' }, 47 52 { NULL, 0, 0, 0 }, 48 53 }; 49 54 50 int c=getopt_long(argc, argv, "i::uH ",55 int c=getopt_long(argc, argv, "i::uHz::", 51 56 long_options, &option_index); 52 57 … … 66 71 exit(1); 67 72 break; 73 case 'z': 74 if (optarg) 75 compression = atoi(optarg); 76 else 77 compression = 6; 78 if (compression<0 || compression>9) { 79 fprintf(stderr,"Compression level must be between 0 and 9\n"); 80 usage(argv[0]); 81 } 82 break; 68 83 default: 69 84 fprintf(stderr,"unknown option: %c\n",c); … … 82 97 return 1; 83 98 } 99 100 if (trace_config_output(output, TRACE_OPTION_OUTPUT_COMPRESS, &compression) == -1) { 101 trace_perror_output(output,"Unable to set compression level"); 102 } 103 84 104 if (trace_start_output(output)==-1) { 85 105 trace_perror_output(output,"trace_start_output");
