1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 class SysfsPlatform(object):
6 """A platform-specific utility class for running shell commands and properly
7 gathering c-state data.
9 def RunShellCommand(self, command):
10 """Run command on this particular shell.
13 A command string to be executed in the shell.
16 A string containing the results of the command.
18 raise NotImplementedError()
21 def ParseStateSample(sample):
22 """Parse a single c-state residency sample.
25 sample: A sample of c-state residency times to be parsed. Organized as
26 a dictionary mapping CPU name to a string containing all c-state
27 names, the times in each state, the latency of each state, and the
28 time at which the sample was taken all separated by newlines.
29 Ex: {'cpu0': 'C0\nC1\n5000\n2000\n20\n30\n1406673171'}
32 Dictionary associating a c-state with a time.
34 raise NotImplementedError()