Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 8

InterruptHookTrace()

Attach the pseudo interrupt handler that the instrumented module uses

Synopsis:

#include <sys/neutrino.h>

int InterruptHookTrace( 
   const struct sigevent * (* handler)(int),
   unsigned flags );

Arguments:

handler
A pointer to the handler function.
flags
Flags that specify how you want to attach the interrupt handler.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The InterruptHookTrace() kernel call attaches the pseudo interrupt handler handle that the instrumented module uses.


Note: This function requires the instrumented kernel. For more information, see the System Analysis Toolkit (SAT) User's Guide.

Before calling this function, the thread must request I/O privileges by calling:

ThreadCtl( _NTO_TCTL_IO, 0 );

The handler argument specifies the pseudo interrupt handler that receives trace events from the kernel. The integer that's passed to the handler is a combination of the buffer index and the sequence number; to extract each part, pass the integer to the _TRACE_GET_BUFFNUM() and _TRACE_GET_BUFFSEQ() macros defined in <sys/trace.h>.

The flags argument is a bitwise OR of the following values, or 0:

Flag Description
_NTO_INTR_FLAGS_END Put the new handler at the end of the list of existing handlers (for shared interrupts) instead of the start.

_NTO_INTR_FLAGS_END

The interrupt structure allows trace interrupts to be shared. For example, if two processes take over the same trace interrupt, both handlers are invoked consecutively. When a handler attaches, it's placed in front of any existing handlers for that interrupt and is called first. This behavior can be changed by setting the _NTO_INTR_FLAGS_END flag in the flags argument. This adds the handler at the end of any existing handlers.

Blocking states

This call doesn't block.

Returns:

An interrupt function ID, or -1 if an error occurs (errno is set).

Errors:

EAGAIN
All kernel interrupt entries are in use.
EFAULT
A fault occurred when the kernel tried to access the buffers provided.
EPERM
The process doesn't have superuser capabilities.
ENOTSUP
The kernel isn't instrumented.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

InterruptAttach(), TraceEvent()

Writing an Interrupt Handler chapter of the Neutrino Programmer's Guide

System Analysis Toolkit (SAT) User's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 232

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/interrupthooktrace.html on line 232