mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250707_v5.4' into 'release/v5.4'
feat(tools): update openocd version to v0.12.0-esp32-20250707 (v5.4) See merge request espressif/esp-idf!40460
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
----------------------------------------------------------------------
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
@@ -100,6 +100,10 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined(__ARM_ARCH_8_1M_MAIN__)) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#else
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 0
|
||||
#endif
|
||||
@@ -130,6 +134,10 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
@@ -156,6 +164,10 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
@@ -271,6 +283,7 @@ Revision: $Rev: 25842 $
|
||||
#ifndef SEGGER_RTT_ASM // defined when SEGGER_RTT.h is included from assembly file
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
@@ -412,7 +425,7 @@ unsigned SEGGER_RTT_ReadUpBufferNoLock (unsigned BufferIndex, void* pDa
|
||||
unsigned SEGGER_RTT_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
unsigned SEGGER_RTT_WriteDownBufferNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
|
||||
#define SEGGER_RTT_HASDATA_UP(n) (((SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff) // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
|
||||
#define SEGGER_RTT_HASDATA_UP(n) (((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff) // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
|
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,14 +49,14 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
||||
File : SEGGER_SYSVIEW.c
|
||||
Purpose : System visualization API implementation.
|
||||
Revision: $Rev: 28341 $
|
||||
Revision: $Rev: 29105 $
|
||||
|
||||
Additional information:
|
||||
Packet format:
|
||||
@@ -66,10 +66,10 @@ Additional information:
|
||||
|
||||
Packets with IDs 24..31 are standard packets with extendible
|
||||
structure and contain a length field.
|
||||
<ID><Lenght><Data><TimeStampDelta>
|
||||
<ID><Length><Data><TimeStampDelta>
|
||||
|
||||
Packet ID 31 is used for SystemView extended events.
|
||||
<ID><Lenght><ID_EX><Data><TimeStampDelta>
|
||||
<ID><Length><ID_EX><Data><TimeStampDelta>
|
||||
|
||||
Packets with IDs >= 32 always contain a length field.
|
||||
<ID><Length><Data><TimeStampDelta>
|
||||
@@ -150,6 +150,7 @@ Additional information:
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include "SEGGER_SYSVIEW_Int.h"
|
||||
#include "SEGGER_RTT.h"
|
||||
|
||||
@@ -188,7 +189,7 @@ Additional information:
|
||||
// Timestamps may be less than full 32-bits, in which case we need to zero
|
||||
// the unused bits to properly handle overflows.
|
||||
// Note that this is a quite common scenario, as a 32-bit time such as
|
||||
// SysTick might be scaled down to reduce bandwith
|
||||
// SysTick might be scaled down to reduce bandwidth
|
||||
// or a 16-bit hardware time might be used.
|
||||
#if SEGGER_SYSVIEW_TIMESTAMP_BITS < 32 // Eliminate unused bits in case hardware timestamps are less than 32 bits
|
||||
#define MAKE_DELTA_32BIT(Delta) Delta <<= 32 - SEGGER_SYSVIEW_TIMESTAMP_BITS; \
|
||||
@@ -388,8 +389,6 @@ static U8 _NumModules;
|
||||
pDest = pSysviewPointer; \
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if (SEGGER_SYSVIEW_USE_STATIC_BUFFER == 1)
|
||||
static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
|
||||
|
||||
@@ -432,6 +431,9 @@ static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
|
||||
static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
unsigned int n;
|
||||
const U8* p;
|
||||
|
||||
// Espressif doesn't support larger packages yet. Encode data length must be less than 255.
|
||||
assert(NumBytes < 255);
|
||||
//
|
||||
n = 0;
|
||||
p = (const U8*)pSrc;
|
||||
@@ -442,8 +444,8 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
*pPayload++ = (U8)NumBytes;
|
||||
} else {
|
||||
*pPayload++ = 255;
|
||||
*pPayload++ = (NumBytes & 255);
|
||||
*pPayload++ = ((NumBytes >> 8) & 255);
|
||||
*pPayload++ = (NumBytes & 255);
|
||||
}
|
||||
while (n < NumBytes) {
|
||||
*pPayload++ = *p++;
|
||||
@@ -452,6 +454,38 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _EncodeFloat()
|
||||
*
|
||||
* Function description
|
||||
* Encode a float value in variable-length format.
|
||||
*
|
||||
* Parameters
|
||||
* pPayload - Pointer to where value will be encoded.
|
||||
* Value - Value to be encoded.
|
||||
*
|
||||
* Return value
|
||||
* Pointer to the byte following the value, i.e. the first free
|
||||
* byte in the payload and the next position to store payload
|
||||
* content.
|
||||
*/
|
||||
static U8* _EncodeFloat(U8* pPayload, float Value) {
|
||||
float Val = Value;
|
||||
U8* pSysviewPointer;
|
||||
U32* SysViewData;
|
||||
pSysviewPointer = pPayload;
|
||||
SysViewData = (U32*)&Val;
|
||||
while((*SysViewData) > 0x7F) {
|
||||
*pSysviewPointer++ = (U8)((*SysViewData) | 0x80);
|
||||
(*SysViewData) >>= 7;
|
||||
};
|
||||
*pSysviewPointer++ = (U8)(*SysViewData);
|
||||
pPayload = pSysviewPointer;
|
||||
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _EncodeStr()
|
||||
@@ -475,38 +509,42 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
* No more than 1 + Limit bytes will be encoded to the payload.
|
||||
*/
|
||||
static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
|
||||
unsigned int n;
|
||||
unsigned int Len;
|
||||
//
|
||||
// Compute string len
|
||||
//
|
||||
Len = 0;
|
||||
if (pText != NULL) {
|
||||
while(*(pText + Len) != 0) {
|
||||
Len++;
|
||||
}
|
||||
if (Len > Limit) {
|
||||
Len = Limit;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Write Len
|
||||
//
|
||||
if (Len < 255) {
|
||||
*pPayload++ = (U8)Len;
|
||||
U8* pLen;
|
||||
const char* sStart;
|
||||
|
||||
if (pText == NULL) {
|
||||
*pPayload++ = (U8)0;
|
||||
} else {
|
||||
*pPayload++ = 255;
|
||||
*pPayload++ = (Len & 255);
|
||||
*pPayload++ = ((Len >> 8) & 255);
|
||||
sStart = pText; // Remember start of string.
|
||||
//
|
||||
// Save space to store count byte(s).
|
||||
//
|
||||
pLen = pPayload++;
|
||||
#if (SEGGER_SYSVIEW_MAX_STRING_LEN >= 255) // Length always encodes in 3 bytes
|
||||
pPayload += 2;
|
||||
#endif
|
||||
//
|
||||
// Limit string to maximum length and copy into payload buffer.
|
||||
//
|
||||
if (Limit > SEGGER_SYSVIEW_MAX_STRING_LEN) {
|
||||
Limit = SEGGER_SYSVIEW_MAX_STRING_LEN;
|
||||
}
|
||||
while ((Limit-- > 0) && (*pText != '\0')) {
|
||||
*pPayload++ = *pText++;
|
||||
}
|
||||
//
|
||||
// Save string length to buffer.
|
||||
//
|
||||
#if (SEGGER_SYSVIEW_MAX_STRING_LEN >= 255) // Length always encodes in 3 bytes
|
||||
Limit = (unsigned int)(pText - sStart);
|
||||
*pLen++ = (U8)255;
|
||||
*pLen++ = (U8)((Limit >> 8) & 255);
|
||||
*pLen++ = (U8)(Limit & 255);
|
||||
#else // Length always encodes in 1 byte
|
||||
*pLen = (U8)(pText - sStart);
|
||||
#endif
|
||||
}
|
||||
//
|
||||
// copy string
|
||||
//
|
||||
n = 0;
|
||||
while (n < Len) {
|
||||
*pPayload++ = *pText++;
|
||||
n++;
|
||||
}
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
@@ -693,7 +731,6 @@ static void _SendSyncInfo(void) {
|
||||
for (n = 0; n < _NumModules; n++) {
|
||||
SEGGER_SYSVIEW_SendModule(n);
|
||||
}
|
||||
SEGGER_SYSVIEW_SendModuleDescription();
|
||||
}
|
||||
}
|
||||
#endif // (SEGGER_SYSVIEW_POST_MORTEM_MODE == 1)
|
||||
@@ -1218,6 +1255,7 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
||||
unsigned int FormatFlags;
|
||||
unsigned int FieldWidth;
|
||||
U8* pPayloadStart;
|
||||
const char* s;
|
||||
#if SEGGER_SYSVIEW_USE_STATIC_BUFFER == 0
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 1 + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
SEGGER_SYSVIEW_LOCK();
|
||||
@@ -1322,6 +1360,20 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
||||
v = va_arg(*pParamList, int);
|
||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, NumDigits, FieldWidth, FormatFlags);
|
||||
break;
|
||||
case 's':
|
||||
s = va_arg(*pParamList, const char*);
|
||||
if (s == NULL) {
|
||||
s = "(null)";
|
||||
}
|
||||
do {
|
||||
c = *s;
|
||||
s++;
|
||||
if (c == '\0') {
|
||||
break;
|
||||
}
|
||||
_StoreChar(&BufferDesc, c);
|
||||
} while (BufferDesc.Cnt < SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
break;
|
||||
case 'p':
|
||||
v = va_arg(*pParamList, int);
|
||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, 8u, 8u, 0u);
|
||||
@@ -1954,11 +2006,61 @@ void SEGGER_SYSVIEW_SendTaskInfo(const SEGGER_SYSVIEW_TASKINFO *pInfo) {
|
||||
ENCODE_U32(pPayload, SHRINK_ID(pInfo->TaskID));
|
||||
ENCODE_U32(pPayload, pInfo->StackBase);
|
||||
ENCODE_U32(pPayload, pInfo->StackSize);
|
||||
ENCODE_U32(pPayload, 0); // Stack End, future use
|
||||
ENCODE_U32(pPayload, pInfo->StackUsage);
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_STACK_INFO);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SendStackInfo()
|
||||
*
|
||||
* Function description
|
||||
* Send a Stack Info Packet, containing TaskId for identification,
|
||||
* stack base, stack size and stack usage.
|
||||
*
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Pointer to stack information to send.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_SendStackInfo(const SEGGER_SYSVIEW_STACKINFO *pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SHRINK_ID(pInfo->TaskID));
|
||||
ENCODE_U32(pPayload, pInfo->StackBase);
|
||||
ENCODE_U32(pPayload, pInfo->StackSize);
|
||||
ENCODE_U32(pPayload, pInfo->StackUsage);
|
||||
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SampleData()
|
||||
*
|
||||
* Function description
|
||||
* Send a Data Sample Packet, containing the data Id and the value.
|
||||
*
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Pointer to data sample struct to send.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_SampleData(const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, pInfo->ID);
|
||||
pPayload = _EncodeFloat(pPayload, *(pInfo->pFloat_Value));
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_DATA_SAMPLE);
|
||||
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SendTaskList()
|
||||
@@ -2448,6 +2550,63 @@ void SEGGER_SYSVIEW_NameResource(U32 ResourceId, const char* sName) {
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_RegisterData()
|
||||
*
|
||||
* Function description
|
||||
* Register data to sample the values via SystemView.
|
||||
*
|
||||
* Register functions are usually set in the system description
|
||||
* callback, to ensure it is only sent when the SystemView Application
|
||||
* is connected.
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Struct containing all possible properties that can be sent via this registration event.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_RegisterData(SEGGER_SYSVIEW_DATA_REGISTER* pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 8 * SEGGER_SYSVIEW_QUANTA_U32 + 1 + SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_REGISTER_DATA);
|
||||
ENCODE_U32(pPayload, pInfo->ID);
|
||||
pPayload = _EncodeStr(pPayload, pInfo->sName, SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
|
||||
if (pInfo->sName != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
pPayload = _EncodeFloat(pPayload, pInfo->ScalingFactor);
|
||||
pPayload = _EncodeStr(pPayload, pInfo->sUnit, SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
} else if (pInfo->ScalingFactor != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
pPayload = _EncodeFloat(pPayload, pInfo->ScalingFactor);
|
||||
} else if (pInfo->RangeMax != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
} else if (pInfo->RangeMin != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
} else if (pInfo->Offset != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
} else if (pInfo->DataType != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
}
|
||||
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapDefine()
|
||||
@@ -2820,9 +2979,6 @@ void SEGGER_SYSVIEW_RegisterModule(SEGGER_SYSVIEW_MODULE* pModule) {
|
||||
_NumModules++;
|
||||
}
|
||||
SEGGER_SYSVIEW_SendModule(0);
|
||||
if (pModule->pfSendModuleDesc) {
|
||||
pModule->pfSendModuleDesc();
|
||||
}
|
||||
SEGGER_SYSVIEW_UNLOCK();
|
||||
}
|
||||
|
||||
@@ -2906,6 +3062,9 @@ void SEGGER_SYSVIEW_SendModule(U8 ModuleId) {
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_MODULEDESC);
|
||||
RECORD_END();
|
||||
}
|
||||
if (pModule && pModule->pfSendModuleDesc) {
|
||||
pModule->pfSendModuleDesc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2986,6 +3145,39 @@ void SEGGER_SYSVIEW_PrintfHostEx(const char* s, U32 Options, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfHostEx()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the host by the SystemView Application
|
||||
* with Additional information.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* Options - Options for the string. i.e. Log level.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfHostEx(const char* s, U32 Options, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, Options, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, Options, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, Options, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfHost()
|
||||
@@ -3020,6 +3212,37 @@ void SEGGER_SYSVIEW_PrintfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the host by the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_LOG, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_WarnfHost()
|
||||
@@ -3055,6 +3278,38 @@ void SEGGER_SYSVIEW_WarnfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VWarnfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the host by
|
||||
* the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VWarnfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_WARNING, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_ErrorfHost()
|
||||
@@ -3090,6 +3345,38 @@ void SEGGER_SYSVIEW_ErrorfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VErrorfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the host by
|
||||
* the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VErrorfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfTargetEx()
|
||||
@@ -3110,6 +3397,23 @@ void SEGGER_SYSVIEW_PrintfTargetEx(const char* s, U32 Options, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfTargetEx()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the target before sent to
|
||||
* the host with Additional information.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* Options - Options for the string. i.e. Log level.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfTargetEx(const char* s, U32 Options, va_list *pParamList) {
|
||||
_VPrintTarget(s, Options, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfTarget()
|
||||
@@ -3129,6 +3433,22 @@ void SEGGER_SYSVIEW_PrintfTarget(const char* s, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the target before sent to
|
||||
* the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_WarnfTarget()
|
||||
@@ -3148,6 +3468,22 @@ void SEGGER_SYSVIEW_WarnfTarget(const char* s, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VWarnfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the target before
|
||||
* sent to the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VWarnfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_ErrorfTarget()
|
||||
@@ -3166,6 +3502,22 @@ void SEGGER_SYSVIEW_ErrorfTarget(const char* s, ...) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamList);
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VErrorfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print an error string which is formatted on the target before
|
||||
* sent to the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VErrorfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
}
|
||||
#endif // SEGGER_SYSVIEW_EXCLUDE_PRINTF
|
||||
|
||||
/*********************************************************************
|
||||
|
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,13 +49,13 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
File : SEGGER_SYSVIEW.h
|
||||
Purpose : System visualization API.
|
||||
Revision: $Rev: 28237 $
|
||||
Revision: $Rev: 28768 $
|
||||
*/
|
||||
|
||||
#ifndef SEGGER_SYSVIEW_H
|
||||
@@ -123,7 +123,7 @@ extern "C" {
|
||||
#define SYSVIEW_EVTID_TIMER_EXIT 20
|
||||
#define SYSVIEW_EVTID_STACK_INFO 21
|
||||
#define SYSVIEW_EVTID_MODULEDESC 22
|
||||
|
||||
#define SYSVIEW_EVTID_DATA_SAMPLE 23
|
||||
#define SYSVIEW_EVTID_INIT 24
|
||||
#define SYSVIEW_EVTID_NAME_RESOURCE 25
|
||||
#define SYSVIEW_EVTID_PRINT_FORMATTED 26
|
||||
@@ -135,12 +135,13 @@ extern "C" {
|
||||
//
|
||||
// SystemView extended events. Sent with ID 31.
|
||||
//
|
||||
#define SYSVIEW_EVTID_EX_MARK 0
|
||||
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
|
||||
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||
#define SYSVIEW_EVTID_EX_MARK 0
|
||||
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
|
||||
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||
#define SYSVIEW_EVTID_EX_REGISTER_DATA 6
|
||||
//
|
||||
// Event masks to disable/enable events
|
||||
//
|
||||
@@ -167,7 +168,7 @@ extern "C" {
|
||||
#define SYSVIEW_EVTMASK_TIMER_EXIT (1 << SYSVIEW_EVTID_TIMER_EXIT)
|
||||
#define SYSVIEW_EVTMASK_STACK_INFO (1 << SYSVIEW_EVTID_STACK_INFO)
|
||||
#define SYSVIEW_EVTMASK_MODULEDESC (1 << SYSVIEW_EVTID_MODULEDESC)
|
||||
|
||||
#define SYSVIEW_EVTMASK_DATA_SAMPLE (1 << SYSVIEW_EVTID_DATA_SAMPLE)
|
||||
#define SYSVIEW_EVTMASK_INIT (1 << SYSVIEW_EVTID_INIT)
|
||||
#define SYSVIEW_EVTMASK_NAME_RESOURCE (1 << SYSVIEW_EVTID_NAME_RESOURCE)
|
||||
#define SYSVIEW_EVTMASK_PRINT_FORMATTED (1 << SYSVIEW_EVTID_PRINT_FORMATTED)
|
||||
@@ -202,8 +203,42 @@ typedef struct {
|
||||
U32 Prio;
|
||||
U32 StackBase;
|
||||
U32 StackSize;
|
||||
U32 StackUsage;
|
||||
} SEGGER_SYSVIEW_TASKINFO;
|
||||
|
||||
typedef struct {
|
||||
U32 TaskID;
|
||||
U32 StackBase;
|
||||
U32 StackSize;
|
||||
U32 StackUsage;
|
||||
} SEGGER_SYSVIEW_STACKINFO;
|
||||
|
||||
typedef struct {
|
||||
U32 ID;
|
||||
union {
|
||||
U32* pU32_Value;
|
||||
I32* pI32_Value;
|
||||
float* pFloat_Value;
|
||||
};
|
||||
} SEGGER_SYSVIEW_DATA_SAMPLE;
|
||||
|
||||
typedef enum {
|
||||
SEGGER_SYSVIEW_TYPE_U32 = 0,
|
||||
SEGGER_SYSVIEW_TYPE_I32 = 1,
|
||||
SEGGER_SYSVIEW_TYPE_FLOAT = 2
|
||||
} SEGGER_SYSVIEW_DATA_TYPE;
|
||||
|
||||
typedef struct {
|
||||
U32 ID;
|
||||
SEGGER_SYSVIEW_DATA_TYPE DataType;
|
||||
I32 Offset;
|
||||
I32 RangeMin;
|
||||
I32 RangeMax;
|
||||
float ScalingFactor;
|
||||
const char* sName;
|
||||
const char* sUnit;
|
||||
} SEGGER_SYSVIEW_DATA_REGISTER;
|
||||
|
||||
typedef struct SEGGER_SYSVIEW_MODULE_STRUCT SEGGER_SYSVIEW_MODULE;
|
||||
|
||||
struct SEGGER_SYSVIEW_MODULE_STRUCT {
|
||||
@@ -247,8 +282,8 @@ EXTERN unsigned int SEGGER_SYSVIEW_InterruptId;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
U64 (*pfGetTime) (void);
|
||||
void (*pfSendTaskList) (void);
|
||||
U64 (*pfGetTime) (void);
|
||||
void (*pfSendTaskList) (void);
|
||||
} SEGGER_SYSVIEW_OS_API;
|
||||
|
||||
/*********************************************************************
|
||||
@@ -262,9 +297,13 @@ void SEGGER_SYSVIEW_Stop (void);
|
||||
void SEGGER_SYSVIEW_GetSysDesc (void);
|
||||
void SEGGER_SYSVIEW_SendTaskList (void);
|
||||
void SEGGER_SYSVIEW_SendTaskInfo (const SEGGER_SYSVIEW_TASKINFO* pInfo);
|
||||
void SEGGER_SYSVIEW_SendStackInfo (const SEGGER_SYSVIEW_STACKINFO* pInfo);
|
||||
void SEGGER_SYSVIEW_SendSysDesc (const char* sSysDesc);
|
||||
int SEGGER_SYSVIEW_IsStarted (void);
|
||||
int SEGGER_SYSVIEW_GetChannelID (void);
|
||||
|
||||
void SEGGER_SYSVIEW_SampleData (const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo);
|
||||
|
||||
// Checks whether tracing has been started
|
||||
U8 SEGGER_SYSVIEW_Started(void);
|
||||
|
||||
@@ -311,6 +350,7 @@ void SEGGER_SYSVIEW_HeapAllocEx (void* pHeap, void* pUserData,
|
||||
void SEGGER_SYSVIEW_HeapFree (void* pHeap, void* pUserData);
|
||||
|
||||
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
|
||||
void SEGGER_SYSVIEW_RegisterData ( SEGGER_SYSVIEW_DATA_REGISTER* pInfo);
|
||||
|
||||
int SEGGER_SYSVIEW_SendPacket (U8* pPacket, U8* pPayloadEnd, unsigned int EventId);
|
||||
|
||||
@@ -341,13 +381,21 @@ void SEGGER_SYSVIEW_SendNumModules (void);
|
||||
*/
|
||||
#ifndef SEGGER_SYSVIEW_EXCLUDE_PRINTF // Define in project to avoid warnings about variable parameter list
|
||||
void SEGGER_SYSVIEW_PrintfHostEx (const char* s, U32 Options, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfHostEx (const char* s, U32 Options, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfTargetEx (const char* s, U32 Options, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfTargetEx (const char* s, U32 Options, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfTarget (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_WarnfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VWarnfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_WarnfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VWarnfTarget (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_ErrorfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VErrorfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VErrorfTarget (const char* s, va_list* pParamList);
|
||||
#endif
|
||||
|
||||
void SEGGER_SYSVIEW_Print (const char* s);
|
||||
|
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
@@ -72,6 +72,8 @@ Revision: $Rev: 26230 $
|
||||
#include "SEGGER_SYSVIEW_Conf.h"
|
||||
#include "SEGGER_RTT_Conf.h"
|
||||
|
||||
#include "esp_assert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -370,12 +372,14 @@ extern "C" {
|
||||
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
|
||||
#endif
|
||||
|
||||
ESP_STATIC_ASSERT(SEGGER_SYSVIEW_MAX_STRING_LEN < 255, "SEGGER Sysview string length must be less than 255.");
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
|
||||
*
|
||||
* Description
|
||||
* It set, support enconding Evend Ids longer than 14 bit.
|
||||
* It set, support encoding Evend Ids longer than 14 bit.
|
||||
* Default
|
||||
* 1
|
||||
*/
|
||||
@@ -388,7 +392,7 @@ extern "C" {
|
||||
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
|
||||
*
|
||||
* Description
|
||||
* It set, support enconding event data longer than 14 bit.
|
||||
* It set, support encoding event data longer than 14 bit.
|
||||
* Default
|
||||
* 0
|
||||
*/
|
||||
@@ -517,7 +521,7 @@ extern "C" {
|
||||
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
|
||||
*
|
||||
* Description
|
||||
* Configure how frequently syncronization is sent in post-mortem
|
||||
* Configure how frequently synchronization is sent in post-mortem
|
||||
* mode.
|
||||
* Default
|
||||
* 8: (1 << 8) = Every 256 Events.
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.42 *
|
||||
* SystemView version: 3.56 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name: 'SystemView'
|
||||
version: '3.42'
|
||||
version: '3.56'
|
||||
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
|
||||
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
||||
originator: 'Organization: SEGGER Microcontroller GmbH'
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2017-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2017-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
@@ -84,11 +84,7 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
|
||||
// The target device name
|
||||
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
|
||||
// The target core name
|
||||
#if CONFIG_IDF_TARGET_ARCH_XTENSA
|
||||
#define SYSVIEW_CORE_NAME "xtensa"
|
||||
#elif CONFIG_IDF_TARGET_ARCH_RISCV
|
||||
#define SYSVIEW_CORE_NAME "riscv"
|
||||
#endif
|
||||
#define SYSVIEW_CORE_NAME "core0" // In dual core, this will be renamed by OpenOCD as core1
|
||||
|
||||
// Determine which timer to use as timestamp source
|
||||
#if CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
|
||||
|
@@ -67,7 +67,7 @@ These third party libraries can be included into the application (firmware) prod
|
||||
|
||||
* :component:`HTTP Parser <http_parser>` is based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev. Additional changes are licensed under the same terms as NGINX and Joyent, Inc. and other Node contributors. For details please check :component_file:`LICENSE file <http_parser/LICENSE.txt>`.
|
||||
|
||||
* `SEGGER SystemView`_ target-side library, Copyright (C) 1995-2021 SEGGER Microcontroller GmbH, is licensed under BSD 1-clause license.
|
||||
* `SEGGER SystemView`_ target-side library, Copyright (C) 1995-2024 SEGGER Microcontroller GmbH, is licensed under BSD 1-clause license.
|
||||
|
||||
* `protobuf-c`_ is Protocol Buffers implementation in C, Copyright (C) 2008-2022 Dave Benson and the protobuf-c authors. For details please check :component_file:`LICENSE file <protobuf-c/protobuf-c/LICENSE>`.
|
||||
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``target/esp32-solo-1.cfg``
|
||||
- Target configuration file for ESP32-SOLO-1 module. Different from ``esp32.cfg`` in that it only configures one CPU.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-WROVER-KIT and ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -94,7 +94,7 @@
|
||||
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||
* - ``target/esp32c2.cfg``
|
||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32-C3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C3.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C5.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -102,7 +102,7 @@
|
||||
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C6.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C61.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -107,7 +107,7 @@
|
||||
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-P4.
|
||||
* - ``interface/ftdi/esp32p4_ftdi.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -92,7 +92,7 @@
|
||||
- ESP32-S2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||
- JTAG adapter configuration file for ESP32-S2-Kaluga-1 board.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -101,7 +101,7 @@
|
||||
- ESP32-S3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-S3 builtin USB JTAG.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog debug adapter board.
|
||||
|
||||
---
|
||||
|
@@ -67,7 +67,7 @@
|
||||
|
||||
* :component:`HTTP 解析器 <http_parser>` 基于 NGINX 中的 src/http/ngx_http_parse.c 文件,版权归 Igor Sysoev 所有。任何对源代码的额外修改经过与 NGINX、Joyent 公司及其他 Node 贡献者相同条款的许可。详情请参阅 :component_file:`LICENSE 文件 <http_parser/LICENSE.txt>`。
|
||||
|
||||
* `SEGGER SystemView`_ 目标端库,版权归 1995-2021 赛格集团所有,并根据一条款 BSD 许可证进行许可。
|
||||
* `SEGGER SystemView`_ 目标端库,版权归 1995-2024 赛格集团所有,并根据一条款 BSD 许可证进行许可。
|
||||
|
||||
* `protobuf-c`_ 是 C 语言的 Protocol Buffers 实现,版权归 2008-2022 Dave Benson 及 protobuf-c 作者所有。详情请参阅 :component_file:`LICENSE 文件 <protobuf-c/protobuf-c/LICENSE>`。
|
||||
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32 的目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``target/esp32-solo-1.cfg``
|
||||
- ESP32-SOLO-1 模组的目标配置文件,和 ``esp32.cfg`` 的差别在于它仅配置一个 CPU
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-WROVER-KIT 和 ESP-Prog 的 JTAG 适配器配置文件
|
||||
|
||||
---
|
||||
|
@@ -94,7 +94,7 @@
|
||||
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||
* - ``target/esp32c2.cfg``
|
||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32-C3 目标配置文件。可以和某个 ``interface/`` 下的配置文件一同使用。
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- 适用于 ESP32-C3 的 JTAG 适配器配置文件。
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C5.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -102,7 +102,7 @@
|
||||
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C6.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C61.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -107,7 +107,7 @@
|
||||
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-P4.
|
||||
* - ``interface/ftdi/esp32p4_ftdi.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -92,7 +92,7 @@
|
||||
- ESP32-S2 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||
- 适用于 ESP32-S2-Kaluga-1 开发板的 JTAG 适配器配置文件
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 板的 JTAG 适配器配置文件
|
||||
|
||||
---
|
||||
|
@@ -101,7 +101,7 @@
|
||||
- ESP32-S3 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||
- 适用于 ESP32-S3 的 JTAG 适配器配置文件。
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||
|
||||
---
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,47 +1,149 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This is python script to process various types trace data streams in SystemView format.
|
||||
# Trace data can be provided in multiple trace files (one per CPU). After processing phase
|
||||
# script prints report for every type of trace data stream which was found.
|
||||
#
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import logging
|
||||
import os.path
|
||||
import signal
|
||||
import sys
|
||||
import tempfile
|
||||
import traceback
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import espytrace.apptrace as apptrace
|
||||
import espytrace.sysview as sysview
|
||||
|
||||
|
||||
def main():
|
||||
def is_segger_multicore_format(file_path):
|
||||
"""Check if the file has offsets in header"""
|
||||
try:
|
||||
url = urlparse(file_path)
|
||||
if len(url.scheme) == 0 or url.scheme == 'file':
|
||||
with open(url.path, 'rb') as f:
|
||||
header = f.read(200)
|
||||
header_str = header.decode('utf-8', errors='ignore')
|
||||
if (
|
||||
'; Version SEGGER SystemViewer' in header_str
|
||||
and '; Author Espressif Inc' in header_str
|
||||
and '; Offset Core0' in header_str
|
||||
and '; Offset Core1' in header_str
|
||||
):
|
||||
return True
|
||||
except Exception as e:
|
||||
logging.error('Error checking SEGGER multicore file format:', e)
|
||||
return False
|
||||
|
||||
verbosity_levels = [
|
||||
logging.CRITICAL,
|
||||
logging.ERROR,
|
||||
logging.WARNING,
|
||||
logging.INFO,
|
||||
logging.DEBUG
|
||||
]
|
||||
|
||||
def split_segger_multicore_file(file_path):
|
||||
"""Split SEGGER multicore file into separate core files."""
|
||||
try:
|
||||
with open(urlparse(file_path).path, 'rb') as f:
|
||||
# Read first few lines to get offsets for each core
|
||||
header = f.read(200)
|
||||
header_str = header.decode('utf-8', errors='ignore')
|
||||
|
||||
core1_offset = None
|
||||
for line in header_str.split('\n'):
|
||||
if '; Offset Core1' in line:
|
||||
core1_offset = int(line.strip().split()[-1])
|
||||
|
||||
if core1_offset is None:
|
||||
logging.error('Failed to parse core1 offset')
|
||||
return None, None
|
||||
|
||||
# Read the entire file
|
||||
f.seek(0)
|
||||
data = f.read()
|
||||
|
||||
# Find first 10 sync bytes start offset
|
||||
sync_start = data.find(b'\x00' * 10)
|
||||
if sync_start == -1:
|
||||
logging.error('Sync bytes not found')
|
||||
return None, None
|
||||
|
||||
core0_offset = sync_start
|
||||
core1_offset += sync_start
|
||||
|
||||
# Parse original header and get version from there, if not found, use default version
|
||||
version = 'V3.60'
|
||||
for line in header_str.split('\n'):
|
||||
if '; Version SEGGER SystemViewer' in line:
|
||||
version = line.strip().split()[-1]
|
||||
break
|
||||
|
||||
# Rebuild header without offset lines
|
||||
core_header = f';\n; Version SEGGER SystemViewer {version}\n; Author Espressif Inc\n;\n'
|
||||
core_header = core_header.encode('utf-8')
|
||||
core_base = core_header + b'\x00' * 10
|
||||
|
||||
core0_data = core_base + data[core0_offset:core1_offset]
|
||||
core1_data = core_base + data[core1_offset:]
|
||||
|
||||
core0_file = tempfile.NamedTemporaryFile(delete=False, suffix='.svdat')
|
||||
core1_file = tempfile.NamedTemporaryFile(delete=False, suffix='.svdat')
|
||||
|
||||
core0_file.write(core0_data)
|
||||
core1_file.write(core1_data)
|
||||
|
||||
core0_file.close()
|
||||
core1_file.close()
|
||||
|
||||
return core0_file.name, core1_file.name
|
||||
|
||||
except Exception as e:
|
||||
logging.error('Failed to process files:', e)
|
||||
return None, None
|
||||
|
||||
|
||||
def main():
|
||||
verbosity_levels = [logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
|
||||
|
||||
parser = argparse.ArgumentParser(description='ESP32 SEGGER SystemView Trace Parsing Tool')
|
||||
|
||||
parser.add_argument('trace_sources', help='Trace data sources. Format: [file://]/path/to/file.', nargs='+', type=str)
|
||||
parser.add_argument(
|
||||
'trace_sources', help='Trace data sources. Format: [file://]/path/to/file.', nargs='+', type=str
|
||||
)
|
||||
parser.add_argument('--elf-file', '-b', help='Path to program ELF file.', type=str, default='')
|
||||
parser.add_argument('--tmo', '-w', help='Data wait timeout in sec. -1: infinite, 0: no wait', type=int, default=0)
|
||||
parser.add_argument('--dump-events', '-d', help='Dump all events.', action='store_true')
|
||||
parser.add_argument('--print-events', '-p', help='Print events of selected types. By default only reports are printed', action='store_true')
|
||||
parser.add_argument('--include-events', '-i', help='Events types to be included into report.', type=str, choices=['heap', 'log', 'all'], default='all')
|
||||
parser.add_argument(
|
||||
'--print-events',
|
||||
'-p',
|
||||
help='Print events of selected types. By default only reports are printed',
|
||||
action='store_true',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--include-events',
|
||||
'-i',
|
||||
help='Events types to be included into report.',
|
||||
type=str,
|
||||
choices=['heap', 'log', 'all'],
|
||||
default='all',
|
||||
)
|
||||
parser.add_argument('--toolchain', '-t', help='Toolchain prefix.', type=str, default='xtensa-esp32-elf-')
|
||||
parser.add_argument('--events-map', '-e', help='Events map file.', type=str, default=os.path.join(os.path.dirname(__file__), 'SYSVIEW_FreeRTOS.txt'))
|
||||
parser.add_argument(
|
||||
'--events-map',
|
||||
'-e',
|
||||
help='Events map file.',
|
||||
type=str,
|
||||
default=os.path.join(os.path.dirname(__file__), 'SYSVIEW_FreeRTOS.txt'),
|
||||
)
|
||||
parser.add_argument('--to-json', '-j', help='Print JSON.', action='store_true', default=False)
|
||||
parser.add_argument('--verbose', '-v', help='Verbosity level. Default 1', choices=range(0, len(verbosity_levels)), type=int, default=1)
|
||||
parser.add_argument(
|
||||
'--verbose',
|
||||
'-v',
|
||||
help='Verbosity level. Default 1',
|
||||
choices=range(0, len(verbosity_levels)),
|
||||
type=int,
|
||||
default=1,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
def sig_int_handler(signum, frame):
|
||||
@@ -60,17 +162,33 @@ def main():
|
||||
|
||||
logging.basicConfig(level=verbosity_levels[args.verbose], format='[%(levelname)s] %(message)s')
|
||||
|
||||
temp_files = []
|
||||
# Only check for SEGGER format if there's exactly one trace source
|
||||
if len(args.trace_sources) == 1:
|
||||
trace_source = args.trace_sources[0]
|
||||
if is_segger_multicore_format(trace_source):
|
||||
core0_file, core1_file = split_segger_multicore_file(trace_source)
|
||||
if core0_file and core1_file:
|
||||
temp_files.extend([core0_file, core1_file])
|
||||
args.trace_sources = temp_files
|
||||
else:
|
||||
sys.exit(2)
|
||||
|
||||
# parse trace files
|
||||
parsers = []
|
||||
for i, trace_source in enumerate(args.trace_sources):
|
||||
try:
|
||||
parser = sysview.SysViewMultiTraceDataParser(print_events=False, core_id=i)
|
||||
if include_events['heap']:
|
||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i))
|
||||
parser.add_stream_parser(
|
||||
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i),
|
||||
)
|
||||
if include_events['log']:
|
||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i))
|
||||
parser.add_stream_parser(
|
||||
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i),
|
||||
)
|
||||
parsers.append(parser)
|
||||
except Exception as e:
|
||||
logging.error('Failed to create data parser (%s)!', e)
|
||||
@@ -97,13 +215,21 @@ def main():
|
||||
|
||||
# merge and process traces
|
||||
try:
|
||||
proc = sysview.SysViewMultiStreamTraceDataProcessor(traces=parsers, print_events=args.dump_events, keep_all_events=True if args.to_json else False)
|
||||
proc = sysview.SysViewMultiStreamTraceDataProcessor(
|
||||
traces=parsers, print_events=args.dump_events, keep_all_events=True if args.to_json else False
|
||||
)
|
||||
if include_events['heap']:
|
||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataProcessor(args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events))
|
||||
proc.add_stream_processor(
|
||||
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataProcessor(
|
||||
args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events
|
||||
),
|
||||
)
|
||||
if include_events['log']:
|
||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events))
|
||||
proc.add_stream_processor(
|
||||
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events),
|
||||
)
|
||||
except Exception as e:
|
||||
logging.error('Failed to create data processor (%s)!', e)
|
||||
traceback.print_exc()
|
||||
@@ -119,11 +245,21 @@ def main():
|
||||
sys.exit(2)
|
||||
finally:
|
||||
if args.to_json:
|
||||
print(json.dumps(proc, cls=sysview.SysViewTraceDataJsonEncoder, indent=4, separators=(',', ': '), sort_keys=True))
|
||||
print(
|
||||
json.dumps(
|
||||
proc, cls=sysview.SysViewTraceDataJsonEncoder, indent=4, separators=(',', ': '), sort_keys=True
|
||||
)
|
||||
)
|
||||
else:
|
||||
proc.print_report()
|
||||
proc.cleanup()
|
||||
|
||||
for file in temp_files:
|
||||
try:
|
||||
os.remove(file)
|
||||
except Exception as e:
|
||||
logging.warning('Failed to remove temporary file %s: %s', file, e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
```
|
||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
||||
xtensa-esp32-elf-gdb -x gdbinit build/sysview_tracing_heap_log.elf
|
||||
xtensa-esp32-elf-gdb -x $IDF_PATH/tools/esp_app_trace/test/sysview/gdbinit build/sysview_tracing_heap_log.elf
|
||||
```
|
||||
When program stops at `heap_trace_stop` quit GDB and OpenOCD
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
```
|
||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
||||
xtensa-esp32-elf-gdb -x gdbinit-mcore build/sysview_tracing_heap_log.elf
|
||||
xtensa-esp32-elf-gdb -x $IDF_PATH/tools/esp_app_trace/test/sysview/gdbinit-mcore build/sysview_tracing_heap_log.elf
|
||||
```
|
||||
When program stops at `heap_trace_stop` quit GDB and OpenOCD
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
You can use the commands from the `test.sh` to generate expected result files
|
||||
|
||||
```
|
||||
cd $IDF_PATH/tools/esp_app_trace/test/sysview/
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &> expected_output
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &> expected_output.json
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &> expected_output_mcore
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,29 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &>> output \
|
||||
&& diff output expected_output \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat >> output && \
|
||||
diff output expected_output && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output.json \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &>> output.json \
|
||||
&& diff output.json expected_output.json \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output.json && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat >> output.json && \
|
||||
diff output.json expected_output.json && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output \
|
||||
&& diff output expected_output_mcore \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat >> output && \
|
||||
diff output expected_output_mcore && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output.json \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output.json \
|
||||
&& diff output.json expected_output_mcore.json \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output.json && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat >> output.json && \
|
||||
diff output.json expected_output_mcore.json && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
@@ -605,46 +605,46 @@
|
||||
"versions": [
|
||||
{
|
||||
"linux-amd64": {
|
||||
"sha256": "eb1fa9b21c65b45a2200af6dcc2914e32335d37b6dbbd181778dcc0dc025e70a",
|
||||
"size": 2445546,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-amd64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "766293bd7a08900d3536f87a0a7ade960f07266f16e4147f95ca5ce4e15d4c5d",
|
||||
"size": 2489724,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-amd64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-arm64": {
|
||||
"sha256": "f70334a9b12a75b4d943e09fa5db30973037c39dbb54d6fa9f1a7118228b3d1c",
|
||||
"size": 2330926,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-arm64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "34b6883c372444b49950893b2fc0101aefd10d404a88ef72c97e80199f8544d3",
|
||||
"size": 2371243,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-arm64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-armel": {
|
||||
"sha256": "4ac34d6fd1af86aeda87c8318732f8d691c300c285c7fd2f5037c432c63fbbb3",
|
||||
"size": 2470732,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-armel-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "fd48492cf3ee16577c661fdccc14c349d34a9ab93aac5039ddf72332d4f4b70b",
|
||||
"size": 2517680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-armel-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-armhf": {
|
||||
"sha256": "75372bdbcef2df64013dd36c88836e1029c52955941b69ca463397ccbd287c21",
|
||||
"size": 2310816,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-armhf-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "a468cc108578a1f4553ac0502c814d47791ef79f5997a31e941908fa5119de9c",
|
||||
"size": 2353427,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-armhf-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"macos": {
|
||||
"sha256": "9186a7a06304c6d9201cbce4ee3c7099b393bf8d329cda17a68874f92308f6ce",
|
||||
"size": 2548730,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "6267be53892a76d535938a1b044b685adc7d292f090447e8a3e3d0f0996474d1",
|
||||
"size": 2585348,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-macos-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"macos-arm64": {
|
||||
"sha256": "2cc39318d52f393233ff1f777871aebe5b97b3fbad29556a238489263401b774",
|
||||
"size": 2593819,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-arm64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "150e938ac48a6ee031ddbc8b31043bc7f2073ab2ee4896b658918d35899673c3",
|
||||
"size": 2628741,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-macos-arm64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"name": "v0.12.0-esp32-20250422",
|
||||
"name": "v0.12.0-esp32-20250707",
|
||||
"status": "recommended",
|
||||
"win32": {
|
||||
"sha256": "ecb4f8533fa9098d10000f5f7e8b8eaa8591015b824b481078ddb2b37e7aa6f2",
|
||||
"size": 2988859,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win32-0.12.0-esp32-20250422.zip"
|
||||
"sha256": "666274b04af7f36b430b6d063006051c37b8635b5175735ad5af07a1fbc6f486",
|
||||
"size": 3034680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-win32-0.12.0-esp32-20250707.zip"
|
||||
},
|
||||
"win64": {
|
||||
"sha256": "e9eae8e1a8d0e030cd81dcb08394a9137cb7338a6211dfabcdbdfb37b58c5a23",
|
||||
"size": 2988858,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win64-0.12.0-esp32-20250422.zip"
|
||||
"sha256": "5186ba3f7ee29fb6ab68a4ed7bb417211bad76ecdcdf9280a9187ebfd549a3c1",
|
||||
"size": 3034680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-win64-0.12.0-esp32-20250707.zip"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Reference in New Issue
Block a user