Table of Contents
1 - Introduction2 - Profiling your application
1 - Integrating the SDK
2 - Initialising the profiler3 - Profile events
4 - Block types
5 - Event attributes
6 - Defining expressions
4 - SDK Reference
Contact Information
Sales
Sales and licensing related questions should be sent to our sales team at:Feedback
If you have feedback regarding this website or any of our products, please use the following email address:Support
Questions related to problems you have encountered with either this website or any of our products should be directed to our support team at:Enquiries
Any other questions, or general enquiries should be sent to the following email address:2.1 - Integrating the SDK
The Oso Memory Profiler is an intrusive profiler. That is to say, you must compile the SDK into your application and call the profiler functions to collect profile data. This page provides an overview of what is included in the SDK, and how you can integrate it into your application.The Oso Memory Profiler SDK consists of a collection of C header and source files, and a C++ header file. These files are installed to the following location:
C:\ProgramData\Oso\MemoryProfiler\SDK
The exact files you should include in your application depend on the platform your application is running on. The files you will need for each supported platform are listed below:
Windows
|
MacOS, iOS, Android (Native), and Linux*
* It should be noted that Linux support is untested, however our work to support both MacOS and Android should, in
theory, mean that profiling Linux applications is viable at this time.
|
As you may have noticed, the top two files OsoMemoryProfiler.h, and OsoMemoryProfiler.c are always included on all platforms. These two files contain the public API for the SDK. All other files provide internal helper services.
The file OsoMP_Callstacks_Clang.c is primarily designed to work with the clang compiler. However the functionality used is based on clang's backwards compatibility with GCC, so it should be possible to use this with GCC as well.
If you are writing a C++ application, the Oso Memory Profiler SDK also comes with a single source file that provides global new and delete implementations that you can use as a quick and easy way to get started:
- OsoNewAndDelete.cpp
Once you have the SDK compiling, you will need to implement an initialise function that will be called by the SDK when processing the first memory request. You should note that for most applications, this callback function will be called before your first global variable is initialised, and long before main is reached. The signature of this function should be as follows:
void OsoMP_InitialiseCallback( void );
In addition to initialising the profiler, you also need to stop profiling (and flush any cached profile data) when your application exits. The function OsoMP_Closedown is used to do this.