[riot-notifications] [RIOT-OS/RIOT] core/schedstatistics: fix call to uninitialized xtimer (#11781)

Gaëtan Harter notifications at github.com
Mon Jul 29 18:16:12 CEST 2019


cladmi commented on this pull request.



> +#ifdef MODULE_SCHED_CB
+void sched_register_cb(void (*callback)(uint32_t, uint32_t))
+{
+    sched_cb = callback;
+}
+#endif
+
+#ifdef MODULE_SCHEDSTATISTICS
+void sched_statistics_cb(uint32_t active_thread, uint32_t next_thread) {
+
+    uint32_t now = xtimer_now().ticks32;
+
+    if((thread_getstatus(active_thread) != STATUS_STOPPED) && \
+       (thread_getstatus(active_thread) != STATUS_NOT_FOUND)) {
+        schedstat_t *active_stat = &sched_pidlist[active_thread];
+        if (active_stat->laststart) {

To change this, I think somehow require that `init_schedstatistics` calls `sched_statistics_cb(KERNEL_PID_UNDEF, sched_active_pid)` with the kept conditional, or does a manual init.

-- 
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/11781#discussion_r308316791
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190729/33abbed7/attachment.htm>


More information about the notifications mailing list