change(esp_trace): skip unused timer reads on the per-event path

Lock take called esp_timer_get_time() before trying the spinlock, and the
C3 default timestamp went through esp_timer's tick-to-us conversion.
Try the lock first, and read systimer ticks directly.
This commit is contained in:
Erhan Kurubas
2026-08-26 10:39:18 +02:00
parent 44a38047bb
commit 4709507f3e
6 changed files with 41 additions and 6 deletions
@@ -20,8 +20,8 @@ extern "C" {
* @brief Initialize the trace timestamp source.
*
* This function initializes the trace timestamp source based on the configured
* source. The timestamp source can be the CPU cycle counter, esp_timer, or
* Timer Group, depending on configuration.
* source. The timestamp source can be the CPU cycle counter, esp_timer,
* Timer Group, or systimer, depending on configuration.
*
* @return The timestamp frequency in Hz.
*/
@@ -31,7 +31,8 @@ uint32_t esp_trace_timestamp_init(void);
* @brief Get the current timestamp value from the configured source for ESP trace.
*
* This function returns the current timestamp value, which can be sourced from
* the CPU cycle counter, esp_timer, or Timer Group, depending on configuration.
* the CPU cycle counter, esp_timer, Timer Group, or systimer, depending on
* configuration.
*
* @return The current timestamp value as a 32-bit unsigned integer.
*/