By using the data from the Function Instrumentation mode in System Profiler, you can:
- See the function entry and exit event information, in addition to other types of events in Timeline view
- See a full stack frame of each thread for each timeframe (open the Thread Call Stack view)
By default, you won't see function names, only addresses; however, you can manually add binary information by doing the following:
- In the Project Explorer view, right-click on a .kev file, and select Properties.
- Select Address Translation from the left panel.
- On the Binary Locations page, select the path to your binary files.
- On the Binary Mappings page, type the name of your binary and libraries with the load addresses.
- Select the option Enable address translation at the top of the dialog.
- You must close and then reopen the .kev file for the address translation to take effect.
Application Profiler data in the System Profiler timeline.
Note: If you're missing function names in the System Profiler Timeline view, you may want to consider adding this information by
instrumenting your binaries with the Function Instrumentation library, and running in Kernel Events mode. For additional information,
see
Using Function Instrumentation mode for a single application.
Launching from the command line on the target machine
To launch from the command line:
- Set the environment variable to the following:
QPROF_KERNEL_TRACE=1
Set this environment variable for each process, or export it for all processes; it won't affect uninstrumented binaries.
- Launch one or more processes on the target.
- In the IDE, open the System Profiler perspective and run Kernel Logging for several seconds.
Note: You can use tracelogger to capture events generated by programs compiled with Function Instrumentation.
- Open the resulting .kev file in System Profiler editor.
- Optional: You can import the .kev file into the Application Profiler perspective from the Profiler Sessions view (Import Application Profiler Session icon), or by using to open the Import wizard.
Launching from the IDE
To profile a process:
- Create a launch configuration for the binary.
- On Tools tab, select Add/Delete Tools, then select Application Profiler.
- Select Kernel Logging.
- Click OK
- On the Application Profiler tab, select Functions Instrumentation.
- For the Project Scope, select System Wide.
- Disable the option Switch to this tool's perspective on launch if it's currently selected.
- Click Apply.
- Switch to Kernel Logging tab.
- Select Launch with Kernel Log capturing.
- Select one of existing System Profiler Kernel Log configurations. If you don't have any, click Edit and create one.
- Select the option Switch to this tool's perspective on launch.
- Click Apply.
- Click the Upload tab.
- Deselect Use unique name for the uploaded binary.
- Click Apply.
- Click Run.