Changes in kernel/generic/src/sysinfo/stats.c [dfa4be62:169815e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/sysinfo/stats.c
rdfa4be62 r169815e 299 299 { 300 300 assert(interrupts_disabled()); 301 assert(irq_spinlock_locked(&thread->lock)); 301 302 302 303 stats_thread->thread_id = thread->tid; 303 304 stats_thread->task_id = thread->task->taskid; 304 stats_thread->state = atomic_get_unordered(&thread->state); 305 stats_thread->priority = atomic_get_unordered(&thread->priority); 306 stats_thread->ucycles = atomic_time_read(&thread->ucycles); 307 stats_thread->kcycles = atomic_time_read(&thread->kcycles); 308 309 cpu_t *cpu = atomic_get_unordered(&thread->cpu); 310 311 if (cpu != NULL) { 305 stats_thread->state = thread->state; 306 stats_thread->priority = thread->priority; 307 stats_thread->ucycles = thread->ucycles; 308 stats_thread->kcycles = thread->kcycles; 309 310 if (thread->cpu != NULL) { 312 311 stats_thread->on_cpu = true; 313 stats_thread->cpu = cpu->id;312 stats_thread->cpu = thread->cpu->id; 314 313 } else 315 314 stats_thread->on_cpu = false; … … 362 361 thread_t *thread = thread_first(); 363 362 while (thread != NULL) { 363 /* Interrupts are already disabled */ 364 irq_spinlock_lock(&thread->lock, false); 365 364 366 /* Record the statistics and increment the index */ 365 367 produce_stats_thread(thread, &stats_threads[i]); 366 368 i++; 369 370 irq_spinlock_unlock(&thread->lock, false); 367 371 368 372 thread = thread_next(thread); … … 620 624 ret.data.size = sizeof(stats_thread_t); 621 625 626 /* 627 * Replaced hand-over-hand locking with regular nested sections 628 * to avoid weak reference leak issues. 629 */ 630 irq_spinlock_lock(&thread->lock, false); 622 631 produce_stats_thread(thread, stats_thread); 632 irq_spinlock_unlock(&thread->lock, false); 623 633 624 634 irq_spinlock_unlock(&threads_lock, true);
Note:
See TracChangeset
for help on using the changeset viewer.