mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24: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 *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* 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 *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* www.segger.com Support: support@segger.com *
|
||||||
* *
|
* *
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* SystemView version: 3.42 *
|
* SystemView version: 3.56 *
|
||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
---------------------------END-OF-HEADER------------------------------
|
---------------------------END-OF-HEADER------------------------------
|
||||||
@@ -100,6 +100,10 @@ Revision: $Rev: 25842 $
|
|||||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||||
#define _CORE_NEEDS_DMB 1
|
#define _CORE_NEEDS_DMB 1
|
||||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
#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
|
#else
|
||||||
#define _CORE_HAS_RTT_ASM_SUPPORT 0
|
#define _CORE_HAS_RTT_ASM_SUPPORT 0
|
||||||
#endif
|
#endif
|
||||||
@@ -130,6 +134,10 @@ Revision: $Rev: 25842 $
|
|||||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||||
#define _CORE_NEEDS_DMB 1
|
#define _CORE_NEEDS_DMB 1
|
||||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
#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
|
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||||
#define _CORE_NEEDS_DMB 1
|
#define _CORE_NEEDS_DMB 1
|
||||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||||
@@ -156,6 +164,10 @@ Revision: $Rev: 25842 $
|
|||||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||||
#define _CORE_NEEDS_DMB 1
|
#define _CORE_NEEDS_DMB 1
|
||||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
#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
|
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||||
#define _CORE_NEEDS_DMB 1
|
#define _CORE_NEEDS_DMB 1
|
||||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
#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
|
#ifndef SEGGER_RTT_ASM // defined when SEGGER_RTT.h is included from assembly file
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.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_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||||
unsigned SEGGER_RTT_WriteDownBufferNoLock (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-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 *
|
* SEGGER Microcontroller GmbH *
|
||||||
* The Embedded Experts *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* www.segger.com Support: support@segger.com *
|
||||||
* *
|
* *
|
||||||
@@ -49,14 +49,14 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* SystemView version: 3.42 *
|
* SystemView version: 3.56 *
|
||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
-------------------------- END-OF-HEADER -----------------------------
|
-------------------------- END-OF-HEADER -----------------------------
|
||||||
|
|
||||||
File : SEGGER_SYSVIEW.c
|
File : SEGGER_SYSVIEW.c
|
||||||
Purpose : System visualization API implementation.
|
Purpose : System visualization API implementation.
|
||||||
Revision: $Rev: 28341 $
|
Revision: $Rev: 29105 $
|
||||||
|
|
||||||
Additional information:
|
Additional information:
|
||||||
Packet format:
|
Packet format:
|
||||||
@@ -66,10 +66,10 @@ Additional information:
|
|||||||
|
|
||||||
Packets with IDs 24..31 are standard packets with extendible
|
Packets with IDs 24..31 are standard packets with extendible
|
||||||
structure and contain a length field.
|
structure and contain a length field.
|
||||||
<ID><Lenght><Data><TimeStampDelta>
|
<ID><Length><Data><TimeStampDelta>
|
||||||
|
|
||||||
Packet ID 31 is used for SystemView extended events.
|
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.
|
Packets with IDs >= 32 always contain a length field.
|
||||||
<ID><Length><Data><TimeStampDelta>
|
<ID><Length><Data><TimeStampDelta>
|
||||||
@@ -150,6 +150,7 @@ Additional information:
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <assert.h>
|
||||||
#include "SEGGER_SYSVIEW_Int.h"
|
#include "SEGGER_SYSVIEW_Int.h"
|
||||||
#include "SEGGER_RTT.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
|
// Timestamps may be less than full 32-bits, in which case we need to zero
|
||||||
// the unused bits to properly handle overflows.
|
// the unused bits to properly handle overflows.
|
||||||
// Note that this is a quite common scenario, as a 32-bit time such as
|
// 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.
|
// 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
|
#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; \
|
#define MAKE_DELTA_32BIT(Delta) Delta <<= 32 - SEGGER_SYSVIEW_TIMESTAMP_BITS; \
|
||||||
@@ -388,8 +389,6 @@ static U8 _NumModules;
|
|||||||
pDest = pSysviewPointer; \
|
pDest = pSysviewPointer; \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (SEGGER_SYSVIEW_USE_STATIC_BUFFER == 1)
|
#if (SEGGER_SYSVIEW_USE_STATIC_BUFFER == 1)
|
||||||
static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
|
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) {
|
static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
const U8* p;
|
const U8* p;
|
||||||
|
|
||||||
|
// Espressif doesn't support larger packages yet. Encode data length must be less than 255.
|
||||||
|
assert(NumBytes < 255);
|
||||||
//
|
//
|
||||||
n = 0;
|
n = 0;
|
||||||
p = (const U8*)pSrc;
|
p = (const U8*)pSrc;
|
||||||
@@ -442,8 +444,8 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
|||||||
*pPayload++ = (U8)NumBytes;
|
*pPayload++ = (U8)NumBytes;
|
||||||
} else {
|
} else {
|
||||||
*pPayload++ = 255;
|
*pPayload++ = 255;
|
||||||
*pPayload++ = (NumBytes & 255);
|
|
||||||
*pPayload++ = ((NumBytes >> 8) & 255);
|
*pPayload++ = ((NumBytes >> 8) & 255);
|
||||||
|
*pPayload++ = (NumBytes & 255);
|
||||||
}
|
}
|
||||||
while (n < NumBytes) {
|
while (n < NumBytes) {
|
||||||
*pPayload++ = *p++;
|
*pPayload++ = *p++;
|
||||||
@@ -452,6 +454,38 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
|||||||
return pPayload;
|
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()
|
* _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.
|
* No more than 1 + Limit bytes will be encoded to the payload.
|
||||||
*/
|
*/
|
||||||
static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
|
static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
|
||||||
unsigned int n;
|
U8* pLen;
|
||||||
unsigned int Len;
|
const char* sStart;
|
||||||
//
|
|
||||||
// Compute string len
|
if (pText == NULL) {
|
||||||
//
|
*pPayload++ = (U8)0;
|
||||||
Len = 0;
|
|
||||||
if (pText != NULL) {
|
|
||||||
while(*(pText + Len) != 0) {
|
|
||||||
Len++;
|
|
||||||
}
|
|
||||||
if (Len > Limit) {
|
|
||||||
Len = Limit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Write Len
|
|
||||||
//
|
|
||||||
if (Len < 255) {
|
|
||||||
*pPayload++ = (U8)Len;
|
|
||||||
} else {
|
} else {
|
||||||
*pPayload++ = 255;
|
sStart = pText; // Remember start of string.
|
||||||
*pPayload++ = (Len & 255);
|
//
|
||||||
*pPayload++ = ((Len >> 8) & 255);
|
// 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')) {
|
||||||
// copy string
|
|
||||||
//
|
|
||||||
n = 0;
|
|
||||||
while (n < Len) {
|
|
||||||
*pPayload++ = *pText++;
|
*pPayload++ = *pText++;
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
//
|
||||||
return pPayload;
|
return pPayload;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -693,7 +731,6 @@ static void _SendSyncInfo(void) {
|
|||||||
for (n = 0; n < _NumModules; n++) {
|
for (n = 0; n < _NumModules; n++) {
|
||||||
SEGGER_SYSVIEW_SendModule(n);
|
SEGGER_SYSVIEW_SendModule(n);
|
||||||
}
|
}
|
||||||
SEGGER_SYSVIEW_SendModuleDescription();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // (SEGGER_SYSVIEW_POST_MORTEM_MODE == 1)
|
#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 FormatFlags;
|
||||||
unsigned int FieldWidth;
|
unsigned int FieldWidth;
|
||||||
U8* pPayloadStart;
|
U8* pPayloadStart;
|
||||||
|
const char* s;
|
||||||
#if SEGGER_SYSVIEW_USE_STATIC_BUFFER == 0
|
#if SEGGER_SYSVIEW_USE_STATIC_BUFFER == 0
|
||||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 1 + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 1 + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||||
SEGGER_SYSVIEW_LOCK();
|
SEGGER_SYSVIEW_LOCK();
|
||||||
@@ -1322,6 +1360,20 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
|||||||
v = va_arg(*pParamList, int);
|
v = va_arg(*pParamList, int);
|
||||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, NumDigits, FieldWidth, FormatFlags);
|
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, NumDigits, FieldWidth, FormatFlags);
|
||||||
break;
|
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':
|
case 'p':
|
||||||
v = va_arg(*pParamList, int);
|
v = va_arg(*pParamList, int);
|
||||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, 8u, 8u, 0u);
|
_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, SHRINK_ID(pInfo->TaskID));
|
||||||
ENCODE_U32(pPayload, pInfo->StackBase);
|
ENCODE_U32(pPayload, pInfo->StackBase);
|
||||||
ENCODE_U32(pPayload, pInfo->StackSize);
|
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);
|
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_STACK_INFO);
|
||||||
RECORD_END();
|
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()
|
* SEGGER_SYSVIEW_SendTaskList()
|
||||||
@@ -2448,6 +2550,63 @@ void SEGGER_SYSVIEW_NameResource(U32 ResourceId, const char* sName) {
|
|||||||
RECORD_END();
|
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()
|
* SEGGER_SYSVIEW_HeapDefine()
|
||||||
@@ -2820,9 +2979,6 @@ void SEGGER_SYSVIEW_RegisterModule(SEGGER_SYSVIEW_MODULE* pModule) {
|
|||||||
_NumModules++;
|
_NumModules++;
|
||||||
}
|
}
|
||||||
SEGGER_SYSVIEW_SendModule(0);
|
SEGGER_SYSVIEW_SendModule(0);
|
||||||
if (pModule->pfSendModuleDesc) {
|
|
||||||
pModule->pfSendModuleDesc();
|
|
||||||
}
|
|
||||||
SEGGER_SYSVIEW_UNLOCK();
|
SEGGER_SYSVIEW_UNLOCK();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2906,6 +3062,9 @@ void SEGGER_SYSVIEW_SendModule(U8 ModuleId) {
|
|||||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_MODULEDESC);
|
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_MODULEDESC);
|
||||||
RECORD_END();
|
RECORD_END();
|
||||||
}
|
}
|
||||||
|
if (pModule && pModule->pfSendModuleDesc) {
|
||||||
|
pModule->pfSendModuleDesc();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2986,6 +3145,39 @@ void SEGGER_SYSVIEW_PrintfHostEx(const char* s, U32 Options, ...) {
|
|||||||
#endif
|
#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()
|
* SEGGER_SYSVIEW_PrintfHost()
|
||||||
@@ -3020,6 +3212,37 @@ void SEGGER_SYSVIEW_PrintfHost(const char* s, ...) {
|
|||||||
#endif
|
#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()
|
* SEGGER_SYSVIEW_WarnfHost()
|
||||||
@@ -3055,6 +3278,38 @@ void SEGGER_SYSVIEW_WarnfHost(const char* s, ...) {
|
|||||||
#endif
|
#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()
|
* SEGGER_SYSVIEW_ErrorfHost()
|
||||||
@@ -3090,6 +3345,38 @@ void SEGGER_SYSVIEW_ErrorfHost(const char* s, ...) {
|
|||||||
#endif
|
#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()
|
* SEGGER_SYSVIEW_PrintfTargetEx()
|
||||||
@@ -3110,6 +3397,23 @@ void SEGGER_SYSVIEW_PrintfTargetEx(const char* s, U32 Options, ...) {
|
|||||||
va_end(ParamList);
|
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()
|
* SEGGER_SYSVIEW_PrintfTarget()
|
||||||
@@ -3129,6 +3433,22 @@ void SEGGER_SYSVIEW_PrintfTarget(const char* s, ...) {
|
|||||||
va_end(ParamList);
|
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()
|
* SEGGER_SYSVIEW_WarnfTarget()
|
||||||
@@ -3148,6 +3468,22 @@ void SEGGER_SYSVIEW_WarnfTarget(const char* s, ...) {
|
|||||||
va_end(ParamList);
|
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()
|
* SEGGER_SYSVIEW_ErrorfTarget()
|
||||||
@@ -3166,6 +3502,22 @@ void SEGGER_SYSVIEW_ErrorfTarget(const char* s, ...) {
|
|||||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamList);
|
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamList);
|
||||||
va_end(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
|
#endif // SEGGER_SYSVIEW_EXCLUDE_PRINTF
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-1-Clause
|
* 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 *
|
* SEGGER Microcontroller GmbH *
|
||||||
* The Embedded Experts *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* www.segger.com Support: support@segger.com *
|
||||||
* *
|
* *
|
||||||
@@ -49,13 +49,13 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* SystemView version: 3.42 *
|
* SystemView version: 3.56 *
|
||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
-------------------------- END-OF-HEADER -----------------------------
|
-------------------------- END-OF-HEADER -----------------------------
|
||||||
File : SEGGER_SYSVIEW.h
|
File : SEGGER_SYSVIEW.h
|
||||||
Purpose : System visualization API.
|
Purpose : System visualization API.
|
||||||
Revision: $Rev: 28237 $
|
Revision: $Rev: 28768 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SEGGER_SYSVIEW_H
|
#ifndef SEGGER_SYSVIEW_H
|
||||||
@@ -123,7 +123,7 @@ extern "C" {
|
|||||||
#define SYSVIEW_EVTID_TIMER_EXIT 20
|
#define SYSVIEW_EVTID_TIMER_EXIT 20
|
||||||
#define SYSVIEW_EVTID_STACK_INFO 21
|
#define SYSVIEW_EVTID_STACK_INFO 21
|
||||||
#define SYSVIEW_EVTID_MODULEDESC 22
|
#define SYSVIEW_EVTID_MODULEDESC 22
|
||||||
|
#define SYSVIEW_EVTID_DATA_SAMPLE 23
|
||||||
#define SYSVIEW_EVTID_INIT 24
|
#define SYSVIEW_EVTID_INIT 24
|
||||||
#define SYSVIEW_EVTID_NAME_RESOURCE 25
|
#define SYSVIEW_EVTID_NAME_RESOURCE 25
|
||||||
#define SYSVIEW_EVTID_PRINT_FORMATTED 26
|
#define SYSVIEW_EVTID_PRINT_FORMATTED 26
|
||||||
@@ -141,6 +141,7 @@ extern "C" {
|
|||||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||||
|
#define SYSVIEW_EVTID_EX_REGISTER_DATA 6
|
||||||
//
|
//
|
||||||
// Event masks to disable/enable events
|
// 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_TIMER_EXIT (1 << SYSVIEW_EVTID_TIMER_EXIT)
|
||||||
#define SYSVIEW_EVTMASK_STACK_INFO (1 << SYSVIEW_EVTID_STACK_INFO)
|
#define SYSVIEW_EVTMASK_STACK_INFO (1 << SYSVIEW_EVTID_STACK_INFO)
|
||||||
#define SYSVIEW_EVTMASK_MODULEDESC (1 << SYSVIEW_EVTID_MODULEDESC)
|
#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_INIT (1 << SYSVIEW_EVTID_INIT)
|
||||||
#define SYSVIEW_EVTMASK_NAME_RESOURCE (1 << SYSVIEW_EVTID_NAME_RESOURCE)
|
#define SYSVIEW_EVTMASK_NAME_RESOURCE (1 << SYSVIEW_EVTID_NAME_RESOURCE)
|
||||||
#define SYSVIEW_EVTMASK_PRINT_FORMATTED (1 << SYSVIEW_EVTID_PRINT_FORMATTED)
|
#define SYSVIEW_EVTMASK_PRINT_FORMATTED (1 << SYSVIEW_EVTID_PRINT_FORMATTED)
|
||||||
@@ -202,8 +203,42 @@ typedef struct {
|
|||||||
U32 Prio;
|
U32 Prio;
|
||||||
U32 StackBase;
|
U32 StackBase;
|
||||||
U32 StackSize;
|
U32 StackSize;
|
||||||
|
U32 StackUsage;
|
||||||
} SEGGER_SYSVIEW_TASKINFO;
|
} 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;
|
typedef struct SEGGER_SYSVIEW_MODULE_STRUCT SEGGER_SYSVIEW_MODULE;
|
||||||
|
|
||||||
struct SEGGER_SYSVIEW_MODULE_STRUCT {
|
struct SEGGER_SYSVIEW_MODULE_STRUCT {
|
||||||
@@ -262,9 +297,13 @@ void SEGGER_SYSVIEW_Stop (void);
|
|||||||
void SEGGER_SYSVIEW_GetSysDesc (void);
|
void SEGGER_SYSVIEW_GetSysDesc (void);
|
||||||
void SEGGER_SYSVIEW_SendTaskList (void);
|
void SEGGER_SYSVIEW_SendTaskList (void);
|
||||||
void SEGGER_SYSVIEW_SendTaskInfo (const SEGGER_SYSVIEW_TASKINFO* pInfo);
|
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);
|
void SEGGER_SYSVIEW_SendSysDesc (const char* sSysDesc);
|
||||||
int SEGGER_SYSVIEW_IsStarted (void);
|
int SEGGER_SYSVIEW_IsStarted (void);
|
||||||
int SEGGER_SYSVIEW_GetChannelID (void);
|
int SEGGER_SYSVIEW_GetChannelID (void);
|
||||||
|
|
||||||
|
void SEGGER_SYSVIEW_SampleData (const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo);
|
||||||
|
|
||||||
// Checks whether tracing has been started
|
// Checks whether tracing has been started
|
||||||
U8 SEGGER_SYSVIEW_Started(void);
|
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_HeapFree (void* pHeap, void* pUserData);
|
||||||
|
|
||||||
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
|
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);
|
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
|
#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_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_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_PrintfHost (const char* s, ...);
|
||||||
|
void SEGGER_SYSVIEW_VPrintfHost (const char* s, va_list* pParamList);
|
||||||
void SEGGER_SYSVIEW_PrintfTarget (const char* s, ...);
|
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_WarnfHost (const char* s, ...);
|
||||||
|
void SEGGER_SYSVIEW_VWarnfHost (const char* s, va_list* pParamList);
|
||||||
void SEGGER_SYSVIEW_WarnfTarget (const char* s, ...);
|
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_ErrorfHost (const char* s, ...);
|
||||||
|
void SEGGER_SYSVIEW_VErrorfHost (const char* s, va_list* pParamList);
|
||||||
void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
|
void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
|
||||||
|
void SEGGER_SYSVIEW_VErrorfTarget (const char* s, va_list* pParamList);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SEGGER_SYSVIEW_Print (const char* s);
|
void SEGGER_SYSVIEW_Print (const char* s);
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-1-Clause
|
* 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 *
|
* SEGGER Microcontroller GmbH *
|
||||||
* The Embedded Experts *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* www.segger.com Support: support@segger.com *
|
||||||
* *
|
* *
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* SystemView version: 3.42 *
|
* SystemView version: 3.56 *
|
||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
-------------------------- END-OF-HEADER -----------------------------
|
-------------------------- END-OF-HEADER -----------------------------
|
||||||
@@ -72,6 +72,8 @@ Revision: $Rev: 26230 $
|
|||||||
#include "SEGGER_SYSVIEW_Conf.h"
|
#include "SEGGER_SYSVIEW_Conf.h"
|
||||||
#include "SEGGER_RTT_Conf.h"
|
#include "SEGGER_RTT_Conf.h"
|
||||||
|
|
||||||
|
#include "esp_assert.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -370,12 +372,14 @@ extern "C" {
|
|||||||
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
|
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
|
||||||
#endif
|
#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
|
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
|
||||||
*
|
*
|
||||||
* Description
|
* Description
|
||||||
* It set, support enconding Evend Ids longer than 14 bit.
|
* It set, support encoding Evend Ids longer than 14 bit.
|
||||||
* Default
|
* Default
|
||||||
* 1
|
* 1
|
||||||
*/
|
*/
|
||||||
@@ -388,7 +392,7 @@ extern "C" {
|
|||||||
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
|
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
|
||||||
*
|
*
|
||||||
* Description
|
* Description
|
||||||
* It set, support enconding event data longer than 14 bit.
|
* It set, support encoding event data longer than 14 bit.
|
||||||
* Default
|
* Default
|
||||||
* 0
|
* 0
|
||||||
*/
|
*/
|
||||||
@@ -517,7 +521,7 @@ extern "C" {
|
|||||||
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
|
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
|
||||||
*
|
*
|
||||||
* Description
|
* Description
|
||||||
* Configure how frequently syncronization is sent in post-mortem
|
* Configure how frequently synchronization is sent in post-mortem
|
||||||
* mode.
|
* mode.
|
||||||
* Default
|
* Default
|
||||||
* 8: (1 << 8) = Every 256 Events.
|
* 8: (1 << 8) = Every 256 Events.
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
* The Embedded Experts *
|
* The Embedded Experts *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||||
* *
|
* *
|
||||||
* www.segger.com Support: support@segger.com *
|
* www.segger.com Support: support@segger.com *
|
||||||
* *
|
* *
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* *
|
* *
|
||||||
* SystemView version: 3.42 *
|
* SystemView version: 3.56 *
|
||||||
* *
|
* *
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
-------------------------- END-OF-HEADER -----------------------------
|
-------------------------- END-OF-HEADER -----------------------------
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: 'SystemView'
|
name: 'SystemView'
|
||||||
version: '3.42'
|
version: '3.56'
|
||||||
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
|
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
|
||||||
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
||||||
originator: 'Organization: SEGGER Microcontroller GmbH'
|
originator: 'Organization: SEGGER Microcontroller GmbH'
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-1-Clause
|
* 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 *
|
* SEGGER Microcontroller GmbH *
|
||||||
@@ -84,11 +84,7 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
|
|||||||
// The target device name
|
// The target device name
|
||||||
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
|
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
|
||||||
// The target core name
|
// The target core name
|
||||||
#if CONFIG_IDF_TARGET_ARCH_XTENSA
|
#define SYSVIEW_CORE_NAME "core0" // In dual core, this will be renamed by OpenOCD as core1
|
||||||
#define SYSVIEW_CORE_NAME "xtensa"
|
|
||||||
#elif CONFIG_IDF_TARGET_ARCH_RISCV
|
|
||||||
#define SYSVIEW_CORE_NAME "riscv"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Determine which timer to use as timestamp source
|
// Determine which timer to use as timestamp source
|
||||||
#if CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
|
#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>`.
|
* :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>`.
|
* `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.
|
- ESP32 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``target/esp32-solo-1.cfg``
|
* - ``target/esp32-solo-1.cfg``
|
||||||
- Target configuration file for ESP32-SOLO-1 module. Different from ``esp32.cfg`` in that it only configures one CPU.
|
- 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.
|
- 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.
|
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||||
* - ``target/esp32c2.cfg``
|
* - ``target/esp32c2.cfg``
|
||||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
- 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.
|
- 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.
|
- ESP32-C3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C3.
|
- 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.
|
- 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.
|
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C5.
|
- 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.
|
- 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.
|
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C6.
|
- 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.
|
- 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.
|
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C61.
|
- 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.
|
- 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.
|
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-H2.
|
- 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.
|
- 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.
|
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-P4.
|
- 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.
|
- 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.
|
- ESP32-S2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-S2-Kaluga-1 board.
|
- 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.
|
- 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.
|
- ESP32-S3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-S3 builtin USB JTAG.
|
- 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.
|
- 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>`。
|
* :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>`。
|
* `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/`` 下的配置文件一同使用
|
- ESP32 的目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||||
* - ``target/esp32-solo-1.cfg``
|
* - ``target/esp32-solo-1.cfg``
|
||||||
- ESP32-SOLO-1 模组的目标配置文件,和 ``esp32.cfg`` 的差别在于它仅配置一个 CPU
|
- ESP32-SOLO-1 模组的目标配置文件,和 ``esp32.cfg`` 的差别在于它仅配置一个 CPU
|
||||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||||
- 适用于 ESP-WROVER-KIT 和 ESP-Prog 的 JTAG 适配器配置文件
|
- 适用于 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.
|
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||||
* - ``target/esp32c2.cfg``
|
* - ``target/esp32c2.cfg``
|
||||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
- 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.
|
- JTAG adapter configuration file for ESP-Prog boards.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@@ -97,7 +97,7 @@
|
|||||||
- ESP32-C3 目标配置文件。可以和某个 ``interface/`` 下的配置文件一同使用。
|
- ESP32-C3 目标配置文件。可以和某个 ``interface/`` 下的配置文件一同使用。
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- 适用于 ESP32-C3 的 JTAG 适配器配置文件。
|
- 适用于 ESP32-C3 的 JTAG 适配器配置文件。
|
||||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@@ -103,7 +103,7 @@
|
|||||||
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C5.
|
- 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.
|
- 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.
|
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C6.
|
- 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.
|
- 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.
|
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-C61.
|
- 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.
|
- 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.
|
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-H2.
|
- 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.
|
- 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.
|
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||||
* - ``interface/esp_usb_jtag.cfg``
|
* - ``interface/esp_usb_jtag.cfg``
|
||||||
- JTAG adapter configuration file for ESP32-P4.
|
- 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.
|
- JTAG adapter configuration file for ESP-Prog boards.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@@ -92,7 +92,7 @@
|
|||||||
- ESP32-S2 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
- ESP32-S2 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||||
- 适用于 ESP32-S2-Kaluga-1 开发板的 JTAG 适配器配置文件
|
- 适用于 ESP32-S2-Kaluga-1 开发板的 JTAG 适配器配置文件
|
||||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||||
- 适用于 ESP-Prog 板的 JTAG 适配器配置文件
|
- 适用于 ESP-Prog 板的 JTAG 适配器配置文件
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@@ -101,7 +101,7 @@
|
|||||||
- ESP32-S3 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
- ESP32-S3 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||||
- 适用于 ESP32-S3 的 JTAG 适配器配置文件。
|
- 适用于 ESP32-S3 的 JTAG 适配器配置文件。
|
||||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
@@ -30,6 +30,7 @@ SYSVIEW_EVTID_TIMER_ENTER = 19
|
|||||||
SYSVIEW_EVTID_TIMER_EXIT = 20
|
SYSVIEW_EVTID_TIMER_EXIT = 20
|
||||||
SYSVIEW_EVTID_STACK_INFO = 21
|
SYSVIEW_EVTID_STACK_INFO = 21
|
||||||
SYSVIEW_EVTID_MODULEDESC = 22
|
SYSVIEW_EVTID_MODULEDESC = 22
|
||||||
|
SYSVIEW_EVTID_DATA_SAMPLE = 23
|
||||||
SYSVIEW_EVTID_INIT = 24
|
SYSVIEW_EVTID_INIT = 24
|
||||||
SYSVIEW_EVENT_ID_PREDEF_LEN_MAX = SYSVIEW_EVTID_INIT
|
SYSVIEW_EVENT_ID_PREDEF_LEN_MAX = SYSVIEW_EVTID_INIT
|
||||||
SYSVIEW_EVTID_NAME_RESOURCE = 25
|
SYSVIEW_EVTID_NAME_RESOURCE = 25
|
||||||
@@ -66,11 +67,12 @@ _sysview_events_map = {
|
|||||||
'SYS_TIMER_ENTER': SYSVIEW_EVTID_TIMER_ENTER,
|
'SYS_TIMER_ENTER': SYSVIEW_EVTID_TIMER_ENTER,
|
||||||
'SYS_TIMER_EXIT': SYSVIEW_EVTID_TIMER_EXIT,
|
'SYS_TIMER_EXIT': SYSVIEW_EVTID_TIMER_EXIT,
|
||||||
'SYS_STACK_INFO': SYSVIEW_EVTID_STACK_INFO,
|
'SYS_STACK_INFO': SYSVIEW_EVTID_STACK_INFO,
|
||||||
'SYS_MODULEDESC': SYSVIEW_EVTID_INIT,
|
'SYS_MODULEDESC': SYSVIEW_EVTID_MODULEDESC,
|
||||||
|
'SYS_DATA_SAMPLE': SYSVIEW_EVTID_DATA_SAMPLE,
|
||||||
'SYS_INIT': SYSVIEW_EVTID_INIT,
|
'SYS_INIT': SYSVIEW_EVTID_INIT,
|
||||||
'SYS_NAME_RESOURCE': SYSVIEW_EVTID_NAME_RESOURCE,
|
'SYS_NAME_RESOURCE': SYSVIEW_EVTID_NAME_RESOURCE,
|
||||||
'SYS_PRINT_FORMATTED': SYSVIEW_EVTID_PRINT_FORMATTED,
|
'SYS_PRINT_FORMATTED': SYSVIEW_EVTID_PRINT_FORMATTED,
|
||||||
'SYS_NUMMODULES': SYSVIEW_EVTID_NUMMODULES
|
'SYS_NUMMODULES': SYSVIEW_EVTID_NUMMODULES,
|
||||||
}
|
}
|
||||||
|
|
||||||
_os_events_map = {}
|
_os_events_map = {}
|
||||||
@@ -92,7 +94,7 @@ def parse_trace(reader, parser, os_evt_map_file=''):
|
|||||||
global _os_events_map
|
global _os_events_map
|
||||||
# parse OS events formats file
|
# parse OS events formats file
|
||||||
_os_events_map = _read_events_map(os_evt_map_file)
|
_os_events_map = _read_events_map(os_evt_map_file)
|
||||||
parser.esp_ext = ('; ESP_Extension\n' in _read_file_header(reader))
|
_read_file_header(reader)
|
||||||
_read_init_seq(reader)
|
_read_init_seq(reader)
|
||||||
while True:
|
while True:
|
||||||
event = parser.read_event(reader, _os_events_map)
|
event = parser.read_event(reader, _os_events_map)
|
||||||
@@ -197,7 +199,7 @@ def _decode_u32(reader):
|
|||||||
sz = 0
|
sz = 0
|
||||||
val = 0
|
val = 0
|
||||||
while True:
|
while True:
|
||||||
b, = struct.unpack('<B', reader.read(1))
|
(b,) = struct.unpack('<B', reader.read(1))
|
||||||
if b & 0x80:
|
if b & 0x80:
|
||||||
val |= (b & 0x7F) << (7 * sz)
|
val |= (b & 0x7F) << (7 * sz)
|
||||||
else:
|
else:
|
||||||
@@ -260,11 +262,11 @@ def _decode_str(reader):
|
|||||||
"""
|
"""
|
||||||
sz = 0
|
sz = 0
|
||||||
val = ''
|
val = ''
|
||||||
sz, = struct.unpack('<B', reader.read(1))
|
(sz,) = struct.unpack('<B', reader.read(1))
|
||||||
if sz == 0xFF:
|
if sz == 0xFF:
|
||||||
buf = struct.unpack('<2B', reader.read(2))
|
buf = struct.unpack('<2B', reader.read(2))
|
||||||
sz = (buf[1] << 8) | buf[0]
|
sz = (buf[0] << 8) | buf[1]
|
||||||
val, = struct.unpack('<%ds' % sz, reader.read(sz))
|
(val,) = struct.unpack('<%ds' % sz, reader.read(sz))
|
||||||
val = val.decode('utf-8')
|
val = val.decode('utf-8')
|
||||||
if sz < 0xFF:
|
if sz < 0xFF:
|
||||||
return (sz + 1, val) # one extra byte for length
|
return (sz + 1, val) # one extra byte for length
|
||||||
@@ -286,9 +288,9 @@ def _decode_plen(reader):
|
|||||||
decoded value.
|
decoded value.
|
||||||
"""
|
"""
|
||||||
plen = 0
|
plen = 0
|
||||||
b0, = struct.unpack('<B', reader.read(1))
|
(b0,) = struct.unpack('<B', reader.read(1))
|
||||||
if b0 & 0x80:
|
if b0 & 0x80:
|
||||||
b1, = struct.unpack('<B', reader.read(1))
|
(b1,) = struct.unpack('<B', reader.read(1))
|
||||||
plen = b1 # higher part
|
plen = b1 # higher part
|
||||||
plen = (plen << 7) | (b0 & ~0x80) # lower 7 bits
|
plen = (plen << 7) | (b0 & ~0x80) # lower 7 bits
|
||||||
else:
|
else:
|
||||||
@@ -300,6 +302,7 @@ class SysViewTraceParseError(apptrace.ParseError):
|
|||||||
"""
|
"""
|
||||||
SystemView parse error exception.
|
SystemView parse error exception.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -307,6 +310,7 @@ class SysViewEvent(apptrace.TraceEvent):
|
|||||||
"""
|
"""
|
||||||
Generic SystemView event class. This is a base class for all events.
|
Generic SystemView event class. This is a base class for all events.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, evt_id, core_id, reader, events_fmt_map=None):
|
def __init__(self, evt_id, core_id, reader, events_fmt_map=None):
|
||||||
"""
|
"""
|
||||||
Constructor. Reads and optionally decodes event.
|
Constructor. Reads and optionally decodes event.
|
||||||
@@ -359,13 +363,21 @@ class SysViewEvent(apptrace.TraceEvent):
|
|||||||
cur_pos = reader.get_pos()
|
cur_pos = reader.get_pos()
|
||||||
sz, param_val = event_param.decode(reader, self.plen - params_len)
|
sz, param_val = event_param.decode(reader, self.plen - params_len)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise SysViewTraceParseError('Failed to decode event {}({:d}) {:d} param @ 0x{:x}! {}'.format(self.name, self.id, self.plen, cur_pos, e))
|
raise SysViewTraceParseError(
|
||||||
|
'Failed to decode event {}({:d}) {:d} param @ 0x{:x}! {}'.format(
|
||||||
|
self.name, self.id, self.plen, cur_pos, e
|
||||||
|
)
|
||||||
|
)
|
||||||
event_param.idx = i
|
event_param.idx = i
|
||||||
event_param.value = param_val
|
event_param.value = param_val
|
||||||
self.params[event_param.name] = event_param
|
self.params[event_param.name] = event_param
|
||||||
params_len += sz
|
params_len += sz
|
||||||
if self.id >= SYSVIEW_EVENT_ID_PREDEF_LEN_MAX and self.plen != params_len:
|
if self.id >= SYSVIEW_EVENT_ID_PREDEF_LEN_MAX and self.plen != params_len:
|
||||||
raise SysViewTraceParseError('Invalid event {}({:d}) payload len {:d}! Must be {:d}.'.format(self.name, self.id, self.plen, params_len))
|
raise SysViewTraceParseError(
|
||||||
|
'Invalid event {}({:d}) payload len {:d}! Must be {:d}.'.format(
|
||||||
|
self.name, self.id, self.plen, params_len
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
params = ''
|
params = ''
|
||||||
@@ -373,13 +385,16 @@ class SysViewEvent(apptrace.TraceEvent):
|
|||||||
params += '{}, '.format(param)
|
params += '{}, '.format(param)
|
||||||
if len(params):
|
if len(params):
|
||||||
params = params[:-2] # remove trailing ', '
|
params = params[:-2] # remove trailing ', '
|
||||||
return '{:.9f} - core[{:d}].{}({:d}), plen {:d}: [{}]'.format(self.ts, self.core_id, self.name, self.id, self.plen, params)
|
return '{:.9f} - core[{:d}].{}({:d}), plen {:d}: [{}]'.format(
|
||||||
|
self.ts, self.core_id, self.name, self.id, self.plen, params
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SysViewEventParam:
|
class SysViewEventParam:
|
||||||
"""
|
"""
|
||||||
Abstract base SystemView event's parameter class. This is a base class for all event's parameters.
|
Abstract base SystemView event's parameter class. This is a base class for all event's parameters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, decode_func):
|
def __init__(self, name, decode_func):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
@@ -426,6 +441,7 @@ class SysViewEventParamSimple(SysViewEventParam):
|
|||||||
"""
|
"""
|
||||||
Simple SystemView event's parameter class.
|
Simple SystemView event's parameter class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def decode(self, reader, max_sz):
|
def decode(self, reader, max_sz):
|
||||||
"""
|
"""
|
||||||
see SysViewEventParam.decode()
|
see SysViewEventParam.decode()
|
||||||
@@ -437,6 +453,7 @@ class SysViewEventParamArray(SysViewEventParamSimple):
|
|||||||
"""
|
"""
|
||||||
Array SystemView event's parameter class.
|
Array SystemView event's parameter class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, decode_func, size=-1):
|
def __init__(self, name, decode_func, size=-1):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
@@ -474,6 +491,7 @@ class SysViewPredefinedEvent(SysViewEvent):
|
|||||||
"""
|
"""
|
||||||
Pre-defined SystemView events class.
|
Pre-defined SystemView events class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_predef_events_fmt = {
|
_predef_events_fmt = {
|
||||||
SYSVIEW_EVTID_NOP: ('svNop', []),
|
SYSVIEW_EVTID_NOP: ('svNop', []),
|
||||||
SYSVIEW_EVTID_OVERFLOW: ('svOverflow', [SysViewEventParamSimple('drop_cnt', _decode_u32)]),
|
SYSVIEW_EVTID_OVERFLOW: ('svOverflow', [SysViewEventParamSimple('drop_cnt', _decode_u32)]),
|
||||||
@@ -482,12 +500,19 @@ class SysViewPredefinedEvent(SysViewEvent):
|
|||||||
SYSVIEW_EVTID_TASK_START_EXEC: ('svTaskStartExec', [SysViewEventParamSimple('tid', _decode_id)]),
|
SYSVIEW_EVTID_TASK_START_EXEC: ('svTaskStartExec', [SysViewEventParamSimple('tid', _decode_id)]),
|
||||||
SYSVIEW_EVTID_TASK_STOP_EXEC: ('svTaskStopExec', []),
|
SYSVIEW_EVTID_TASK_STOP_EXEC: ('svTaskStopExec', []),
|
||||||
SYSVIEW_EVTID_TASK_START_READY: ('svTaskStartReady', [SysViewEventParamSimple('tid', _decode_id)]),
|
SYSVIEW_EVTID_TASK_START_READY: ('svTaskStartReady', [SysViewEventParamSimple('tid', _decode_id)]),
|
||||||
SYSVIEW_EVTID_TASK_STOP_READY: ('svTaskStopReady', [SysViewEventParamSimple('tid', _decode_id),
|
SYSVIEW_EVTID_TASK_STOP_READY: (
|
||||||
SysViewEventParamSimple('cause', _decode_u32)]),
|
'svTaskStopReady',
|
||||||
|
[SysViewEventParamSimple('tid', _decode_id), SysViewEventParamSimple('cause', _decode_u32)],
|
||||||
|
),
|
||||||
SYSVIEW_EVTID_TASK_CREATE: ('svTaskCreate', [SysViewEventParamSimple('tid', _decode_id)]),
|
SYSVIEW_EVTID_TASK_CREATE: ('svTaskCreate', [SysViewEventParamSimple('tid', _decode_id)]),
|
||||||
SYSVIEW_EVTID_TASK_INFO: ('svTaskInfo', [SysViewEventParamSimple('tid', _decode_id),
|
SYSVIEW_EVTID_TASK_INFO: (
|
||||||
|
'svTaskInfo',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('tid', _decode_id),
|
||||||
SysViewEventParamSimple('prio', _decode_u32),
|
SysViewEventParamSimple('prio', _decode_u32),
|
||||||
SysViewEventParamSimple('name', _decode_str)]),
|
SysViewEventParamSimple('name', _decode_str),
|
||||||
|
],
|
||||||
|
),
|
||||||
SYSVIEW_EVTID_TRACE_START: ('svTraceStart', []),
|
SYSVIEW_EVTID_TRACE_START: ('svTraceStart', []),
|
||||||
SYSVIEW_EVTID_TRACE_STOP: ('svTraceStop', []),
|
SYSVIEW_EVTID_TRACE_STOP: ('svTraceStop', []),
|
||||||
SYSVIEW_EVTID_SYSTIME_CYCLES: ('svSysTimeCycles', [SysViewEventParamSimple('cycles', _decode_u32)]),
|
SYSVIEW_EVTID_SYSTIME_CYCLES: ('svSysTimeCycles', [SysViewEventParamSimple('cycles', _decode_u32)]),
|
||||||
@@ -499,22 +524,45 @@ class SysViewPredefinedEvent(SysViewEvent):
|
|||||||
SYSVIEW_EVTID_ISR_TO_SCHEDULER: ('svExitIsrToScheduler', []),
|
SYSVIEW_EVTID_ISR_TO_SCHEDULER: ('svExitIsrToScheduler', []),
|
||||||
SYSVIEW_EVTID_TIMER_ENTER: ('svTimerEnter', [SysViewEventParamSimple('tim_id', _decode_u32)]),
|
SYSVIEW_EVTID_TIMER_ENTER: ('svTimerEnter', [SysViewEventParamSimple('tim_id', _decode_u32)]),
|
||||||
SYSVIEW_EVTID_TIMER_EXIT: ('svTimerExit', []),
|
SYSVIEW_EVTID_TIMER_EXIT: ('svTimerExit', []),
|
||||||
SYSVIEW_EVTID_STACK_INFO: ('svStackInfo', [SysViewEventParamSimple('tid', _decode_id),
|
SYSVIEW_EVTID_STACK_INFO: (
|
||||||
|
'svStackInfo',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('tid', _decode_id),
|
||||||
SysViewEventParamSimple('base', _decode_u32),
|
SysViewEventParamSimple('base', _decode_u32),
|
||||||
SysViewEventParamSimple('sz', _decode_u32),
|
SysViewEventParamSimple('sz', _decode_u32),
|
||||||
SysViewEventParamSimple('unused', _decode_u32)]),
|
SysViewEventParamSimple('unused', _decode_u32),
|
||||||
SYSVIEW_EVTID_MODULEDESC: ('svModuleDesc', [SysViewEventParamSimple('mod_id', _decode_u32),
|
],
|
||||||
|
),
|
||||||
|
SYSVIEW_EVTID_MODULEDESC: (
|
||||||
|
'svModuleDesc',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('mod_id', _decode_u32),
|
||||||
SysViewEventParamSimple('evt_off', _decode_u32),
|
SysViewEventParamSimple('evt_off', _decode_u32),
|
||||||
SysViewEventParamSimple('desc', _decode_str)]),
|
SysViewEventParamSimple('desc', _decode_str),
|
||||||
SYSVIEW_EVTID_INIT: ('svInit', [SysViewEventParamSimple('sys_freq', _decode_u32),
|
],
|
||||||
|
),
|
||||||
|
SYSVIEW_EVTID_INIT: (
|
||||||
|
'svInit',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('sys_freq', _decode_u32),
|
||||||
SysViewEventParamSimple('cpu_freq', _decode_u32),
|
SysViewEventParamSimple('cpu_freq', _decode_u32),
|
||||||
SysViewEventParamSimple('ram_base', _decode_u32),
|
SysViewEventParamSimple('ram_base', _decode_u32),
|
||||||
SysViewEventParamSimple('id_shift', _decode_u32)]),
|
SysViewEventParamSimple('id_shift', _decode_u32),
|
||||||
SYSVIEW_EVTID_NAME_RESOURCE: ('svNameResource', [SysViewEventParamSimple('res_id', _decode_u32),
|
],
|
||||||
SysViewEventParamSimple('name', _decode_str)]),
|
),
|
||||||
SYSVIEW_EVTID_PRINT_FORMATTED: ('svPrint', [SysViewEventParamSimple('msg', _decode_str),
|
SYSVIEW_EVTID_DATA_SAMPLE: ('svDataSample', []),
|
||||||
|
SYSVIEW_EVTID_NAME_RESOURCE: (
|
||||||
|
'svNameResource',
|
||||||
|
[SysViewEventParamSimple('res_id', _decode_u32), SysViewEventParamSimple('name', _decode_str)],
|
||||||
|
),
|
||||||
|
SYSVIEW_EVTID_PRINT_FORMATTED: (
|
||||||
|
'svPrint',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('msg', _decode_str),
|
||||||
SysViewEventParamSimple('lvl', _decode_u32),
|
SysViewEventParamSimple('lvl', _decode_u32),
|
||||||
SysViewEventParamSimple('unused', _decode_u32)]),
|
SysViewEventParamSimple('unused', _decode_u32),
|
||||||
|
],
|
||||||
|
),
|
||||||
SYSVIEW_EVTID_NUMMODULES: ('svNumModules', [SysViewEventParamSimple('mod_cnt', _decode_u32)]),
|
SYSVIEW_EVTID_NUMMODULES: ('svNumModules', [SysViewEventParamSimple('mod_cnt', _decode_u32)]),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,6 +578,7 @@ class SysViewOSEvent(SysViewEvent):
|
|||||||
"""
|
"""
|
||||||
OS related SystemView events class.
|
OS related SystemView events class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, evt_id, core_id, reader, events_fmt_map):
|
def __init__(self, evt_id, core_id, reader, events_fmt_map):
|
||||||
"""
|
"""
|
||||||
see SysViewEvent.__init__()
|
see SysViewEvent.__init__()
|
||||||
@@ -547,12 +596,20 @@ class SysViewHeapEvent(SysViewEvent):
|
|||||||
events_fmt : dict
|
events_fmt : dict
|
||||||
see return value of _read_events_map()
|
see return value of _read_events_map()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
events_fmt = {
|
events_fmt = {
|
||||||
0: ('esp_sysview_heap_trace_alloc', [SysViewEventParamSimple('addr', _decode_u32),
|
0: (
|
||||||
|
'esp_sysview_heap_trace_alloc',
|
||||||
|
[
|
||||||
|
SysViewEventParamSimple('addr', _decode_u32),
|
||||||
SysViewEventParamSimple('size', _decode_u32),
|
SysViewEventParamSimple('size', _decode_u32),
|
||||||
SysViewEventParamArray('callers', _decode_u32)]),
|
SysViewEventParamArray('callers', _decode_u32),
|
||||||
1: ('esp_sysview_heap_trace_free', [SysViewEventParamSimple('addr', _decode_u32),
|
],
|
||||||
SysViewEventParamArray('callers', _decode_u32)]),
|
),
|
||||||
|
1: (
|
||||||
|
'esp_sysview_heap_trace_free',
|
||||||
|
[SysViewEventParamSimple('addr', _decode_u32), SysViewEventParamArray('callers', _decode_u32)],
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, evt_id, core_id, events_off, reader):
|
def __init__(self, evt_id, core_id, events_off, reader):
|
||||||
@@ -571,8 +628,8 @@ class SysViewHeapEvent(SysViewEvent):
|
|||||||
see SysViewEvent.__init__()
|
see SysViewEvent.__init__()
|
||||||
"""
|
"""
|
||||||
cur_events_map = {}
|
cur_events_map = {}
|
||||||
for id in self.events_fmt:
|
for _id in self.events_fmt:
|
||||||
cur_events_map[events_off + id] = self.events_fmt[id]
|
cur_events_map[events_off + _id] = self.events_fmt[_id]
|
||||||
SysViewEvent.__init__(self, evt_id, core_id, reader, cur_events_map)
|
SysViewEvent.__init__(self, evt_id, core_id, reader, cur_events_map)
|
||||||
# self.name = 'SysViewHeapEvent'
|
# self.name = 'SysViewHeapEvent'
|
||||||
|
|
||||||
@@ -590,6 +647,7 @@ class SysViewTraceDataParser(apptrace.TraceDataProcessor):
|
|||||||
STREAMID_HEAP : int
|
STREAMID_HEAP : int
|
||||||
heap events stream ID.
|
heap events stream ID.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
STREAMID_SYS = -1
|
STREAMID_SYS = -1
|
||||||
STREAMID_LOG = 0
|
STREAMID_LOG = 0
|
||||||
STREAMID_HEAP = 1
|
STREAMID_HEAP = 1
|
||||||
@@ -611,7 +669,6 @@ class SysViewTraceDataParser(apptrace.TraceDataProcessor):
|
|||||||
self.irqs_info = {}
|
self.irqs_info = {}
|
||||||
self.tasks_info = {}
|
self.tasks_info = {}
|
||||||
self.core_id = core_id
|
self.core_id = core_id
|
||||||
self.esp_ext = False
|
|
||||||
|
|
||||||
def _parse_irq_desc(self, desc):
|
def _parse_irq_desc(self, desc):
|
||||||
"""
|
"""
|
||||||
@@ -698,24 +755,18 @@ class SysViewTraceDataParser(apptrace.TraceDataProcessor):
|
|||||||
SysViewEvent
|
SysViewEvent
|
||||||
pre-defined, OS-related or extension event object.
|
pre-defined, OS-related or extension event object.
|
||||||
"""
|
"""
|
||||||
evt_hdr, = struct.unpack('<B', reader.read(1))
|
(evt_hdr,) = struct.unpack('<B', reader.read(1))
|
||||||
# read ID and core num
|
# read ID and core num
|
||||||
evt_id = 0
|
evt_id = 0
|
||||||
if evt_hdr & 0x80:
|
if evt_hdr & 0x80:
|
||||||
# evt_id (2 bytes)
|
# evt_id (2 bytes)
|
||||||
b, = struct.unpack('<B', reader.read(1))
|
(b,) = struct.unpack('<B', reader.read(1))
|
||||||
# higher part
|
# higher part
|
||||||
if self.esp_ext:
|
|
||||||
evt_id,core_id = self._decode_core_id(b)
|
|
||||||
else:
|
|
||||||
evt_id = b
|
evt_id = b
|
||||||
core_id = self.core_id
|
core_id = self.core_id
|
||||||
evt_id = (evt_id << 7) | (evt_hdr & ~0x80) # lower 7 bits
|
evt_id = (evt_id << 7) | (evt_hdr & ~0x80) # lower 7 bits
|
||||||
else:
|
else:
|
||||||
# evt_id (1 byte)
|
# evt_id (1 byte)
|
||||||
if self.esp_ext:
|
|
||||||
evt_id,core_id = self._decode_core_id(evt_hdr)
|
|
||||||
else:
|
|
||||||
evt_id = evt_hdr
|
evt_id = evt_hdr
|
||||||
core_id = self.core_id
|
core_id = self.core_id
|
||||||
if evt_id <= SYSVIEW_EVENT_ID_PREDEF_MAX:
|
if evt_id <= SYSVIEW_EVENT_ID_PREDEF_MAX:
|
||||||
@@ -776,14 +827,22 @@ class SysViewTraceDataExtEventParser(SysViewTraceDataParser):
|
|||||||
self.events_num = events_num
|
self.events_num = events_num
|
||||||
|
|
||||||
def event_supported(self, event):
|
def event_supported(self, event):
|
||||||
return False if (self.events_off < SYSVIEW_MODULE_EVENT_OFFSET or event.id < self.events_off or
|
return (
|
||||||
event.id >= (self.events_off + self.events_num)) else True
|
False
|
||||||
|
if (
|
||||||
|
self.events_off < SYSVIEW_MODULE_EVENT_OFFSET
|
||||||
|
or event.id < self.events_off
|
||||||
|
or event.id >= (self.events_off + self.events_num)
|
||||||
|
)
|
||||||
|
else True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SysViewMultiTraceDataParser(SysViewTraceDataParser):
|
class SysViewMultiTraceDataParser(SysViewTraceDataParser):
|
||||||
"""
|
"""
|
||||||
SystemView trace data parser supporting multiple event streams.
|
SystemView trace data parser supporting multiple event streams.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, print_events=False, core_id=0):
|
def __init__(self, print_events=False, core_id=0):
|
||||||
"""
|
"""
|
||||||
see SysViewTraceDataParser.__init__()
|
see SysViewTraceDataParser.__init__()
|
||||||
@@ -847,10 +906,11 @@ class SysViewMultiTraceDataParser(SysViewTraceDataParser):
|
|||||||
self.stream_parsers[stream_id].on_new_event(event)
|
self.stream_parsers[stream_id].on_new_event(event)
|
||||||
|
|
||||||
|
|
||||||
class SysViewEventContext():
|
class SysViewEventContext:
|
||||||
"""
|
"""
|
||||||
SystemView event context.
|
SystemView event context.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, handle, irq, name=''):
|
def __init__(self, handle, irq, name=''):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
@@ -873,6 +933,7 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
"""
|
"""
|
||||||
Base SystemView trace data processor class.
|
Base SystemView trace data processor class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, traces, root_proc=None, print_events=False, keep_all_events=False):
|
def __init__(self, traces, root_proc=None, print_events=False, keep_all_events=False):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
@@ -900,7 +961,8 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
# empty list means IDLE context or self.start_ctx
|
# empty list means IDLE context or self.start_ctx
|
||||||
self.ctx_stack[t.core_id] = []
|
self.ctx_stack[t.core_id] = []
|
||||||
# context is undefined, we do not know have we started the tracing in task/IDLE or IRQ context
|
# context is undefined, we do not know have we started the tracing in task/IDLE or IRQ context
|
||||||
# in general there are three scenarios when we can start tracing: when core is in task, IDLE task or IRQ context
|
# in general there are three scenarios when we can start tracing:
|
||||||
|
# when core is in task, IDLE task or IRQ context
|
||||||
self.prev_ctx[t.core_id] = None
|
self.prev_ctx[t.core_id] = None
|
||||||
|
|
||||||
def _get_curr_context(self, core_id):
|
def _get_curr_context(self, core_id):
|
||||||
@@ -997,14 +1059,6 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
if SYSVIEW_EVTID_TASK_START_EXEC or SYSVIEW_EVTID_TASK_STOP_READY is received for unknown task.
|
if SYSVIEW_EVTID_TASK_START_EXEC or SYSVIEW_EVTID_TASK_STOP_READY is received for unknown task.
|
||||||
"""
|
"""
|
||||||
if event.core_id not in self.traces:
|
if event.core_id not in self.traces:
|
||||||
if 0 in self.traces and self.traces[0].esp_ext:
|
|
||||||
# for Espressif extension there is one trace for all cores
|
|
||||||
trace = self.traces[0]
|
|
||||||
if event.core_id not in self.ctx_stack:
|
|
||||||
self.ctx_stack[event.core_id] = []
|
|
||||||
if event.core_id not in self.prev_ctx:
|
|
||||||
self.prev_ctx[event.core_id] = None
|
|
||||||
else:
|
|
||||||
raise SysViewTraceParseError('Event for unknown core %d' % event.core_id)
|
raise SysViewTraceParseError('Event for unknown core %d' % event.core_id)
|
||||||
else:
|
else:
|
||||||
trace = self.traces[event.core_id]
|
trace = self.traces[event.core_id]
|
||||||
@@ -1014,16 +1068,20 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
if len(self.ctx_stack[event.core_id]):
|
if len(self.ctx_stack[event.core_id]):
|
||||||
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id][-1]
|
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id][-1]
|
||||||
else:
|
else:
|
||||||
# the 1st context switching event after trace start is SYSVIEW_EVTID_ISR_ENTER, so we have been in IDLE context
|
# the 1st context switching event after trace start is SYSVIEW_EVTID_ISR_ENTER,
|
||||||
|
# so we have been in IDLE context
|
||||||
self.prev_ctx[event.core_id] = SysViewEventContext(None, False, 'IDLE%d' % event.core_id)
|
self.prev_ctx[event.core_id] = SysViewEventContext(None, False, 'IDLE%d' % event.core_id)
|
||||||
# put new ISR context on top of the stack (the last in the list)
|
# put new ISR context on top of the stack (the last in the list)
|
||||||
self.ctx_stack[event.core_id].append(SysViewEventContext(event.params['irq_num'].value, True, trace.irqs_info[event.params['irq_num'].value]))
|
self.ctx_stack[event.core_id].append(
|
||||||
|
SysViewEventContext(event.params['irq_num'].value, True, trace.irqs_info[event.params['irq_num'].value])
|
||||||
|
)
|
||||||
elif event.id == SYSVIEW_EVTID_ISR_EXIT or event.id == SYSVIEW_EVTID_ISR_TO_SCHEDULER:
|
elif event.id == SYSVIEW_EVTID_ISR_EXIT or event.id == SYSVIEW_EVTID_ISR_TO_SCHEDULER:
|
||||||
if len(self.ctx_stack[event.core_id]):
|
if len(self.ctx_stack[event.core_id]):
|
||||||
# return to the previous context (the last in the list)
|
# return to the previous context (the last in the list)
|
||||||
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id].pop()
|
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id].pop()
|
||||||
else:
|
else:
|
||||||
# the 1st context switching event after trace start is SYSVIEW_EVTID_ISR_EXIT, so we have been in ISR context,
|
# the 1st context switching event after trace start is SYSVIEW_EVTID_ISR_EXIT,
|
||||||
|
# so we have been in ISR context,
|
||||||
# but we do not know which one because SYSVIEW_EVTID_ISR_EXIT do not include the IRQ number
|
# but we do not know which one because SYSVIEW_EVTID_ISR_EXIT do not include the IRQ number
|
||||||
self.prev_ctx[event.core_id] = SysViewEventContext(None, True, 'IRQ_oncore%d' % event.core_id)
|
self.prev_ctx[event.core_id] = SysViewEventContext(None, True, 'IRQ_oncore%d' % event.core_id)
|
||||||
elif event.id == SYSVIEW_EVTID_TASK_START_EXEC:
|
elif event.id == SYSVIEW_EVTID_TASK_START_EXEC:
|
||||||
@@ -1033,10 +1091,13 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
# return to the previous context (the last in the list)
|
# return to the previous context (the last in the list)
|
||||||
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id][-1]
|
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id][-1]
|
||||||
else:
|
else:
|
||||||
# the 1st context switching event after trace start is SYSVIEW_EVTID_TASK_START_EXEC, so we have been in IDLE context
|
# the 1st context switching event after trace start is SYSVIEW_EVTID_TASK_START_EXEC,
|
||||||
|
# so we have been in IDLE context
|
||||||
self.prev_ctx[event.core_id] = SysViewEventContext(None, False, 'IDLE%d' % event.core_id)
|
self.prev_ctx[event.core_id] = SysViewEventContext(None, False, 'IDLE%d' % event.core_id)
|
||||||
# only one task at a time in context stack (can be interrupted by a bunch of ISRs)
|
# only one task at a time in context stack (can be interrupted by a bunch of ISRs)
|
||||||
self.ctx_stack[event.core_id] = [SysViewEventContext(event.params['tid'].value, False, trace.tasks_info[event.params['tid'].value])]
|
self.ctx_stack[event.core_id] = [
|
||||||
|
SysViewEventContext(event.params['tid'].value, False, trace.tasks_info[event.params['tid'].value])
|
||||||
|
]
|
||||||
elif event.id == SYSVIEW_EVTID_TASK_STOP_EXEC:
|
elif event.id == SYSVIEW_EVTID_TASK_STOP_EXEC:
|
||||||
# delete task from context stack
|
# delete task from context stack
|
||||||
for ctx in self.ctx_stack[event.core_id]:
|
for ctx in self.ctx_stack[event.core_id]:
|
||||||
@@ -1050,12 +1111,18 @@ class SysViewTraceDataProcessor(apptrace.TraceDataProcessor):
|
|||||||
if event.params['tid'].value not in trace.tasks_info:
|
if event.params['tid'].value not in trace.tasks_info:
|
||||||
raise SysViewTraceParseError('Stop ready unknown task 0x%x' % event.params['tid'].value)
|
raise SysViewTraceParseError('Stop ready unknown task 0x%x' % event.params['tid'].value)
|
||||||
if len(self.ctx_stack[event.core_id]):
|
if len(self.ctx_stack[event.core_id]):
|
||||||
if (not self.ctx_stack[event.core_id][-1].irq and event.params['tid'].value == self.ctx_stack[event.core_id][-1].handle):
|
if (
|
||||||
|
not self.ctx_stack[event.core_id][-1].irq
|
||||||
|
and event.params['tid'].value == self.ctx_stack[event.core_id][-1].handle
|
||||||
|
):
|
||||||
# return to the previous context (the last in the list)
|
# return to the previous context (the last in the list)
|
||||||
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id].pop()
|
self.prev_ctx[event.core_id] = self.ctx_stack[event.core_id].pop()
|
||||||
else:
|
else:
|
||||||
# the 1st context switching event after trace start is SYSVIEW_EVTID_TASK_STOP_READY, so we have been in task context
|
# the 1st context switching event after trace start is SYSVIEW_EVTID_TASK_STOP_READY,
|
||||||
self.prev_ctx[event.core_id] = SysViewEventContext(event.params['tid'].value, False, trace.tasks_info[event.params['tid'].value])
|
# so we have been in task context
|
||||||
|
self.prev_ctx[event.core_id] = SysViewEventContext(
|
||||||
|
event.params['tid'].value, False, trace.tasks_info[event.params['tid'].value]
|
||||||
|
)
|
||||||
|
|
||||||
def on_new_event(self, event):
|
def on_new_event(self, event):
|
||||||
"""
|
"""
|
||||||
@@ -1102,6 +1169,7 @@ class SysViewMultiStreamTraceDataProcessor(SysViewTraceDataProcessor):
|
|||||||
"""
|
"""
|
||||||
SystemView trace data processor supporting multiple event streams.
|
SystemView trace data processor supporting multiple event streams.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, traces, print_events=False, keep_all_events=False):
|
def __init__(self, traces, print_events=False, keep_all_events=False):
|
||||||
"""
|
"""
|
||||||
see SysViewTraceDataProcessor.__init__()
|
see SysViewTraceDataProcessor.__init__()
|
||||||
@@ -1143,10 +1211,6 @@ class SysViewMultiStreamTraceDataProcessor(SysViewTraceDataProcessor):
|
|||||||
SysViewTraceDataParser
|
SysViewTraceDataParser
|
||||||
parser object for specified stream and core
|
parser object for specified stream and core
|
||||||
"""
|
"""
|
||||||
if core_id not in self.traces and 0 in self.traces and self.traces[0].esp_ext:
|
|
||||||
# for Espressif extension there is one trace for all cores
|
|
||||||
trace = self.traces[0]
|
|
||||||
else:
|
|
||||||
trace = self.traces[core_id]
|
trace = self.traces[core_id]
|
||||||
if stream_id == SysViewTraceDataParser.STREAMID_SYS:
|
if stream_id == SysViewTraceDataParser.STREAMID_SYS:
|
||||||
return trace
|
return trace
|
||||||
@@ -1219,11 +1283,26 @@ class SysViewTraceDataJsonEncoder(json.JSONEncoder):
|
|||||||
callers = []
|
callers = []
|
||||||
for addr in obj.params['callers'].value:
|
for addr in obj.params['callers'].value:
|
||||||
callers.append('0x{:x}'.format(addr))
|
callers.append('0x{:x}'.format(addr))
|
||||||
return {'ctx_name': obj.ctx_name, 'in_irq': obj.in_irq, 'id': obj.id, 'core_id': obj.core_id,
|
return {
|
||||||
'ts': obj.ts, 'addr': blk_addr, 'size': blk_size, 'callers': callers}
|
'ctx_name': obj.ctx_name,
|
||||||
|
'in_irq': obj.in_irq,
|
||||||
|
'id': obj.id,
|
||||||
|
'core_id': obj.core_id,
|
||||||
|
'ts': obj.ts,
|
||||||
|
'addr': blk_addr,
|
||||||
|
'size': blk_size,
|
||||||
|
'callers': callers,
|
||||||
|
}
|
||||||
if isinstance(obj, SysViewPredefinedEvent) and obj.id == SYSVIEW_EVTID_PRINT_FORMATTED:
|
if isinstance(obj, SysViewPredefinedEvent) and obj.id == SYSVIEW_EVTID_PRINT_FORMATTED:
|
||||||
return {'ctx_name': obj.ctx_name, 'in_irq': obj.in_irq, 'id': obj.id, 'core_id': obj.core_id,
|
return {
|
||||||
'ts': obj.ts, 'msg': obj.params['msg'].value, 'lvl': obj.params['lvl'].value}
|
'ctx_name': obj.ctx_name,
|
||||||
|
'in_irq': obj.in_irq,
|
||||||
|
'id': obj.id,
|
||||||
|
'core_id': obj.core_id,
|
||||||
|
'ts': obj.ts,
|
||||||
|
'msg': obj.params['msg'].value,
|
||||||
|
'lvl': obj.params['lvl'].value,
|
||||||
|
}
|
||||||
if isinstance(obj, SysViewEvent):
|
if isinstance(obj, SysViewEvent):
|
||||||
jobj = obj.to_jsonable()
|
jobj = obj.to_jsonable()
|
||||||
# remove unused fields
|
# remove unused fields
|
||||||
@@ -1240,20 +1319,26 @@ class SysViewHeapTraceDataParser(SysViewTraceDataExtEventParser):
|
|||||||
"""
|
"""
|
||||||
SystemView trace data parser supporting heap events.
|
SystemView trace data parser supporting heap events.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, print_events=False, core_id=0):
|
def __init__(self, print_events=False, core_id=0):
|
||||||
"""
|
"""
|
||||||
SystemView trace data parser supporting multiple event streams.
|
SystemView trace data parser supporting multiple event streams.
|
||||||
see SysViewTraceDataExtEventParser.__init__()
|
see SysViewTraceDataExtEventParser.__init__()
|
||||||
"""
|
"""
|
||||||
SysViewTraceDataExtEventParser.__init__(self, events_num=len(SysViewHeapEvent.events_fmt.keys()), core_id=core_id, print_events=print_events)
|
SysViewTraceDataExtEventParser.__init__(
|
||||||
|
self, events_num=len(SysViewHeapEvent.events_fmt.keys()), core_id=core_id, print_events=print_events
|
||||||
|
)
|
||||||
|
|
||||||
def read_extension_event(self, evt_id, core_id, reader):
|
def read_extension_event(self, evt_id, core_id, reader):
|
||||||
"""
|
"""
|
||||||
Reads heap event.
|
Reads heap event.
|
||||||
see SysViewTraceDataParser.read_extension_event()
|
see SysViewTraceDataParser.read_extension_event()
|
||||||
"""
|
"""
|
||||||
if (self.events_off >= SYSVIEW_MODULE_EVENT_OFFSET and evt_id >= self.events_off and
|
if (
|
||||||
evt_id < self.events_off + self.events_num):
|
self.events_off >= SYSVIEW_MODULE_EVENT_OFFSET
|
||||||
|
and evt_id >= self.events_off
|
||||||
|
and evt_id < self.events_off + self.events_num
|
||||||
|
):
|
||||||
return SysViewHeapEvent(evt_id, core_id, self.events_off, reader)
|
return SysViewHeapEvent(evt_id, core_id, self.events_off, reader)
|
||||||
return SysViewTraceDataParser.read_extension_event(self, evt_id, core_id, reader)
|
return SysViewTraceDataParser.read_extension_event(self, evt_id, core_id, reader)
|
||||||
|
|
||||||
@@ -1263,7 +1348,10 @@ class SysViewHeapTraceDataParser(SysViewTraceDataExtEventParser):
|
|||||||
"""
|
"""
|
||||||
if self.root_proc == self:
|
if self.root_proc == self:
|
||||||
SysViewTraceDataParser.on_new_event(self, event)
|
SysViewTraceDataParser.on_new_event(self, event)
|
||||||
if event.id == SYSVIEW_EVTID_MODULEDESC and event.params['desc'].value == 'M=ESP32 SystemView Heap Tracing Module':
|
if (
|
||||||
|
event.id == SYSVIEW_EVTID_MODULEDESC
|
||||||
|
and event.params['desc'].value == 'M=ESP32 SystemView Heap Tracing Module'
|
||||||
|
):
|
||||||
self.events_off = event.params['evt_off'].value
|
self.events_off = event.params['evt_off'].value
|
||||||
|
|
||||||
|
|
||||||
@@ -1271,7 +1359,10 @@ class SysViewHeapTraceDataProcessor(SysViewTraceDataProcessor, apptrace.BaseHeap
|
|||||||
"""
|
"""
|
||||||
SystemView trace data processor supporting heap events.
|
SystemView trace data processor supporting heap events.
|
||||||
"""
|
"""
|
||||||
def __init__(self, toolchain_pref, elf_path, root_proc=None, traces=[], print_events=False, print_heap_events=False):
|
|
||||||
|
def __init__(
|
||||||
|
self, toolchain_pref, elf_path, root_proc=None, traces=[], print_events=False, print_heap_events=False
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
see SysViewTraceDataProcessor.__init__()
|
see SysViewTraceDataProcessor.__init__()
|
||||||
@@ -1293,11 +1384,9 @@ class SysViewHeapTraceDataProcessor(SysViewTraceDataProcessor, apptrace.BaseHeap
|
|||||||
def handle_event(self, event):
|
def handle_event(self, event):
|
||||||
heap_stream = self.root_proc.get_trace_stream(event.core_id, SysViewTraceDataParser.STREAMID_HEAP)
|
heap_stream = self.root_proc.get_trace_stream(event.core_id, SysViewTraceDataParser.STREAMID_HEAP)
|
||||||
if (event.id - heap_stream.events_off) == 0:
|
if (event.id - heap_stream.events_off) == 0:
|
||||||
heap_event = apptrace.HeapTraceEvent(event, True, toolchain=self.toolchain,
|
heap_event = apptrace.HeapTraceEvent(event, True, toolchain=self.toolchain, elf_path=self.elf_path)
|
||||||
elf_path=self.elf_path)
|
|
||||||
else:
|
else:
|
||||||
heap_event = apptrace.HeapTraceEvent(event, False, toolchain=self.toolchain,
|
heap_event = apptrace.HeapTraceEvent(event, False, toolchain=self.toolchain, elf_path=self.elf_path)
|
||||||
elf_path=self.elf_path)
|
|
||||||
apptrace.BaseHeapTraceDataProcessorImpl.on_new_event(self, heap_event)
|
apptrace.BaseHeapTraceDataProcessorImpl.on_new_event(self, heap_event)
|
||||||
|
|
||||||
def print_report(self):
|
def print_report(self):
|
||||||
@@ -1313,6 +1402,7 @@ class SysViewLogTraceEvent(apptrace.LogTraceEvent):
|
|||||||
"""
|
"""
|
||||||
SystemView log event.
|
SystemView log event.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, ts, msg):
|
def __init__(self, ts, msg):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
@@ -1341,6 +1431,7 @@ class SysViewLogTraceDataParser(SysViewTraceDataParser):
|
|||||||
"""
|
"""
|
||||||
SystemView trace data parser supporting log events.
|
SystemView trace data parser supporting log events.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def event_supported(self, event):
|
def event_supported(self, event):
|
||||||
return event.id == SYSVIEW_EVTID_PRINT_FORMATTED
|
return event.id == SYSVIEW_EVTID_PRINT_FORMATTED
|
||||||
|
|
||||||
@@ -1356,6 +1447,7 @@ class SysViewLogTraceDataProcessor(SysViewTraceDataProcessor, apptrace.BaseLogTr
|
|||||||
"""
|
"""
|
||||||
SystemView trace data processor supporting heap events.
|
SystemView trace data processor supporting heap events.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, traces=[], root_proc=None, print_events=False, print_log_events=False):
|
def __init__(self, traces=[], root_proc=None, print_events=False, print_log_events=False):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
|
@@ -1,47 +1,149 @@
|
|||||||
#!/usr/bin/env python
|
#!/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
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
# This is python script to process various types trace data streams in SystemView format.
|
# 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
|
# 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.
|
# script prints report for every type of trace data stream which was found.
|
||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import traceback
|
import traceback
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import espytrace.apptrace as apptrace
|
import espytrace.apptrace as apptrace
|
||||||
import espytrace.sysview as sysview
|
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,
|
def split_segger_multicore_file(file_path):
|
||||||
logging.ERROR,
|
"""Split SEGGER multicore file into separate core files."""
|
||||||
logging.WARNING,
|
try:
|
||||||
logging.INFO,
|
with open(urlparse(file_path).path, 'rb') as f:
|
||||||
logging.DEBUG
|
# 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 = 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('--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('--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('--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(
|
||||||
parser.add_argument('--include-events', '-i', help='Events types to be included into report.', type=str, choices=['heap', 'log', 'all'], default='all')
|
'--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('--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('--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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
def sig_int_handler(signum, frame):
|
def sig_int_handler(signum, frame):
|
||||||
@@ -60,17 +162,33 @@ def main():
|
|||||||
|
|
||||||
logging.basicConfig(level=verbosity_levels[args.verbose], format='[%(levelname)s] %(message)s')
|
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
|
# parse trace files
|
||||||
parsers = []
|
parsers = []
|
||||||
for i, trace_source in enumerate(args.trace_sources):
|
for i, trace_source in enumerate(args.trace_sources):
|
||||||
try:
|
try:
|
||||||
parser = sysview.SysViewMultiTraceDataParser(print_events=False, core_id=i)
|
parser = sysview.SysViewMultiTraceDataParser(print_events=False, core_id=i)
|
||||||
if include_events['heap']:
|
if include_events['heap']:
|
||||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
parser.add_stream_parser(
|
||||||
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i))
|
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||||
|
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i),
|
||||||
|
)
|
||||||
if include_events['log']:
|
if include_events['log']:
|
||||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
parser.add_stream_parser(
|
||||||
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i))
|
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||||
|
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i),
|
||||||
|
)
|
||||||
parsers.append(parser)
|
parsers.append(parser)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error('Failed to create data parser (%s)!', e)
|
logging.error('Failed to create data parser (%s)!', e)
|
||||||
@@ -97,13 +215,21 @@ def main():
|
|||||||
|
|
||||||
# merge and process traces
|
# merge and process traces
|
||||||
try:
|
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']:
|
if include_events['heap']:
|
||||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
proc.add_stream_processor(
|
||||||
sysview.SysViewHeapTraceDataProcessor(args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events))
|
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||||
|
sysview.SysViewHeapTraceDataProcessor(
|
||||||
|
args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events
|
||||||
|
),
|
||||||
|
)
|
||||||
if include_events['log']:
|
if include_events['log']:
|
||||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
proc.add_stream_processor(
|
||||||
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events))
|
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||||
|
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events),
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error('Failed to create data processor (%s)!', e)
|
logging.error('Failed to create data processor (%s)!', e)
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
@@ -119,11 +245,21 @@ def main():
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
finally:
|
finally:
|
||||||
if args.to_json:
|
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:
|
else:
|
||||||
proc.print_report()
|
proc.print_report()
|
||||||
proc.cleanup()
|
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__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
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
|
When program stops at `heap_trace_stop` quit GDB and OpenOCD
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
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
|
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
|
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 -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 -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
|
$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
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
{ python -m coverage debug sys \
|
{ python -m coverage debug sys && \
|
||||||
&& python -m coverage erase &> output \
|
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 \
|
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 \
|
diff output expected_output && \
|
||||||
&& python -m coverage report \
|
python -m coverage report; \
|
||||||
; } || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
} || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ python -m coverage debug sys \
|
{ python -m coverage debug sys && \
|
||||||
&& python -m coverage erase &> output.json \
|
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 \
|
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 \
|
diff output.json expected_output.json && \
|
||||||
&& python -m coverage report \
|
python -m coverage report; \
|
||||||
; } || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
} || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ python -m coverage debug sys \
|
{ python -m coverage debug sys && \
|
||||||
&& python -m coverage erase &> output \
|
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 \
|
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 \
|
diff output expected_output_mcore && \
|
||||||
&& python -m coverage report \
|
python -m coverage report; \
|
||||||
; } || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
} || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ python -m coverage debug sys \
|
{ python -m coverage debug sys && \
|
||||||
&& python -m coverage erase &> output.json \
|
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 \
|
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 \
|
diff output.json expected_output_mcore.json && \
|
||||||
&& python -m coverage report \
|
python -m coverage report; \
|
||||||
; } || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
} || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
@@ -605,46 +605,46 @@
|
|||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"linux-amd64": {
|
"linux-amd64": {
|
||||||
"sha256": "eb1fa9b21c65b45a2200af6dcc2914e32335d37b6dbbd181778dcc0dc025e70a",
|
"sha256": "766293bd7a08900d3536f87a0a7ade960f07266f16e4147f95ca5ce4e15d4c5d",
|
||||||
"size": 2445546,
|
"size": 2489724,
|
||||||
"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"
|
"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": {
|
"linux-arm64": {
|
||||||
"sha256": "f70334a9b12a75b4d943e09fa5db30973037c39dbb54d6fa9f1a7118228b3d1c",
|
"sha256": "34b6883c372444b49950893b2fc0101aefd10d404a88ef72c97e80199f8544d3",
|
||||||
"size": 2330926,
|
"size": 2371243,
|
||||||
"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"
|
"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": {
|
"linux-armel": {
|
||||||
"sha256": "4ac34d6fd1af86aeda87c8318732f8d691c300c285c7fd2f5037c432c63fbbb3",
|
"sha256": "fd48492cf3ee16577c661fdccc14c349d34a9ab93aac5039ddf72332d4f4b70b",
|
||||||
"size": 2470732,
|
"size": 2517680,
|
||||||
"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"
|
"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": {
|
"linux-armhf": {
|
||||||
"sha256": "75372bdbcef2df64013dd36c88836e1029c52955941b69ca463397ccbd287c21",
|
"sha256": "a468cc108578a1f4553ac0502c814d47791ef79f5997a31e941908fa5119de9c",
|
||||||
"size": 2310816,
|
"size": 2353427,
|
||||||
"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"
|
"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": {
|
"macos": {
|
||||||
"sha256": "9186a7a06304c6d9201cbce4ee3c7099b393bf8d329cda17a68874f92308f6ce",
|
"sha256": "6267be53892a76d535938a1b044b685adc7d292f090447e8a3e3d0f0996474d1",
|
||||||
"size": 2548730,
|
"size": 2585348,
|
||||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-0.12.0-esp32-20250422.tar.gz"
|
"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": {
|
"macos-arm64": {
|
||||||
"sha256": "2cc39318d52f393233ff1f777871aebe5b97b3fbad29556a238489263401b774",
|
"sha256": "150e938ac48a6ee031ddbc8b31043bc7f2073ab2ee4896b658918d35899673c3",
|
||||||
"size": 2593819,
|
"size": 2628741,
|
||||||
"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"
|
"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",
|
"status": "recommended",
|
||||||
"win32": {
|
"win32": {
|
||||||
"sha256": "ecb4f8533fa9098d10000f5f7e8b8eaa8591015b824b481078ddb2b37e7aa6f2",
|
"sha256": "666274b04af7f36b430b6d063006051c37b8635b5175735ad5af07a1fbc6f486",
|
||||||
"size": 2988859,
|
"size": 3034680,
|
||||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win32-0.12.0-esp32-20250422.zip"
|
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-win32-0.12.0-esp32-20250707.zip"
|
||||||
},
|
},
|
||||||
"win64": {
|
"win64": {
|
||||||
"sha256": "e9eae8e1a8d0e030cd81dcb08394a9137cb7338a6211dfabcdbdfb37b58c5a23",
|
"sha256": "5186ba3f7ee29fb6ab68a4ed7bb417211bad76ecdcdf9280a9187ebfd549a3c1",
|
||||||
"size": 2988858,
|
"size": 3034680,
|
||||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win64-0.12.0-esp32-20250422.zip"
|
"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