]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/FreeRTOS-Plus-Trace/Include/trcUser.h
Update the FreeRTOS+Trace recorder and Win32 demo app.
[freertos] / FreeRTOS-Plus / FreeRTOS-Plus-Trace / Include / trcUser.h
index 984bc16df436cf9c721bf35d67476ea5898ab836..3e80162fa9dcdbb747996a2cdbfb6ee9c4b0579f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************\r
- * FreeRTOS+Trace v2.2.3 Recorder Library\r
- * Percepio AB, www.percepio.se\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
  *\r
  * trcUser.h\r
  * The public API of the trace recorder library.\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.se/index.php?page=downloads\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
  *\r
  * Copyright Percepio AB, 2012.\r
- * www.percepio.se\r
+ * www.percepio.com\r
  ******************************************************************************/\r
 \r
 #ifndef TRCUSER_H\r
@@ -43,9 +43,9 @@
 \r
 #include "FreeRTOS.h"\r
 \r
-#if (configUSE_TRACE_FACILITY == 1)\r
+#include "trcKernel.h"\r
 \r
-#include "trcBase.h"\r
+#if (configUSE_TRACE_FACILITY == 1)\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
@@ -147,14 +147,22 @@ void vTraceSetQueueName(void* queue, const char* name);
  *         portEXIT_CRITICAL();\r
  *     }\r
  ******************************************************************************/\r
-void vTraceSetISRProperties(objectHandleType handle, char* name, char priority);\r
+void vTraceSetISRProperties(objectHandleType handle, const char* name, char priority);\r
 \r
 /*******************************************************************************\r
  * vTraceStoreISRBegin\r
  * \r
- * Registers the beginning of an Interrupt Service Routine. This must not be\r
- * interrupted by another ISR containing recorder library calls, so if allowing\r
- * nested ISRs this must be called with interrupts disabled.\r
+ * Registers the beginning of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
  *\r
  * Example:\r
  *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
@@ -178,9 +186,17 @@ void vTraceStoreISRBegin(objectHandleType id);
 /*******************************************************************************\r
  * vTraceStoreISREnd\r
  * \r
- * Registers the end of an Interrupt Service Routine. This must not be\r
- * interrupted by another ISR containing recorder library calls, so if allowing\r
- * nested ISRs this must be called with interrupts disabled.\r
+ * Registers the end of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
  *\r
  * Example:\r
  *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
@@ -202,12 +218,15 @@ void vTraceStoreISRBegin(objectHandleType id);
 void vTraceStoreISREnd(void);\r
 \r
 #else\r
-\r
    /* If not including the ISR recording */\r
 \r
-   #define vTraceSetISRProperties(handle, name, priority)\r
-   #define vTraceStoreISRBegin(id)\r
-   #define vTraceStoreISREnd()\r
+void vTraceIncreaseISRActive(void);\r
+\r
+void vTraceDecreaseISRActive(void);\r
+\r
+#define vTraceSetISRProperties(handle, name, priority)\r
+#define vTraceStoreISRBegin(id) vTraceIncreaseISRActive()\r
+#define vTraceStoreISREnd() vTraceDecreaseISRActive()\r
 \r
 #endif\r
 \r
@@ -290,7 +309,7 @@ uint32_t uiTraceGetTraceBufferSize(void);
  * executed and/or located in time-critical code. The lookup operation is\r
  * however fairly fast due to the design of the symbol table.\r
  ******************************************************************************/\r
-traceLabel xTraceOpenLabel(char* label);\r
+traceLabel xTraceOpenLabel(const char* label);\r
 \r
  /******************************************************************************\r
  * vTraceUserEvent\r
@@ -341,16 +360,21 @@ void vTraceUserEvent(traceLabel eventLabel);
  *  %hu - 16 bit unsigned integer\r
  *  %bd - 8 bit signed integer\r
  *  %bu - 8 bit unsigned integer\r
- *  %lf - double-precision float\r
+ *  %lf - double-precision float (Note! See below...)\r
  * \r
  * Up to 15 data arguments are allowed, with a total size of maximum 32 byte.\r
  * In case this is exceeded, the user event is changed into an error message.\r
  * \r
  * The data is stored in trace buffer, and is packed to allow storing multiple \r
  * smaller data entries in the same 4-byte record, e.g., four 8-bit values.\r
- * A string requires two bytes, as the symbol table is limited to 64K. Storing a \r
- * double (%lf) uses two records, so this is quite costly. Use float (%f) unless\r
- * the higher precision is really necessary.\r
+ * A string requires two bytes, as the symbol table is limited to 64K. Storing \r
+ * a double (%lf) uses two records, so this is quite costly. Use float (%f) \r
+ * unless the higher precision is really necessary.\r
+ * \r
+ * Note that the double-precision float (%lf) assumes a 64 bit double \r
+ * representation. This does not seem to be the case on e.g. PIC24F. \r
+ * Before using a %lf argument on a 16-bit MCU, please verify that \r
+ * "sizeof(double)" actually gives 8 as expected. If not, use %f instead.\r
  ******************************************************************************/ \r
 void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...);\r
 \r
@@ -363,14 +387,30 @@ void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...);
 #endif\r
 \r
 /******************************************************************************\r
- * vTraceExcludeTask\r
+ * vTraceExclude______FromTrace\r
  *\r
- * Excludes a task from the recording using a flag in the Object Property Table.\r
+ * Excludes a task or object from the trace.\r
  * This can be useful if some irrelevant task is very frequent and is "eating\r
- * up the buffer". This should be called the task has been created, but \r
+ * up the buffer". This should be called after the task has been created, but \r
  * before starting the FreeRTOS scheduler.\r
  *****************************************************************************/\r
-void vTraceExcludeTaskFromSchedulingTrace(const char* name);\r
+void vTraceExcludeQueueFromTrace(void* handle);\r
+void vTraceExcludeSemaphoreFromTrace(void* handle);\r
+void vTraceExcludeMutexFromTrace(void* handle);\r
+void vTraceExcludeTaskFromTrace(void* handle);\r
+void vTraceExcludeKernelServiceFromTrace(traceKernelService kernelService);\r
+\r
+/******************************************************************************\r
+ * vTraceInclude______InTrace\r
+ *\r
+ * Includes a task, object or kernel service in the trace. This is only\r
+ * necessary if the task or object has been previously exluded.\r
+ *****************************************************************************/\r
+void vTraceIncludeQueueInTrace(void* handle);\r
+void vTraceIncludeSemaphoreInTrace(void* handle);\r
+void vTraceIncludeMutexInTrace(void* handle);\r
+void vTraceIncludeTaskInTrace(void* handle);\r
+void vTraceIncludeKernelServiceInTrace(traceKernelService kernelService);\r
 \r
 #ifdef __cplusplus\r
 }\r
@@ -381,9 +421,12 @@ void vTraceExcludeTaskFromSchedulingTrace(const char* name);
 #include "trcPort.h"\r
 \r
 #define vTraceInit()\r
+#define uiTraceStart() (1)\r
 #define vTraceStart()\r
 #define vTraceStop()\r
 #define vTraceClear()\r
+#define vTraceStartStatusMonitor()\r
+#define vTracePortSetOutFile(f)\r
 #define vTraceGetTraceBuffer() ((void*)0)\r
 #define uiTraceGetTraceBufferSize() 0\r
 #define xTraceOpenLabel(label) 0\r
@@ -391,9 +434,11 @@ void vTraceExcludeTaskFromSchedulingTrace(const char* name);
 #define vTracePrintF(eventLabel,formatStr,...)\r
 #define vTraceExcludeTaskFromSchedulingTrace(name)\r
 #define vTraceSetQueueName(queue, name)\r
+\r
 #define vTraceTaskSkipDefaultInstanceFinishedEvents()\r
 #define vTraceSetISRProperties(handle, name, priority)\r
 #define vTraceStoreISRBegin(id)\r
 #define vTraceStoreISREnd()\r
 #endif\r
 #endif\r
+\r