/*******************************************************************************\r
- * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Tracealyzer v2.4.1 Recorder Library\r
* Percepio AB, www.percepio.com\r
*\r
* trcKernel.h\r
*\r
- * Functions used by trcHooks.h, for the FreeRTOS kernel integration.\r
+ * Functions used by trcKernelHooks.h.\r
*\r
* Terms of Use\r
* This software is copyright Percepio AB. The recorder library is free for\r
* use together with Percepio products. You may distribute the recorder library\r
- * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * in its original form, including modifications in trcHardwarePort.c/.h\r
* given that these modification are clearly marked as your own modifications\r
- * and documented in the initial comment section of these source files. \r
- * This software is the intellectual property of Percepio AB and may not be \r
- * sold or in other ways commercially redistributed without explicit written \r
+ * and documented in the initial comment section of these source files.\r
+ * This software is the intellectual property of Percepio AB and may not be\r
+ * sold or in other ways commercially redistributed without explicit written\r
* permission by Percepio AB.\r
*\r
- * Disclaimer \r
- * The trace tool and recorder library is being delivered to you AS IS and \r
- * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
- * not and cannot warrant the performance or results you may obtain by using the \r
- * software or documentation. Percepio AB make no warranties, express or \r
- * implied, as to noninfringement of third party rights, merchantability, or \r
- * fitness for any particular purpose. In no event will Percepio AB, its \r
- * technology partners, or distributors be liable to you for any consequential, \r
- * incidental or special damages, including any lost profits or lost savings, \r
- * even if a representative of Percepio AB has been advised of the possibility \r
- * of such damages, or for any claim by any third party. Some jurisdictions do \r
- * not allow the exclusion or limitation of incidental, consequential or special \r
- * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * Disclaimer\r
+ * The trace tool and recorder library is being delivered to you AS IS and\r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does\r
+ * not and cannot warrant the performance or results you may obtain by using the\r
+ * software or documentation. Percepio AB make no warranties, express or\r
+ * implied, as to noninfringement of third party rights, merchantability, or\r
+ * fitness for any particular purpose. In no event will Percepio AB, its\r
+ * technology partners, or distributors be liable to you for any consequential,\r
+ * incidental or special damages, including any lost profits or lost savings,\r
+ * even if a representative of Percepio AB has been advised of the possibility\r
+ * of such damages, or for any claim by any third party. Some jurisdictions do\r
+ * not allow the exclusion or limitation of incidental, consequential or special\r
+ * damages, or the exclusion of implied warranties or limitations on how long an\r
* implied warranty may last, so the above limitations may not apply to you.\r
*\r
- * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
- * You may use the premium features during 30 days for evaluation.\r
- * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
- *\r
- * Copyright Percepio AB, 2012.\r
+ * Copyright Percepio AB, 2013.\r
* www.percepio.com\r
******************************************************************************/\r
\r
#ifndef TRCKERNEL_H\r
#define TRCKERNEL_H\r
\r
-#include "trcBase.h"\r
+#include "trcKernelPort.h"\r
\r
-/* Internal functions */\r
+#if (USE_TRACEALYZER_RECORDER == 1)\r
\r
+/* Internal functions */\r
\r
#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
void vTraceStoreTaskReady(objectHandleType handle);\r
#endif\r
\r
-void vTraceStoreTaskswitch(void);\r
+void vTraceStoreTaskswitch(objectHandleType task_handle);\r
\r
-void vTraceStoreKernelCall(uint32_t eventcode, traceObjectClass objectClass, uint32_t byteParam); \r
+void vTraceStoreKernelCall(uint32_t eventcode, traceObjectClass objectClass, uint32_t byteParam);\r
\r
-void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, \r
- uint16_t param);\r
+void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode,\r
+ uint32_t param);\r
\r
-void vTraceStoreKernelCallWithParam(uint32_t evtcode, traceObjectClass objectClass, \r
+void vTraceStoreKernelCallWithParam(uint32_t evtcode, traceObjectClass objectClass,\r
uint32_t objectNumber, uint8_t param);\r
\r
void vTraceSetTaskInstanceFinished(objectHandleType handle);\r
\r
uint8_t uiTraceGetObjectState(uint8_t objectclass, uint8_t id);\r
\r
-#if (INCLUDE_OBJECT_DELETE == 1) \r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
\r
-void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle, \r
+void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle,\r
traceObjectClass objectclass);\r
\r
-void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle, \r
+void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle,\r
traceObjectClass objectclass);\r
#endif\r
\r
#define TASK_STATE_INSTANCE_ACTIVE 1\r
#define TASK_STATE_INSTANCE_MARKED_FINISHED 2\r
\r
-extern objectHandleType handle_of_running_task;\r
-\r
-/* This defines the mapping between FreeRTOS queue types and our internal \r
-class IDs */\r
-extern traceObjectClass TraceObjectClassTable[5];\r
-\r
-/*******************************************************************************\r
- * The event codes - should match the offline config file.\r
- * \r
- * Some sections below are encoded to allow for constructions like:\r
- *\r
- * vTraceStoreKernelCall(EVENTGROUP_CREATE + objectclass, ...\r
- *\r
- * The object class ID is given by the three LSB bits, in such cases. Since each \r
- * object class has a separate object property table, the class ID is needed to \r
- * know what section in the object table to use for getting an object name from\r
- * an object handle. \r
- ******************************************************************************/\r
-\r
-#define NULL_EVENT (0x00) /* Ignored in the analysis*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_RE\r
- *\r
- * Events that indicate that something is ready to execute.\r
- ******************************************************************************/\r
-#define EVENTGROUP_RE (NULL_EVENT + 2) /*0x02*/\r
-#define TR_TASK_READY (EVENTGROUP_RE + 0) /*0x02*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_TS\r
- *\r
- * Events for storing task-switches and interrupts. The RESUME events are \r
- * generated if the task/interrupt is already marked active.\r
- ******************************************************************************/\r
-#define EVENTGROUP_TS (EVENTGROUP_RE + 2) /*0x04*/\r
-#define TS_ISR_BEGIN (EVENTGROUP_TS + 0) /*0x04*/\r
-#define TS_ISR_RESUME (EVENTGROUP_TS + 1) /*0x05*/\r
-#define TS_TASK_BEGIN (EVENTGROUP_TS + 2) /*0x06*/\r
-#define TS_TASK_RESUME (EVENTGROUP_TS + 3) /*0x07*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_OBJCLOSE_NAME\r
- * \r
- * About Close Events\r
- * When an object is evicted from the object property table (object close), two \r
- * internal events are stored (EVENTGROUP_OBJCLOSE_NAME and \r
- * EVENTGROUP_OBJCLOSE_PROP), containg the handle-name mapping and object \r
- * properties valid up to this point.\r
- ******************************************************************************/\r
-#define EVENTGROUP_OBJCLOSE_NAME (EVENTGROUP_TS + 4) /*0x08*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_OBJCLOSE_PROP\r
- * \r
- * The internal event carrying properties of deleted objects\r
- * The handle and object class of the closed object is not stored in this event, \r
- * but is assumed to be the same as in the preceeding CLOSE event. Thus, these \r
- * two events must be generated from within a critical section. \r
- * When queues are closed, arg1 is the "state" property (i.e., number of \r
- * buffered messages/signals).\r
- * When actors are closed, arg1 is priority, arg2 is handle of the "instance \r
- * finish" event, and arg3 is event code of the "instance finish" event. \r
- * In this case, the lower three bits is the object class of the instance finish \r
- * handle. The lower three bits are not used (always zero) when queues are \r
- * closed since the queue type is given in the previous OBJCLOSE_NAME event.\r
- ******************************************************************************/\r
-#define EVENTGROUP_OBJCLOSE_PROP (EVENTGROUP_OBJCLOSE_NAME + 8) /*0x10*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_CREATE\r
- * \r
- * The events in this group are used to log Kernel object creations.\r
- * The lower three bits in the event code gives the object class, i.e., type of\r
- * create operation (task, queue, semaphore, etc).\r
- ******************************************************************************/\r
-#define EVENTGROUP_CREATE (EVENTGROUP_OBJCLOSE_PROP + 8) /*0x18*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_SEND\r
- * \r
- * The events in this group are used to log Send/Give events on queues, \r
- * semaphores and mutexeds The lower three bits in the event code gives the \r
- * object class, i.e., what type of object that is operated on (queue, semaphore \r
- * or mutex).\r
- ******************************************************************************/\r
-#define EVENTGROUP_SEND (EVENTGROUP_CREATE + 8) /*0x20*/\r
-\r
-/*******************************************************************************\r
- * EVENTGROUP_RECEIVE\r
- * \r
- * The events in this group are used to log Receive/Take events on queues, \r
- * semaphores and mutexes. The lower three bits in the event code gives the \r
- * object class, i.e., what type of object that is operated on (queue, semaphore\r
- * or mutex).\r
- ******************************************************************************/\r
-#define EVENTGROUP_RECEIVE (EVENTGROUP_SEND + 8) /*0x28*/\r
-\r
-/* Send/Give operations, from ISR */\r
-#define EVENTGROUP_SEND_FROM_ISR (EVENTGROUP_RECEIVE + 8) /*0x30*/\r
-\r
-/* Receive/Take operations, from ISR */\r
-#define EVENTGROUP_RECEIVE_FROM_ISR (EVENTGROUP_SEND_FROM_ISR + 8) /*0x38*/\r
-\r
-/* "Failed" event type versions of above (timeout, failed allocation, etc) */\r
-#define EVENTGROUP_FAILED_KSE (EVENTGROUP_RECEIVE_FROM_ISR + 8) /*0x40*/\r
-\r
-/* Failed create calls - memory allocation failed */\r
-#define EVENTGROUP_FAILED_CREATE (EVENTGROUP_FAILED_KSE) /*0x40*/\r
-\r
-/* Failed send/give - timeout! */\r
-#define EVENTGROUP_FAILED_SEND (EVENTGROUP_FAILED_CREATE + 8) /*0x48*/\r
-\r
-/* Failed receive/take - timeout! */\r
-#define EVENTGROUP_FAILED_RECEIVE (EVENTGROUP_FAILED_SEND + 8) /*0x50*/\r
-\r
-/* Failed non-blocking send/give - queue full */\r
-#define EVENTGROUP_FAILED_SEND_FROM_ISR (EVENTGROUP_FAILED_RECEIVE + 8) /*0x58*/\r
-\r
-/* Failed non-blocking receive/take - queue empty */\r
-#define EVENTGROUP_FAILED_RECEIVE_FROM_ISR \\r
- (EVENTGROUP_FAILED_SEND_FROM_ISR + 8) /*0x60*/\r
-\r
-/* Events when blocking on receive/take */\r
-#define EVENTGROUP_BLOCK_ON_RECEIVE \\r
- (EVENTGROUP_FAILED_RECEIVE_FROM_ISR + 8) /*0x68*/\r
-\r
-/* Events when blocking on send/give */\r
-#define EVENTGROUP_BLOCK_ON_SEND (EVENTGROUP_BLOCK_ON_RECEIVE + 8) /*0x70*/\r
-\r
-/* Events on queue peek (receive) */\r
-#define EVENTGROUP_PEEK (EVENTGROUP_BLOCK_ON_SEND + 8) /*0x78*/\r
-\r
-/* Events on object delete (vTaskDelete or vQueueDelete) */\r
-#define EVENTGROUP_DELETE (EVENTGROUP_PEEK + 8) /*0x80*/\r
-\r
-/* Other events - object class is implied: TASK */\r
-#define EVENTGROUP_OTHERS (EVENTGROUP_DELETE + 8) /*0x88*/\r
-#define TASK_DELAY_UNTIL (EVENTGROUP_OTHERS + 0) /*0x88*/\r
-#define TASK_DELAY (EVENTGROUP_OTHERS + 1) /*0x89*/\r
-#define TASK_SUSPEND (EVENTGROUP_OTHERS + 2) /*0x8A*/\r
-#define TASK_RESUME (EVENTGROUP_OTHERS + 3) /*0x8B*/\r
-#define TASK_RESUME_FROM_ISR (EVENTGROUP_OTHERS + 4) /*0x8C*/\r
-#define TASK_PRIORITY_SET (EVENTGROUP_OTHERS + 5) /*0x8D*/\r
-#define TASK_PRIORITY_INHERIT (EVENTGROUP_OTHERS + 6) /*0x8E*/\r
-#define TASK_PRIORITY_DISINHERIT (EVENTGROUP_OTHERS + 7) /*0x8F*/\r
-\r
-/* Not yet used */\r
-#define EVENTGROUP_FTRACE_PLACEHOLDER (EVENTGROUP_OTHERS + 8) /*0x90*/\r
-\r
-/* User events */\r
-#define EVENTGROUP_USEREVENT (EVENTGROUP_FTRACE_PLACEHOLDER + 8) /*0x98*/\r
-#define USER_EVENT (EVENTGROUP_USEREVENT + 0)\r
-\r
-/* Allow for 0-15 arguments (the number of args is added to event code) */\r
-#define USER_EVENT_LAST (EVENTGROUP_USEREVENT + 15) /*0xA7*/\r
-\r
-/*******************************************************************************\r
- * XTS Event - eXtended TimeStamp events\r
- * The timestamps used in the recorder are "differential timestamps" (DTS), i.e.\r
- * the time since the last stored event. The DTS fields are either 1 or 2 bytes \r
- * in the other events, depending on the bytes available in the event struct. \r
- * If the time since the last event (the DTS) is larger than allowed for by \r
- * the DTS field of the current event, an XTS event is inserted immidiatly \r
- * before the original event. The XTS event contains up to 3 additional bytes \r
- * of the DTS value - the higher bytes of the true DTS value. The lower 1-2 \r
- * bytes are stored in the normal DTS field. \r
- * There are two types of XTS events, XTS8 and XTS16. An XTS8 event is stored \r
- * when there is only room for 1 byte (8 bit) DTS data in the original event, \r
- * which means a limit of 0xFF (255). The XTS16 is used when the original event \r
- * has a 16 bit DTS field and thereby can handle values up to 0xFFFF (65535).\r
- * \r
- * Using a very high frequency time base can result in many XTS events. \r
- * Preferably, the time between two OS ticks should fit in 16 bits, i.e.,\r
- * at most 65535. If your time base has a higher frequency, you can define\r
- * the TRACE\r
- ******************************************************************************/\r
-\r
-#define EVENTGROUP_SYS (EVENTGROUP_USEREVENT + 16) /*0xA8*/\r
-#define XTS8 (EVENTGROUP_SYS + 0) /*0xA8*/\r
-#define XTS16 (EVENTGROUP_SYS + 1) /*0xA9*/\r
-\r
-#define EVENT_BEING_WRITTEN (EVENTGROUP_SYS + 2) /*0xAA*/\r
-\r
-#define RESERVED_DUMMY_CODE (EVENTGROUP_SYS + 3) /*0xAB*/\r
\r
#endif\r
+\r
+#endif
\ No newline at end of file