08-06-2012 06:54 PM
I've been profiling a program I'm writing that makes multiple DLL calls every 10 ms and which runs for multiple minutes, and I've noticed some strange behavior. In the attached vi.png, you'll see a very pared down VI that's enough to illustrate my issue. Basically, every 10 ms, I make a call to a DLL which has one operation: 'return 0;'. I'm measuring how long this DLL takes to execute in microseconds and pushing this value onto a FIFO. There's another loop that continuously drains this FIFO into a TDMS file. The attached graph.png shows the data from the TDMS file graphed in Excel.
The issue I'm having is in that single outlier a little before the 15,000th tick of almost 900 microseconds. The average duration of a call to this simple DLL is about 2 microseconds, yet sometimes it appears to take almost 900 microseconds. In the more complete version of this example, the delays are also almost 900 microseconds. They're infrequent, but I can expect to see roughly one in every 320 second trial (sometimes more, sometimes fewer). It's important that I not see them at all.
For what it's worth, I have the VI deployed to an x86 desktop LVRT box, and it executes on startup. I leave it alone for those 320 seconds, then gather the TDMS files from FTP afterwards. Any clue why this might be happening? What's special about 900 microseconds? I've attached the VI as well, and can make the TDMS available in another post if anyone is interested.
Solved! Go to Solution.
08-06-2012 08:07 PM
I don't think there's anything necessarily special about your 900us jitter, it just sounds like an SMI is firing periodically causing the system to experience high amounts of Jitter. On PXI and Desktop systems, jitter spikes in the 850-950us range generally come from the Legacy USB SMI; in the BIOS, disable Legacy USB and see if the jitter goes away. Occasionally we'll have a BIOS where we disable everything and we still see an SMI fired that causes the system to come to a screeching halt for about 1ms, and we upgrade the BIOS and things go away. Make sure the BIOS has been updated, and disable Legacy USB.
08-07-2012 01:32 PM
It looks (tentatively) like you're right: I'm no longer seeing the jumps to 900 us after a couple of tests with Legacy USB disabled in the BIOS. I'll dial it in for a much longer test to get more confidence in the result, but I think you solved it. Thanks!