Logging question

In a port of a driver from another operating system, I am looking for a
message queueing function that I can use when system interrupts are
disabled (as logMsg function in Vxworks allows). Is this the essence of
the Trace function or seek I another?

Thanks

Doug

“Douglas Reed” <dreed@guise.com> wrote in message
news:3C5AFF78.E45DCFCE@guise.com

In a port of a driver from another operating system, I am looking for a
message queueing function that I can use when system interrupts are
disabled (as logMsg function in Vxworks allows). Is this the essence of
the Trace function or seek I another?

Yes Trace will always works.

However I wonder if they reenable interrupt like all kernal calls do?

Thanks

Doug

Mario Charest <goto@nothingness.com> wrote:

“Douglas Reed” <> dreed@guise.com> > wrote in message
news:> 3C5AFF78.E45DCFCE@guise.com> …
In a port of a driver from another operating system, I am looking for a
message queueing function that I can use when system interrupts are
disabled (as logMsg function in Vxworks allows). Is this the essence of
the Trace function or seek I another?

Yes Trace will always works.

However I wonder if they reenable interrupt like all kernal calls do?

No, they don’t.

I did a little test program:
(Headers removed, done as two seperate C files.)


pid_t far handler( void )
{
counter++;
return 0;
}

int counter;

main()
{
int intid;
int val1, val2;
int i;

intid = qnx_hint_attach( 0, handler, my_ds() );

printf(“about to disable interrupts\n”);
sleep(1);
/* disable interrupts /
_disable();
val1 = counter; /
snap counter value */
Trace1( _TRACE_TEMPORARY|1, _TRACE_TRANSIENT,val1 );
for ( i = 0; i < 1000000000; i++ );
val2 = counter;
_enable();
printf(“interrupts enabled\n”);
printf(“val1:%d, val2:%d\n”, val1, val2 );
qnx_hint_detach( intid );
}

The output was:

about to disable interrupts
interrupts enabled
val1:101, val2:101

The trace buffer had:
Feb 06 10:24:22 2 fffff001 00000065

(6*16+5 = 101)

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.