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.

(cherry picked from commit 4709507f3e)
This commit is contained in:
Erhan Kurubas
2026-09-09 12:24:53 +02:00
parent 1971a58caa
commit 08bc66dc08
5 changed files with 40 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.
*/