Changeset 1e0a804


Ignore:
Timestamp:
05/18/18 11:39:59 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
1060b6d
Parents:
cc9c9de
git-author:
Shane Alcock <salcock@…> (04/17/18 16:58:12)
git-committer:
Shane Alcock <salcock@…> (05/18/18 11:39:59)
Message:

Update tracereplay to allow users to specify a speed up factor.

Location:
tools/tracereplay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereplay/tracereplay.1

    rd6dc0f6 r1e0a804  
    44.SH SYNOPSIS
    55.B tracereplay
    6 [\-b | \-\^\-broadcast] [-s \-\^\-snaplength [ snaplength] ] 
    7 [\-f | \-\^\-filter [ filter string ] ]
     6[\-b | \-\^\-broadcast] [-s \-\^\-snaplength [ snaplength] ]
     7[\-f | \-\^\-filter [ filter string ] ] [\-X | \-\^\-speedup [ factor] ]
    88inputuri outputuri
    99.SH DESCRPTION
     
    2323.TP
    2424.PD 0
    25 .BI \-s [snaplength]
     25.BI \-s " snaplength"
    2626.TP
    2727.PD
    28 .BI \-\^\-snaplength [snaplength]
     28.BI \-\^\-snaplength " snaplength"
    2929Truncate the packets to the length specified. This only makes a difference
    3030if the inputuri is a capture device. The value should be > 0. Inappropriate
     
    3333.TP
    3434.PD 0
    35 .BI \-f [ filter string ]
     35.BI \-f " filterstring"
    3636.TP
    3737.PD
    38 .BI \-\^\-filter [ filter ]
     38.BI \-\^\-filter " filterstring"
    3939Apply a filter to the inputuri.
     40
     41.TP
     42.PD 0
     43.BI \-X " factor"
     44.TP
     45.PD
     46.BI \-\^\-speedup " factor"
     47Decrease the gaps between packets by the specified factor. This will accelerate
     48the rate at which the replay is performed. By default, the factor is 1 (i.e.
     49no acceleration).
    4050
    4151.SH LINKS
  • tools/tracereplay/tracereplay.c

    rcc9c9de r1e0a804  
    196196        fprintf(stderr, " --broadcast\n");
    197197        fprintf(stderr, "\t\tSend ethernet frames to broadcast address\n");
     198        fprintf(stderr, " -X\n");
     199        fprintf(stderr, " --speedup\n");
     200        fprintf(stderr, "\t\tSpeed up replay by a factor of <speedup>\n");
    198201
    199202}
     
    219222                        { "snaplen",    1, 0, 's'},
    220223                        { "broadcast",  0, 0, 'b'},
     224                        { "speedup",    1, 0, 'X'},
    221225                        { NULL,         0, 0, 0}
    222226                };
    223227
    224                 int c = getopt_long(argc, argv, "bhs:f:",
     228                int c = getopt_long(argc, argv, "bhs:f:X:",
    225229                                long_options, &option_index);
    226230
     
    235239                                snaplen = atoi(optarg);
    236240                                break;
    237 
     241                        case 'X':
     242                                speedup = atoi(optarg);
     243                                break;
    238244                        case 'b':
    239245                                broadcast = 1;
     
    260266        }
    261267
     268        if (speedup < 1) {
     269                speedup = 1;
     270        }
     271
    262272        uri = strdup(argv[optind]);
    263273
     
    282292                }
    283293        }
     294
     295        if (trace_config(trace, TRACE_OPTION_REPLAY_SPEEDUP, &speedup)) {
     296                trace_perror(trace, "error setting replay speedup factor");
     297                return 1;
     298        }
    284299
    285300        /* Starting the trace */
Note: See TracChangeset for help on using the changeset viewer.