Usage: chop trace [-module <name>] -begin <addr> -end <addr>
                  [<options>] <command> [<args>]
       chop trace -active <time> -interval <time>
                  [<options>] <command> [<args>]

Trace page accesses of a given command. The provided command
is executed and the memory and/or code pages being executed
are dumped to the provided path. You need to use the
'chop-trace2mpt' post-processing script to convert the trace
to a MPT file that can be handled by Microprobe tool.

There are 3 alternative methods to define the portion of execution
that will be considered for tracing:

a) Region of interest, if you know the start and ending addresses
   of the region to be traced. E.g.:

   chop trace -begin 400 -end 800 ./foo bar baz

   will trace starting at address 0x400 and ending at address 0x800.
   This process is repeated, and different traces are generated,
   until a termination condition is met.

   In order to facilitate the task of defining a region of interest
   to be trace based on function (or symbol) names, one can use the
   following chop-marks support tool to automatically gather
   the -begin and -end of a function. E.g. 

   chop trace $(chop-marks ./foo my_function_in_foo) ./foo bar baz

   will trace all exectutions of 'my_function_in_foo'.

b) Temporal-based sampling. The execution will be traced at the
   specified interval regions. E.g.:

   chop trace -active 5ms -interval 100ms ./foo bar baz

   will wait for 100ms, then will be tracing for 5ms and repeat
   again. This process is repeated, and different traces are generated,
   until a termination condition is met.

c) Region of interest + time, where you want to do temporal-based sampling
   but bounded by the start of the region of interest. E.g.:

   chop trace -begin 400 -active 5ms ./foo bar baz

   will start tracing when address 0x400 is reached. Then, it will trace for
   5ms. This process is repeated, and different traces are generated, until a
   termination condition is met.

Once the portion of execution is defined, there are also 3 alternative
methods to decide whether to trace or not that particular execution:

a) All executions. This is the default behaviors if no extra parameter is
   specified.

b) Random. Use the -prob <pct> to define the probability of a specific
   execution to be traced. E.g. :

   chop trace -begin 400 -end 800 -prob 0.5 ./foo bar baz

   will trace half of the executions starting at address 0x400 and ending at
   address 0x800.

c) Index based. Use -indices <list> parameter to specify the execution number
   to be traced.

   chop trace -begin 400 -end 800 -indices 2,18 ./foo bar baz

   will trace executions 2 and 18 of the executions starting at address 0x400
   and ending at address 0x800.

To control the amount of data to be generated one can use the following
parameters and stop conditions:

a) -max-pages controls the maximum number of pages dumped for each traced
   execution

b) -max-traces controls the maximum number of execution traces to generate

Options:

  -begin <addr>          Begin address of the region of interest in hex format.
                         Address correspond to static image address of the modules
                         being executed.
  -end <addr>            End address of the region of interest in hex format.
                         Address correspond to static image address of the modules
                         being executed.
  -active <time>         Time tracing is active. By default <time> is in seconds.
                         One can use time specifiers as following: d (days), h
                         (hours), m(minutes), s(seconds), ms (milliseconds),
                         us(microseconds). This time also includes the time
                         required to trace (dump to disk and other IO).
  -interval <time>       Time between traces. By default <time> is in seconds.
                         One can use time specifiers as following: d (days), h
                         (hours), m(minutes), s(seconds), ms (milliseconds),
                         us(microseconds).

  -prob <pct>            Probability that a given region is traced
                         Valid values: floats between 0 and 1. 0: no region
                         is going to be traced. 1: all region will be traced.
  -indices <list>        Trace the indicated executions (starting at 0). e.g.
                         if tracing a region of interest defined by a starting
                         address, and list=3,5 , it will generate a trace
                         when that address is reached a third and fifth time.

  -max-pages <num>       Limit tracing to <num> pages per execution traced.
  -max-traces <num>      Stop tracing after <num> traces have been extracted.

  -trace-dir <path>      Path to directory where tracing data will be stored
                         (default: trace_data).
  -gzip                  Zip contents of the output -trace-dir specified.

  -access-trace          Generate 'trace.bin' file in -trace-dir path. The
                         binary file is a trace containing the addresses of
                         the pages being accessed. It can be processed with
                         'chop-detrace' helper tool.

Other options:

  -no-save               Disable data page content dumping.
  -no-code               Disable code page content dumping.
  -unprotect-syms        Disable the protection of reserved symbols.
  -memory-access-trace   Generate 'memory_trace.bin' file in -trace-dir path.
                         The binary file contains detailed information of every
                         memory access. It can be processed with
                         'chop-detrace-mem' helper tool. This flag incurs in
                         a significant overhead during tracing.
  -no-registers          Disable register content dumping.
  -no-maps               Disable memory map dumping.
  -no-info               Disable additional information dumping.

  -log-path <path>       Path to log file.
  -log-level <level>     Set verbosity of the log file (default: info)
                         Options are: debug, verbose, info, warn, error.

  -no-trace              Do no call tracing mechanisms. This debugging option is
                         used for testing the detection of the regions of interests.

  -group <num>           Group <num> region into one trace (default: 1) (experimental)
  -module <name>         Name of module to trace. This is always mandatory if
                         the module to trace is not the main module. 
