The level of logging you specify determines how much data is collected and how much impact WindView has on your application. The three options are:
The relationship between these levels is shown in Figure 3-1. CSE level collects the smallest amount of data and is the least intrusive. TST level collects all the data collected at CSE level plus additional data about task state transitions. AIL level collects all the data collected at TST level plus additional data about selected objects. At AIL level, you can choose to collect data about only some or all of the possible objects, depending on your needs.
To select a logging level, open the Collection Configuration dialog box by clicking the button on the Control window toolbar. The Collection Configuration dialog box is shown in Figure 3-2. Select the desired level from the Base Events drop-down combo box.
In real-time systems, the term current context usually refers to the current task and the information needed to restore the task's state, such as the state of the processor registers, operating system control information, and the stack. For WindView, the meaning of current context is extended to include any thread of execution: a task, an ISR, or the kernel's idle loop. A context switch, then, refers to a change in the current context, which can occur when one task preempts another, a task delays itself or pends on a resource, or a task is interrupted by an ISR. To view a sample event log collected with CSE level logging, select Open in the main File menu and open installDir/host/src/windview/samples/switch.wvr. Figure 3-3 shows this event log.
When you select Context Switch on the Collection Configuration dialog box (see Figure 3-2), WindView collects data about the current context and where it is switched. It also records every entry and exit of an ISR, every program error that results in an exception that is handled by a default exception handler, periods of task preemption locking, and periods of priority inheritance. Because CSE level logging is the least intrusive, it can be useful for fine-tuning an otherwise debugged system. For example, you might use it to see that all timing deadlines are being met, or that all tasks get to run.
The term task state transition refers to the process of a task exiting from one state and entering into another. For example, if a task issues a call to semTake( ) and the semaphore is not available, it makes a transition from the executing state to the pended state. If it calls taskDelay( ), it makes a transition from the delayed state to the ready state when the number of ticks specified in the call expire. All context switches involve task state transitions, but a given task state transition may or may not result in a context switch, depending on the states of other tasks in the system when the task in question makes a state transition. View a sample event log collected at TST logging level by selecting Open in the main File menu to installDir/host/src/windview/samples/state.wvr. Figure 3-4 shows a portion of this event log.
When you select Task State Transition on the Collection Configuration dialog box, WindView collects data about task state transitions and the events that cause them. However, when you specify TST level logging WindView does not collect information on events that do not result in task state transitions. For example, if no tasks are pended on a particular semaphore, a semGive( ) of that semaphore does not result in any task state transitions; thus, the semGive event icon is not logged.
AIL level logging works a little differently from CSE and TST levels. At AIL level, WindView gathers all the information included at the other two levels, as well as additional information about instrumented libraries that you choose to log. When you ask WindView to log an instrumented library, it logs all operations on library objects, including creations, gives or sends, takes or receives, and deletions. Events are generated for these operations whether or not they result in task state transitions, context switches, or neither; for example, a semTake( )of a semaphore that is available would be logged at AIL level, even though it would not change the state of the calling task. To view a sample event log collected at AIL logging level, open installDir/host/src/windview/samples/object.wvr by selecting Open in the main File menu. Figure 3-5 shows this event log.
When you specify AIL level logging, you can collect data for many kinds of objects in your real-time system. By default, the main kernel AIL libraries are selected when you select AIL level: taskLib, semLib, msgQLib, and wdLib, which are checked in the default setting shown in Figure 3-2. For information on changing the selected libraries, see 3.3 Instrumented Objects.
Figure 3-5 shows the same scenario as Figure 3-4. The only difference is that Additional Instrumentation was selected on the Collection Configuration dialog box, causing the default libraries to be logged. You can see that in addition to the information shown in Figure 3-4, tNetTask gives and take several semaphores( and ), only one of which results in a task state transition or a context switch.