[riot-notifications] [RIOT-OS/RIOT] tests/periph_spi: Add thread runtime stats (#14087)

benpicco notifications at github.com
Mon May 18 18:23:01 CEST 2020


@benpicco commented on this pull request.



> @@ -57,6 +61,25 @@ static struct {
     spi_cs_t cs;
 } spiconf;
 
+/*
+ * @brief Trigger an update of the scheduler runtime statistics.
+ *
+ * Increases the number of context switches by one as a side effect
+ */
+static void _sched_statistics_trigger(void)
+{
+    sched_statistics_cb(sched_active_pid, sched_active_pid);
+}
+
+static xtimer_ticks64_t _sched_ticks(void)
+{
+    _sched_statistics_trigger();
+    xtimer_ticks64_t runtime_ticks = {

I think you can just use `xtimer_ticks32_t` here - the measuring period won't be that long and it will be a bit lighter.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14087#pullrequestreview-413750451
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200518/fffbc46d/attachment.htm>


More information about the notifications mailing list