These macros add multipass capabilities to itrace for CPU code only. They are expected to be used in combination with the existing itrace APIs. More...
Macros | |
#define | ITRACE_MULTI_PASS_START_LOOP(logger_handle, profiler_handle) |
#define | ITRACE_MULTI_PASS_END_LOOP(logger_handle, profiler_handle) |
These macros add multipass capabilities to itrace for CPU code only. They are expected to be used in combination with the existing itrace APIs.
Multipass functionality is useful for a user who needs to monitor more events that can be registered at a given time.
For example, all existing DSPs can only monitor up to 8 PMU events at a time. If a user needs to monitor 32 PMU events, the same code needs to run 4 times to capture 8 sets of events at a time. The multipass APIs automate this process.
Here is an example on how to use these macros to add multipass support:
Original single-pass code:
The code above will execute properly, generating myprofile.json
and myprofile.csv
files. However, only the first 8 added events will be monitored while executing the code. This will be visible from the files being generated by itrace, and from the printf message that will indicate that itrace tried to register only 8 events.
In order to monitor all 10 events, the monitoring code will need to execute twice. This process is automated by simply adding two macros around the monitored section(s) of interest to indicate the start and end of the monitoring loop.
Code extended for multi-pass support
The revised code will now generate more files:
myprofile_0.json
and myprofile_0.csv
files, which monitor 8 PMU eventsmyprofile_1.json
and myprofile_1.csv
files, which monitor 2 PMU eventsmyprofile_mp.csv
files, which merges the two csv files above and reports the usage of 11 events for all monitored sectionsIn order to obtain this information, remote_call_to_foo() will be executed twice.
#define ITRACE_MULTI_PASS_END_LOOP | ( | logger_handle, | |
profiler_handle | |||
) |
Indicate the end of the code block that needs monitoring
[in] | logger_handle | Handle to the logger instance to use. |
[in] | profiler_handle | Handle to the profiler instance to use. |
#define ITRACE_MULTI_PASS_START_LOOP | ( | logger_handle, | |
profiler_handle | |||
) |
Indicate the start of the code block that needs monitoring with more events than supported in a single pass.
The code block identified between ITRACE_MULTI_PASS_START_LOOP and ITRACE_MULTI_PASS_END_LOOP will be executed as many times as is required to monitor all the events that have been added.
[in] | logger_handle | Handle to the logger instance to use. |
[in] | profiler_handle | Handle to the profiler instance to use. |