My question is whether I could configure the hardware counters to increment only for a particular process ID - so that the kernel does not interfere with the results. This is significant because when I run my application (which is want I would like to sample) as the kernel also generates significant samples of all the parameters (memory misses and instructions).
From my understanding this is what VTune does (correct me if I'm wrong). --- If for an Application A I set the sample after value for L2 Cache misses at 10000 and this is the application I want to optimize. Now when I run the application on a Linux box --- if another unrelated application X is also running and generating significant misses. There is a possibility - Application X could generate 9000 L2 misses and Application A generates only 1000 L2 misses. But because the 10000th miss is by Application A and the sample after value is 10000 the event counter of Application A for L2-misses gets incremented. Which is wrong rite?