File: spi.py

package info (click to toggle)
pytimechart 1.0.0~rc1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 540 kB
  • sloc: python: 2,239; makefile: 77; sh: 60
file content (33 lines) | stat: -rw-r--r-- 981 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from timechart.plugin import *
from timechart import colors
from timechart.model import tcProcess

# to use with start_spi.sh
last_spi = []
class spi(plugin):
    additional_colors = """
spi_bg		      #80ff80
"""
    additional_ftrace_parsers = [
        ]
    additional_process_types = {
            "spi":(tcProcess, MISC_TRACES_CLASS),
        }
    @staticmethod
    def do_function_spi_sync(proj,event):
        global last_spi
        process = proj.generic_find_process(0,"spi:%s"%(event.caller),"spi")
        last_spi.append(process)
        proj.generic_process_start(process,event,False)
    @staticmethod
    def do_function_spi_complete(proj,event):
        global last_spi
        if len(last_spi):
            process = last_spi.pop(0)
            proj.generic_process_end(process,event,False)
    @staticmethod
    def do_function_spi_async(proj,event):
        if event.caller != 'spi_sync':
            spi.do_function_spi_sync(proj,event)

plugin_register(spi)