blob: a2c50696f833c125b7e263988d7534c26f2c96c1 [file] [log] [blame]
Brendan Jackmane81fdcb2017-01-04 17:10:29 +00001# Copyright 2016-2017 ARM Limited
Brendan Jackmana3e1a482016-10-18 14:48:04 +01002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16from trappy.base import Base
17from trappy.dynamic import register_ftrace_parser
18
19class CpuIdle(Base):
20 """Parse cpu_idle"""
21
22 unique_word = "cpu_idle"
Brendan Jackman2555c222016-12-06 12:11:26 +000023 pivot = "cpu_id"
Brendan Jackmana3e1a482016-10-18 14:48:04 +010024
25 def finalize_object(self):
26 # The trace contains "4294967295" instead of "-1" when exiting an idle
27 # state.
28 uint32_max = (2 ** 32) - 1
29 self.data_frame.replace(uint32_max, -1, inplace=True)
30 super(CpuIdle, self).finalize_object()
31
32register_ftrace_parser(CpuIdle)