Skip to content

Commit 19027c6

Browse files
Enable optional GPROF profiling of apps
Apps can now use gprof to analyze performance and runtimes. This requires significant RAM and really only makes sense on devices with PSRAM to store the state. When the menu item is selected, allocates RAM and tracks function calls and periodically samples the PC to generate a histogram of application usage. Data written out to a gmon.out file, which can then be transferred to a PC using gdb or a SD card.
1 parent f2d30ab commit 19027c6

File tree

8 files changed

+1172
-4
lines changed

8 files changed

+1172
-4
lines changed

boards.txt

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

cores/rp2040/RP2040Support.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class RP2040 {
181181
void begin() {
182182
_epoch = 0;
183183
#if !defined(__riscv)
184-
if (!__isFreeRTOS) {
184+
if (0 && !__isFreeRTOS) {
185185
// Enable SYSTICK exception
186186
exception_set_exclusive_handler(SYSTICK_EXCEPTION, _SystickHandler);
187187
systick_hw->csr = 0x7;
@@ -218,7 +218,7 @@ class RP2040 {
218218
volatile uint64_t _epoch = 0;
219219
inline uint32_t getCycleCount() {
220220
#if !defined(__riscv)
221-
if (!__isFreeRTOS) {
221+
if (0 && !__isFreeRTOS) {
222222
uint32_t epoch;
223223
uint32_t ctr;
224224
do {
@@ -236,7 +236,7 @@ class RP2040 {
236236

237237
inline uint64_t getCycleCount64() {
238238
#if !defined(__riscv)
239-
if (!__isFreeRTOS) {
239+
if (0 && !__isFreeRTOS) {
240240
uint64_t epoch;
241241
uint64_t ctr;
242242
do {

cores/rp2040/_freertos.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ extern bool __isFreeRTOS;
3030
// FreeRTOS has been set up
3131
extern volatile bool __freeRTOSinitted;
3232

33+
#ifdef __cplusplus
3334
extern "C" {
35+
#endif // __cplusplus
3436
struct QueueDefinition; /* Using old naming convention so as not to break kernel aware debuggers. */
3537
typedef struct QueueDefinition * QueueHandle_t;
3638
typedef QueueHandle_t SemaphoreHandle_t;
@@ -57,5 +59,7 @@ extern "C" {
5759

5860
extern void __freertos_task_exit_critical() __attribute__((weak));
5961
extern void __freertos_task_enter_critical() __attribute__((weak));
62+
#ifdef __cplusplus
6063
}
6164
extern SemaphoreHandle_t __get_freertos_mutex_for_ptr(mutex_t *m, bool recursive = false);
65+
#endif // __cplusplus

0 commit comments

Comments
 (0)