casaroli commented on code in PR #21428:
URL: https://github.com/apache/nuttx/pull/21428#discussion_r4505525687


##########
sched/clock/clock_perf.c:
##########
@@ -32,13 +32,23 @@
 #include <nuttx/sched.h>
 #include <nuttx/wdog.h>
 
-#ifndef CONFIG_ARCH_PERF_EVENTS_USER_ACCESS
-
 /****************************************************************************
  * Preprocessors
  ****************************************************************************/
 
-#  if defined(CONFIG_PERF_OVERFLOW_CORRECTION) && ULONG_MAX != UINT64_MAX
+/* Use up_perf_*() only when they count.  Else use the system ticks. */
+
+#if defined(CONFIG_ARCH_HAVE_PERF_EVENTS)
+#  ifdef CONFIG_ARCH_PERF_EVENTS

Review Comment:
   Done.



##########
sched/clock/clock_perf.c:
##########
@@ -32,13 +32,23 @@
 #include <nuttx/sched.h>
 #include <nuttx/wdog.h>
 
-#ifndef CONFIG_ARCH_PERF_EVENTS_USER_ACCESS
-
 /****************************************************************************
  * Preprocessors
  ****************************************************************************/
 
-#  if defined(CONFIG_PERF_OVERFLOW_CORRECTION) && ULONG_MAX != UINT64_MAX
+/* Use up_perf_*() only when they count.  Else use the system ticks. */
+
+#if defined(CONFIG_ARCH_HAVE_PERF_EVENTS)
+#  ifdef CONFIG_ARCH_PERF_EVENTS

Review Comment:
   Without the `ARCH_HAVE_PERF_EVENTS` test this is the condition of your 
earlier comment: arm64 has `ALARM_ARCH` and `ARCH_HAVE_PERF_EVENTS`, and with 
`ARCH_PERF_EVENTS` off nothing starts the PMU counter, so `perf_gettime()` 
returns a constant (critmon run time 0 ms on qemu-armv8a:nsh, the first row of 
the table).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to