Revision 3e8094a0

View differences:

core/src/aos_main.cpp
78 78
/* LOCAL VARIABLES                                                            */
79 79
/******************************************************************************/
80 80

  
81
#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
82

  
83
/**
84
 * @brief   Name of the main thread.
85
 */
86
static const char _threadName[] = "control (main)";
87

  
88
#endif /* (CH_CFG_USE_REGISTRY == TRUE) */
89

  
90 81
/**
91 82
 * @brief   Listener object for GPIO events.
92 83
 */
......
278 269
#if defined(MODULE_INIT_KERNEL_EXTRA)
279 270
  MODULE_INIT_KERNEL_EXTRA();
280 271
#endif /* defined(MODULE_INIT_KERNEL_EXTRA) */
281
#if (CH_CFG_USE_REGISTRY == TRUE)
282
  currp->name = _threadName;
283
#endif /* (CH_CFG_USE_REGISTRY == TRUE) */
284 272

  
285 273
  // AMiRo-OS, additional interrupts and custom OS additions (if any)
286 274
#if (AMIROOS_CFG_SHELL_ENABLE == true)
core/src/aos_system.c
667 667
    sum += thd->stats.cumulative;
668 668
    thd = chRegNextThread(thd);
669 669
  } while (thd);
670
  sum += ch.kernel_stats.m_crit_thd.cumulative + ch.kernel_stats.m_crit_isr.cumulative;
670
  sum += ch.kernel_stats.m_crit_thd.cumulative;
671
  sum += ch.kernel_stats.m_crit_isr.cumulative;
671 672

  
672
  // calculate and retreive cpu load per thread
673
  // retreive, calculate and print performance measures
673 674
  chprintf(stream, "threads & critical zones:\n");
674 675
  thd = chRegFirstThread();
675 676
  do {
676 677
    chprintf(stream, "\t%22s: %6.2f%%\n",
677 678
             (thd->name != NULL) ? thd->name : "<unnamed thread>",
678
             (float)thd->stats.cumulative / (float)sum * 100.f);
679
             (double)((float)thd->stats.cumulative / (float)sum * 100.f));
679 680
    thd = chRegNextThread(thd);
680 681
  } while (thd);
681 682
  chprintf(stream, "\t%22s: %6.2f%%\n",
682 683
           "thread critical zones",
683
           (float)ch.kernel_stats.m_crit_thd.cumulative / (float)sum * 100.f);
684
           (double)((float)ch.kernel_stats.m_crit_thd.cumulative / (float)sum * 100.f));
684 685
  chprintf(stream, "\t%22s: %6.2f%%\n",
685 686
           "ISR critical zones",
686
           (float)ch.kernel_stats.m_crit_isr.cumulative / (float)sum * 100.f);
687
           (double)((float)ch.kernel_stats.m_crit_isr.cumulative / (float)sum * 100.f));
687 688

  
688 689
  // retreive further real-time statistics
689 690
  chprintf(stream, "\nworst critical zones:\n");
690
  chprintf(stream, "\tthreads: %uus (%u clocks @ %uMHz)\n",
691
  chprintf(stream, "\tthreads: %uus (%u clock cycles)\n",
691 692
           RTC2US(SystemCoreClock, ch.kernel_stats.m_crit_thd.worst),
692
           ch.kernel_stats.m_crit_thd.worst,
693
           SystemCoreClock / 1000000);
694
  chprintf(stream, "\t   ISRs: %uus (%u clocks @ %uMHz)\n",
693
           ch.kernel_stats.m_crit_thd.worst);
694
  chprintf(stream, "\t   ISRs: %uus (%u clock cycles)\n",
695 695
           RTC2US(SystemCoreClock, ch.kernel_stats.m_crit_isr.worst),
696
           ch.kernel_stats.m_crit_isr.worst,
697
           SystemCoreClock / 1000000);
696
           ch.kernel_stats.m_crit_isr.worst);
698 697

  
699 698
  return 0;
700 699
}

Also available in: Unified diff