I am having an issue where my highest priority task is being preempted by someone (I assuming the kernel) but I don’t know why or how to find out who is doing and why they are doing it. I run a high priority task every 5 ms and I have check to make sure I am not 1.5 time greater in time then my 5 ms update from the last time I ran. I am seeing spots where my high priority task is not running and the time can vary from 15 ms upto 160 ms.
I can’t pinpoint a peridoic time frame when this happens.
I create a ram disk on boot which copies my programs from an ide mounted flash disk. I still write randomly to the flash disk for logs and such but I am not writting that much, maybe a line per second; but I am seeing that when I switch this flash card the problem can worsen.
I would like to find out how I can tell what qnx is doing when it won’t allow my highest priority task to run.
I haven’t worked with it myself, but this is something that the instrumented kernel should be able to help with.
When you say that you rn a high priority task every 5ms, what exactly do you mean.
are you doing something like this:
or are you using an interrupt to wake up every 5ms, or something else?
What is the time slice you are using? If for example, you ask to sleep 5ms, but the timer interrupt
occurs only once every 10ms, you will not get the resolution you expect.
Nothing I can think of should delay you 160ms.
Tim, I think I recall the incident. Someone was putting out a message across the network that I think was being read off of a scope from a parallel port. The jitter was pretty wild. In the end it did turn out to be something with a graphics card.
I am not running photon.
My highest priority task is 22. It msgPulses some other tasks but I made sure make the pulse prio less then my high priority task. There are no msgsends anymore so I am not getting reply blocked or anything.
My task is creating a timer with qnx and doing a msgreceive on it.
I have attempted to find the amount of time it takes for my task to run by doing a time substraction from the start to the end of the code block for the timer tick receive. It appears to average around 1 ms.
I am not the full orginator of the code nor do I know every corner so there could be interrupts being serviced. There are typically three serial devices in communication with it and four pc104 (isa) cards but the isa cards are not interrupt driven.
Ok, I am back. I got pulled away for a few days. Where do I find the System Profiler? Is it already in the standard Qnx distro?
My timer pulses are set the priority of the current task’s priority and the pulses going to other tasks are current task’s priority minus 2 or some other number but always lower then my high priority task.
I am about to test the theory of setting my tasks prio higher then the serial driver and I will let you know what happens.
Setting my task to a higher priority then my serial driver doesn’t resolve my problem. I am looking into getting and running the System Profiler but it does require the full development qnx suite and I currently don’t run that on my target machines. Thanks for the insights thus far, I am learning a lot.
I have traceprinter. Maybe a typo above or qnx switched the command. That is cool; now to understand it.
I seem to have the tracelogger on my target machine but no log file is being generated. Does this mean I don’t have the instrumented kernel on my target machine? There is no error being returned to me, just no file. I use a different hard drive and see if I can still get my problem to occur and get a tracelogger.
Thanks thus far.
The log file by default is written to /dev/shmem. Are you looking there for it? That is a Ram drive by the way. So if you reboot the file will be lost so you need to collect it before rebooting.
Also, I was re-reading your initial report. You mentioned that periodically, you write to the flash drive in your system. That’s a VERY slow process since flash drives are orders of magnitude slower than harddrives. If you turn off that writing to the flash drive I’d be curious to know if the problem goes away.
I got a tracelogger file that should of caught my problem. IT IS ALOT OF DATA!!! Is there any nice gui application that can visualize this data for me? I am currently working through it in a text editor and switching pid numbers to task names so it makes more sense to my eyes. Also the time is in clock cycles. Is this from my processor speed or the programmable qnx clock resolution?
Ahh, I just posted a message that is outdate, the forum went to another page and I didn’t notice that. Sorry.
I have tried replacing my flash disk with a harddrive, I get the same problem. I don’t get the problem when I running on my development box which is a Pentium Xeon something but my target machines are Pentium 1ghz M’s. I also get more problems reported when I switch compact flash disks (I currently use a WinSystem’s Industrial CF but I tried a new Kingston Elite Pro and I get more problems reported even though the Kingston has the same specs as the WinSystem’s).
Thanks cburgess for letting me know I can copy and load that file into my development box’s System Profiler IDE.