Quantcast
Channel: Windows Performance Toolkit (WPT) v5 forum
Viewing all articles
Browse latest Browse all 275

How to get a contiguous trace using PerfSet, PerfInc and PerfDec calls

$
0
0

My code looks like this

PerfCreateInstance();    // Create the Object instance 

PerfSetULongLongCounterValue(NewData);    // Set a value say 100

OldData = NewData;

while(1) {

    if (NewData > OldData) {

        PerfIncrementULongLongCounterValue(NewData - OldData);

        OldData = NewData;

    }

    if (NewData < OldData) {

        PerfDecrementULongLongCounterValue(OldData - NewData);

        OldData = NewData;

    } 

    if (NewData == OldData) {

        PerfSetULongLongCounterValue(NewData);

        OldData = NewData;

    }

} // end of while loop

My values are all ULONGLONG. I get a perfect smooth trace. However 

Whenever NewData == OldData and I do PerfSetULongLongCounterValue(NewData); I get all broken traces.

I did try by doing simply calling PerfSetULongLongCounterValue() for all values without bothering to check for the old value or doing INC or DEC operation and that resulted in even bad broken trace form.  Could some kind soul point me out what part of the logic is wrong in my code? 

thanks

ananda


Viewing all articles
Browse latest Browse all 275

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>