Please enable JavaScript to view this site.

Performance Validator Help

Navigation: API

Native API Reference

Scroll Prev Top Next More

Unicode or ANSI?

 

All the API functions are provided in Unicode and ANSI variants where strings are used. We've also provided a character width neutral #define in the same fashion that the Windows.h header files do.

 

For example the function for naming a thread is provided as pvSetThreadNameA(), pvSetThreadNameW() with the character width neutral pvSetThreadName() mapping to pvSetThreadNameW() for unicode and pvSetThreadNameA() for ANSI.

 

In this document we're going to use TCHAR like the Window.h header files do.

 

All the API functions are declared as extern "C", so they can be used by C users and C++ users.

 

To use these functions #include svlPVAPI.h into your code.

 

 

pvLoadProfiler

 

Loads the profiler DLL into memory, but does not start the profiler.

 

Use this for:

32 bit applications with a 32 bit Performance Validator GUI

64 bit applications with a 64 bit Performance Validator GUI

 

For most use cases won't need to load the profiler, as the profiler will have been loaded when your launched your program from Performance Validator, or when you injected into your program using Inject or Wait For Application.

 

However if you're running your program from outside of Performance Validator and want to load the profiler from inside your program you can use pvLoadProfiler() to do that. You'll then need to call pvStartProfiler() to start it.

 

extern "C" 

int pvLoadProfiler();

 

Returns:
TRUE   Successfully loaded PV DLL into target application.
FALSE Failed to load the PV DLL.into target application.

      Check that the PATH environment variable points to the Performance Validator install directory contains svlPerformanceValidatorStub*.dll.

 

Do not use this function if you are working with services, use the NT Service API.

 

 

pvLoadProfiler6432

 

Loads the profiler DLL into memory, but does not start the profiler.

 

Use this for:

32 bit applications with a 64 bit Performance Validator GUI

 

For most use cases won't need to load the profiler, as the profiler will have been loaded when your launched your program from Performance Validator, or when you injected into your program using Inject or Wait For Application.

 

However if you're running your program from outside of Performance Validator and want to load the profiler from inside your program you can use pvLoadProfiler6432() to do that. You'll then need to call pvStartProfiler() to start it.

 

extern "C" 

int pvLoadProfiler6432();

 

Returns:
TRUE   Successfully loaded PV DLL into target application.
FALSE Failed to load the PV DLL.into target application.

      Check that the PATH environment variable points to the Performance Validator install directory contains svlPerformanceValidatorStub*.dll.

 

Do not use this function if you are working with services, use the NT Service API.

 

 

pvStartProfiler

 

To start the profiler from your API code you need to call the function pvStartProfiler() from your code before you call any API functions. Ideally you should call this function as early in your program as possible.

 

extern "C" 

int pvStartProfiler();

 

Returns:
TRUE   Successfully started PV profiler.
FALSE Failed to start the PV profiler.

 

If you prefer to start the profiler from the user interface or command line you can omit the pvStartProfiler() call. You can leave it present if you wish to start Performance Validator from your program.

 

Do not use this function if you are working with services, use the NT Service API.

 

 

pvSetThreadName()

 

Sets the name of a thread.

 

extern "C" 
void pvSetThreadName(DWORD                threadID

                     const TCHAR        *name);

 

 

pvSetThreadNameA()

 

Sets the name of a thread.

 

extern "C" 
void pvSetThreadNameA(DWORD                threadID

                      const char        *name);

 

 

pvSetThreadNameW()

 

Sets the name of a thread.

 

extern "C" 
void pvSetThreadNameW(DWORD                threadID

                      const wchar_t        *name);

 

 

pvSetCollect()

 

Enables or disables data collection - i.e. whether data is sent to Performance Validator from your target application.

 

extern "C" 
void pvSetCollect(int enable); // TRUE to enable, FALSE to disable

 

 

pvGetCollect()

 

Returns whether data collection is on.

 

extern "C" 
int pvGetCollect();                 // Returns TRUE or FALSE