diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2011-02-18 11:03:54 +0100 |
---|---|---|
committer | Pierre Tardy <tardyp@gmail.com> | 2011-02-28 15:51:18 +0100 |
commit | 14eff59829a593b2e58666ca9d349d9c95e91df7 (patch) | |
tree | 0a77a96faacb814e33426b7d1c4d830ab1414a1d | |
parent | 85cf2786c1a62fc5d35b1120c2db38aa5e387dd7 (diff) |
pluginis/cpuidle: support for new stable cpuidle tracepoint
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
-rw-r--r-- | timechart/plugins/cpuidle.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/timechart/plugins/cpuidle.py b/timechart/plugins/cpuidle.py new file mode 100644 index 0000000..1fb0dde --- /dev/null +++ b/timechart/plugins/cpuidle.py @@ -0,0 +1,35 @@ +from timechart.plugin import * +from timechart import colors +from timechart.model import tcProcess, c_state_table + +class cpu_idle(plugin): + additional_colors = """ +""" + additional_ftrace_parsers = [ + ('cpu_idle', 'state=%d cpu_id=%d', 'state', 'cpuid'), + ] + + additional_process_types = { + } + + @staticmethod + def do_event_cpu_idle(self,event): + self.ensure_cpu_allocated(event.cpuid) + tc = self.tmp_c_states[event.cpuid] + if event.state != 4294967295 : + if len(tc['start_ts'])>len(tc['end_ts']): + tc['end_ts'].append(event.timestamp) + self.missed_power_end +=1 + if self.missed_power_end < 10: + print "warning: missed cpu_idle end" + if self.missed_power_end == 10: + print "warning: missed cpu_idle end: wont warn anymore!" + tc['start_ts'].append(event.timestamp) + tc['types'].append(colors.get_color_id(c_state_table[int(event.state)])) + tc['linenumbers'].append(event.linenumber) + else : + if len(tc['start_ts'])>len(tc['end_ts']): + tc['end_ts'].append(event.timestamp) + +plugin_register(cpu_idle) + |