freemyipod r605 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r604‎ | r605 | r606 >
Date:03:23, 13 February 2011
Author:farthen
Status:new
Tags:
Comment:
emCORE tools: emcore.py: getprocinfo: Only display thread blocking information if the thread is blocked
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -457,8 +457,10 @@
458458 self.logger.info("Threadstruct address: 0x%X\n" % thread.addr, 4)
459459 self.logger.info("Thread type: %s\n" % thread.thread_type, 4)
460460 self.logger.info("Thread state: %s\n" % thread.state, 4)
461 - self.logger.info("Block type: %s\n" % thread.block_type, 4)
462 - self.logger.info("Blocked by: 0x%X\n" % thread.blocked_by, 4)
 461+ if thread.block_type != "THREAD_NOT_BLOCKED":
 462+ self.logger.info("Block type: %s\n" % thread.block_type, 6)
 463+ if thread.blocked_by != 0:
 464+ self.logger.info("Blocked by: 0x%X\n" % thread.blocked_by, 6)
463465 self.logger.info("Priority: %d/255\n" % thread.priority, 4)
464466 self.logger.info("Current CPU load: %.1f%%\n" % ((thread.cpuload * 100) / 255.), 4)
465467 self.logger.info("CPU time (total): %s\n" % datetime.timedelta(microseconds = thread.cputime_total), 4)