24.5. Saving Data in Legacy Mode

Sometimes it is useful to save samples at a specific time. For example, when profiling an executable, it may be useful to gather different samples based on different input data sets. If the number of events to be monitored exceeds the number of counters available for the processor, multiple runs of OProfile can be used to collect data, saving the sample data to different files each time.
To save the current set of sample files, execute the following command, replacing name with a unique descriptive name for the current session:
opcontrol --save=name
The command creates the directory /var/lib/oprofile/samples/name/ and the current sample files are copied to it.
To specify the session directory to hold the sample data, use the --session-dir option. If not specified, the data is saved in the oprofile_data/ directory on the current path.