mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
sys_view: upgrade to version 3.42
This commit is contained in:
parent
8b824d4f79
commit
18e5627a86
@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
----------------------------------------------------------------------
|
||||
|
@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
|
@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
----------------------------------------------------------------------
|
||||
|
@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
|
@ -49,14 +49,14 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
||||
File : SEGGER_SYSVIEW.c
|
||||
Purpose : System visualization API implementation.
|
||||
Revision: $Rev: 26232 $
|
||||
Revision: $Rev: 28341 $
|
||||
|
||||
Additional information:
|
||||
Packet format:
|
||||
@ -781,14 +781,14 @@ Send:
|
||||
//
|
||||
// Backwards U32 encode EventId.
|
||||
//
|
||||
if (NumBytes < (1u << 14)) { // Encodes in 2 bytes
|
||||
if (NumBytes < (1ul << 14)) { // Encodes in 2 bytes
|
||||
*--pStartPacket = (U8)(NumBytes >> 7);
|
||||
*--pStartPacket = (U8)(NumBytes | 0x80);
|
||||
} else if (NumBytes < (1u << 21)) { // Encodes in 3 bytes
|
||||
} else if (NumBytes < (1ul << 21)) { // Encodes in 3 bytes
|
||||
*--pStartPacket = (U8)(NumBytes >> 14);
|
||||
*--pStartPacket = (U8)((NumBytes >> 7) | 0x80);
|
||||
*--pStartPacket = (U8)(NumBytes | 0x80);
|
||||
} else if (NumBytes < (1u << 28)) { // Encodes in 4 bytes
|
||||
} else if (NumBytes < (1ul << 28)) { // Encodes in 4 bytes
|
||||
*--pStartPacket = (U8)(NumBytes >> 21);
|
||||
*--pStartPacket = (U8)((NumBytes >> 14) | 0x80);
|
||||
*--pStartPacket = (U8)((NumBytes >> 7) | 0x80);
|
||||
@ -822,11 +822,11 @@ Send:
|
||||
if (EventId < (1u << 14)) { // Encodes in 2 bytes
|
||||
*--pStartPacket = (U8)(EventId >> 7);
|
||||
*--pStartPacket = (U8)(EventId | 0x80);
|
||||
} else if (EventId < (1u << 21)) { // Encodes in 3 bytes
|
||||
} else if (EventId < (1ul << 21)) { // Encodes in 3 bytes
|
||||
*--pStartPacket = (U8)(EventId >> 14);
|
||||
*--pStartPacket = (U8)((EventId >> 7) | 0x80);
|
||||
*--pStartPacket = (U8)(EventId | 0x80);
|
||||
} else if (EventId < (1u << 28)) { // Encodes in 4 bytes
|
||||
} else if (EventId < (1ul << 28)) { // Encodes in 4 bytes
|
||||
*--pStartPacket = (U8)(EventId >> 21);
|
||||
*--pStartPacket = (U8)((EventId >> 14) | 0x80);
|
||||
*--pStartPacket = (U8)((EventId >> 7) | 0x80);
|
||||
@ -1369,7 +1369,7 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
||||
*
|
||||
* Function description
|
||||
* Initializes the SYSVIEW module.
|
||||
* Must be called before the Systemview Application connects to
|
||||
* Must be called before the SystemView Application connects to
|
||||
* the system.
|
||||
*
|
||||
* Parameters
|
||||
@ -1867,7 +1867,7 @@ void SEGGER_SYSVIEW_Start(void) {
|
||||
* Stop recording SystemView events.
|
||||
*
|
||||
* This function is triggered by the SystemView Application on disconnect.
|
||||
* For single-shot or post-mortem mode recording, it can be called
|
||||
* For single-shot or postmortem mode recording, it can be called
|
||||
* by the application.
|
||||
*
|
||||
* Additional information
|
||||
@ -1978,7 +1978,7 @@ void SEGGER_SYSVIEW_SendTaskList(void) {
|
||||
*
|
||||
* Function description
|
||||
* Send the system description string to the host.
|
||||
* The system description is used by the Systemview Application
|
||||
* The system description is used by the SystemView Application
|
||||
* to identify the current application and handle events accordingly.
|
||||
*
|
||||
* The system description is usually called by the system description
|
||||
@ -2448,6 +2448,179 @@ void SEGGER_SYSVIEW_NameResource(U32 ResourceId, const char* sName) {
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapDefine()
|
||||
*
|
||||
* Function description
|
||||
* Define heap.
|
||||
*
|
||||
* Parameters
|
||||
* pHeap - Pointer to heap control structure.
|
||||
* pBase - Pointer to managed heap memory.
|
||||
* HeapSize - Size of managed heap memory in bytes.
|
||||
* MetadataSize - Size of metadata associated with each heap allocation.
|
||||
*
|
||||
* Additional information
|
||||
* SystemView can track allocations across multiple heaps.
|
||||
*
|
||||
* HeapSize must be a multiple of the natural alignment unit of the
|
||||
* target. This size is subject to compression, controlled by the
|
||||
* specific setting of SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*
|
||||
* MetadataSize defines the size of the per-allocation metadata.
|
||||
* For many heap implementations, the metadata size is a multiple of
|
||||
* the word size of the machine and typically contains the size
|
||||
* of the allocated block (used upon deallocation), optional
|
||||
* pointers to the preceding and/or following blocks, and optionally
|
||||
* a tag identifying the owner of the block. Note that MetadataSize
|
||||
* is not compressed within the SystemView packet and is not
|
||||
* required to be a multiple of 1<<SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_HeapDefine(void* pHeap, void *pBase, unsigned int HeapSize, unsigned int MetadataSize) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_DEFINE);
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pBase));
|
||||
ENCODE_U32(pPayload, HeapSize >> SEGGER_SYSVIEW_ID_SHIFT);
|
||||
ENCODE_U32(pPayload, MetadataSize);
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapAlloc()
|
||||
*
|
||||
* Function description
|
||||
* Record a system-heap allocation event.
|
||||
*
|
||||
* Parameters
|
||||
* pHeap - Pointer to heap where allocation was made.
|
||||
* pUserData - Pointer to allocated user data.
|
||||
* UserDataLen - Size of block allocated to hold user data, excluding any metadata.
|
||||
*
|
||||
* Additional information
|
||||
* The user data must be correctly aligned for the architecture, which
|
||||
* typically requires that the alignment is at least the alignment
|
||||
* of a double or a long long. pUserData is, therefore, compressed by
|
||||
* shrinking as IDs are compressed, controlled by the specific setting
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*
|
||||
* In the same way, UserDataLen must reflect the size of the allocated
|
||||
* block, not the allocation size requested by the application. This
|
||||
* size is also subject to compression, controlled by the specific setting
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*
|
||||
* As an example, assume the allocator is running on a Cortex-M device
|
||||
* with SEGGER_SYSVIEW_ID_SHIFT set to 2 (the word alignment of the device).
|
||||
* If a user requests an allocation of 5 bytes, a hypothetical heap
|
||||
* allocator could allocate a block with size 32 bytes for this. The value
|
||||
* of UserDataLen sent to SystemView for recording should be 32, not 5,
|
||||
* and the 32 is compressed by shifting by two bits, the configured value
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT, and describes the number of bytes that are
|
||||
* consumed from managed memory from which SystemView can calculate
|
||||
* accurate heap metrics.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_HeapAlloc(void *pHeap, void* pUserData, unsigned int UserDataLen) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 3 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_ALLOC);
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
|
||||
ENCODE_U32(pPayload, UserDataLen >> SEGGER_SYSVIEW_ID_SHIFT);
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapAllocEx()
|
||||
*
|
||||
* Function description
|
||||
* Record a per-heap allocation event.
|
||||
*
|
||||
* Parameters
|
||||
* pHeap - Pointer to heap where allocation was made.
|
||||
* pUserData - Pointer to allocated user data.
|
||||
* UserDataLen - Size of block allocated to hold user data, excluding any metadata.
|
||||
* Tag - Block tag, typically used to identify the owner of the block.
|
||||
*
|
||||
* Additional information
|
||||
* The user data must be correctly aligned for the architecture, which
|
||||
* typically requires that the alignment is at least the alignment
|
||||
* of a double or a long long. pUserData is, therefore, compressed by
|
||||
* shrinking as IDs are compressed, controlled by the specific setting
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*
|
||||
* In the same way, UserDataLen must reflect the size of the allocated
|
||||
* block, not the allocation size requested by the application. This
|
||||
* size is also subject to compression, controlled by the specific setting
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT.
|
||||
*
|
||||
* As an example, assume the allocator is running on a Cortex-M device
|
||||
* with SEGGER_SYSVIEW_ID_SHIFT set to 2 (the word alignment of the device).
|
||||
* If a user requests an allocation of 5 bytes, a hypothetical heap
|
||||
* allocator could allocate a block with size 32 bytes for this. The value
|
||||
* of UserDataLen sent to SystemView for recording should be 32, not 5,
|
||||
* and the 32 is compressed by shifting by two bits, the configured value
|
||||
* of SEGGER_SYSVIEW_ID_SHIFT, and describes the number of bytes that are
|
||||
* consumed from managed memory from which SystemView can calculate
|
||||
* accurate heap metrics.
|
||||
*
|
||||
* See also
|
||||
* SEGGER_SYSVIEW_HeapAlloc().
|
||||
*/
|
||||
void SEGGER_SYSVIEW_HeapAllocEx(void *pHeap, void* pUserData, unsigned int UserDataLen, unsigned int Tag) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 5 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_ALLOC_EX);
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
|
||||
ENCODE_U32(pPayload, UserDataLen >> SEGGER_SYSVIEW_ID_SHIFT);
|
||||
ENCODE_U32(pPayload, Tag);
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapFree()
|
||||
*
|
||||
* Function description
|
||||
* Record a heap deallocation event.
|
||||
*
|
||||
* Parameters
|
||||
* pHeap - Pointer to heap where allocation was made.
|
||||
* pUserData - Pointer to allocated user data.
|
||||
*
|
||||
* Additional information
|
||||
* SystemViews track allocations and knows the size of the
|
||||
* allocated data.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_HeapFree(void* pHeap, void* pUserData) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_FREE);
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
|
||||
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SendPacket()
|
||||
|
@ -49,13 +49,13 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
File : SEGGER_SYSVIEW.h
|
||||
Purpose : System visualization API.
|
||||
Revision: $Rev: 26226 $
|
||||
Revision: $Rev: 28237 $
|
||||
*/
|
||||
|
||||
#ifndef SEGGER_SYSVIEW_H
|
||||
@ -137,6 +137,10 @@ extern "C" {
|
||||
//
|
||||
#define SYSVIEW_EVTID_EX_MARK 0
|
||||
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
|
||||
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||
//
|
||||
// Event masks to disable/enable events
|
||||
//
|
||||
@ -301,6 +305,11 @@ void SEGGER_SYSVIEW_MarkStop (unsigned int MarkerId);
|
||||
void SEGGER_SYSVIEW_Mark (unsigned int MarkerId);
|
||||
void SEGGER_SYSVIEW_NameMarker (unsigned int MarkerId, const char* sName);
|
||||
|
||||
void SEGGER_SYSVIEW_HeapDefine (void* pHeap, void* pBase, unsigned int HeapSize, unsigned int MetadataSize);
|
||||
void SEGGER_SYSVIEW_HeapAlloc (void* pHeap, void* pUserData, unsigned int UserDataLen);
|
||||
void SEGGER_SYSVIEW_HeapAllocEx (void* pHeap, void* pUserData, unsigned int UserDataLen, unsigned int Tag);
|
||||
void SEGGER_SYSVIEW_HeapFree (void* pHeap, void* pUserData);
|
||||
|
||||
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
|
||||
|
||||
int SEGGER_SYSVIEW_SendPacket (U8* pPacket, U8* pPayloadEnd, unsigned int EventId);
|
||||
|
@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@ -1,16 +1,16 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2017 SEGGER Microcontroller GmbH & Co. KG
|
||||
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2017-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH & Co. KG *
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 2015 - 2017 SEGGER Microcontroller GmbH & Co. KG *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@ -24,24 +24,14 @@
|
||||
* *
|
||||
* SEGGER strongly recommends to not make any changes *
|
||||
* to or modify the source code of this software in order to stay *
|
||||
* compatible with the RTT protocol and J-Link. *
|
||||
* compatible with the SystemView and RTT protocol, and J-Link. *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or *
|
||||
* without modification, are permitted provided that the following *
|
||||
* conditions are met: *
|
||||
* condition is met: *
|
||||
* *
|
||||
* o Redistributions of source code must retain the above copyright *
|
||||
* notice, this list of conditions and the following disclaimer. *
|
||||
* *
|
||||
* o Redistributions in binary form must reproduce the above *
|
||||
* copyright notice, this list of conditions and the following *
|
||||
* disclaimer in the documentation and/or other materials provided *
|
||||
* with the distribution. *
|
||||
* *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
|
||||
* nor the names of its contributors may be used to endorse or *
|
||||
* promote products derived from this software without specific *
|
||||
* prior written permission. *
|
||||
* notice, this condition and the following disclaimer. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
|
||||
@ -59,14 +49,14 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: V2.42 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
||||
File : SEGGER_SYSVIEW_Config_FreeRTOS.c
|
||||
Purpose : Sample setup configuration of SystemView with FreeRTOS.
|
||||
Revision: $Rev: 3734 $
|
||||
Revision: $Rev: 7745 $
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.32 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
@ -109,7 +109,6 @@ systemview:
|
||||
allowed_licenses:
|
||||
- Apache-2.0
|
||||
- BSD-1-Clause
|
||||
- BSD-3-Clause
|
||||
license_for_new_files: Apache-2.0
|
||||
|
||||
spiffs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user