Adding a Data Control Function to a Module
Other versions of this page are also available for the following:
8/27/2008
By default, the Remote Call Profiler logger begins writing data to an .icp file when an instrumented module starts, and continues logging until the last instrumented process unloads.
You can use the Remote Call Profiler data collection functions in your code to start and stop data collection. For more information, see Remote Call Profiler Data Collection Functions.
In the module, insert a
#include cecap.h
statement.In your code, insert a
StartProfile(ProfileLevel, PROFILE_CURRENTID);
statement to start or restart data collection.
- or -
In your code, insert aStopProfile(ProfileLevel, PROFILE_CURRENTID);
to stop data collection.In the statement, replace
ProfileLevel
with a constant.
The following table shows acceptable values forProfileLevel
.Constant Description PROFILE_GLOBALLEVEL
Applies to all processes and threads in a cross-process profiling scenario
PROFILE_PROCESSLEVEL
Applies to all threads in the current process
PROFILE_THREADLEVEL
Applies to the current thread
Note
The PROFILE_CURRENTID constant identifies the current thread or process. By default, profiling is enabled for all levels of profiling.
You can stop profiling at a given scope with one function call. To start or resume profiling, ensure that all three profiling levels are enabled.
See Also
Concepts
Call Profiler Data Collection API Reference
Call Profiler Instrumented Module Building