Intrusive and Non-intrusive

Submitted by epreisz on Sun, 02/11/2007 - 08:24.

Sometimes when we attempt to profile an application we will affect the way the program runs due to the overhead of collecting data. Some types of profiling have higher overhead and some have next to none. A profiling tool that requires added processing within the application’s thread is an intrusive profiler. Those that do no require added overhead within the applications thread is a non-intrusive profiler.

Let’s take a look at an example of an intrusive profiler that you are likely to encounter.

V-Tune is a powerful application for detecting bottlenecks on Intel based PCs. One of the tools V-Tune provides is an application level tool called the call graph. When you run the call graph, V-Tune will instrument the .dlls that your application calls. It also requires you to compile your application with a flag that gives extra information to V-Tune, allowing the program it to track the calls of functions. In Visual Studio 2003, you will set these values by first opening the properties of your project. In the properties window, choose the “linker” folder and the “advanced” sub-category. While in the “advanced” view, set the “fixed base address” property to “Generate a relocation section (/FIXED:NO)” and rebuild your application. In fact, select rebuild all just to make sure.

The call graph will use the relocation information to track profiling data; however, you will pay a penalty in performance to collect this information. The trade-off is the ability to report a parent-to-child relationship that we can’t get without being intrusive.

When using sampling, the data will write to a database, but does not(measurably) affect the performance of your application thread. Why? The overhead is very little. All that is required is to increment a counter at the address where the time or event occurred. When you are done profiling, you have collected every clock tick and/or event and the number of times it happed. When you compare that database to the source code, you have a view into how much time your program has spent at each line, function, class, or thread. Sampling is a non-intrusive profiler.

If you are writing a custom profiler, something I don’t recommend, you should be aware of the overhead you are introducing into your application.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Cheap viagra

AQUsWle Cheap viagra 6257 Cialis 3082

Buy Viagra

YueGUDus Buy Viagra 5252 Cheap Cialis %-[[[

Viagra

mowUBquA Viagra 8]]] Buy Phentermine >:-OOO Buy Cialis >:-[

Cialis

USqlbX Cialis =-] Viagra %-[[[ Ambien 8]]]

Buy Viagra

mPMBRQ Buy Viagra 5367 Cheap Valium 8730 Buy Cialis 8427

Cialis

zPqrFshK Cialis 0538 Viagra mnqrk Cheap Xanax 9722

Cialis

IILzGU Cialis CxvmpA Cheap viagra >:-OOO Phentermine online =-]

Cheap Cialis

LZLLJsAe Cheap Cialis 0388 Viagra dIbrk Buy Tramadol 0178

Viagra

xIrlgZ Viagra 8652 Ambien >:-OOO Cheap Valium >:-[ Xanax online 2300 Buy Phentermine >:]] Buy Cialis Online lwsLT

Buy Cialis

MRkSebja Buy Cialis JkJJBx Buy Viagra 7787 Phentermine :-O

Phentermine

XXmQpb Phentermine =-] Cheap Xanax cFipY Cialis 1525 Viagra >:-OOO Cheap Ambien 8209 Buy Valium 9720

Buy Tramadol

zCykVFi Buy Tramadol sMPJq Phentermine >:-OOO Xanax fCibI

Viagra

XxZEERy Viagra Nwsou Cheap Cialis NXYpl

Viagra

GCoJUon Viagra 6071 Cialis 2868

Valium

doKeNHA Valium YCOzJi

Phentermine online

lsmutte Phentermine online auson

Cheap Cialis

Xanax

Cheap viagra

Buy Viagra

vKOevcQR Buy Viagra Cialis

Buy Ambien

Viagra

Viagra

Xanax

Cheap viagra

Valium

Viagra

ZzfGoLV Viagra Cialis

Xanax online

Viagra

TfmmVri Viagra Cialis

Cheap Phentermine

Cheap viagra

Cheap Valium

Viagra

ciiGCtM Viagra Cialis

Cheap Phentermine

Buy Viagra online

Buy Viagra

UWHrZaN Buy Viagra Cialis

Valium

Buy Phentermine

Cheap viagra

Buy Phentermine

Viagra

Viagra

fRCMsZcP Viagra Cheap Cialis

Cheap Phentermine

Viagra

wrcDuWwk Viagra Cialis

Buy Viagra

Phentermine

Cheap viagra

Viagra

Viagra

MBvaAXn Viagra Cialis

Cheap Xanax