~ubuntu-branches/ubuntu/utopic/pytimechart/utopic

« back to all changes in this revision

Viewing changes to timechart/plugins/spi.py

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2011-11-13 18:14:30 UTC
  • Revision ID: package-import@ubuntu.com-20111113181430-bg2ompukqunnyhtt
Tags: upstream-1.0.0~rc1
ImportĀ upstreamĀ versionĀ 1.0.0~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from timechart.plugin import *
 
2
from timechart import colors
 
3
from timechart.model import tcProcess
 
4
 
 
5
# to use with start_spi.sh
 
6
last_spi = []
 
7
class spi(plugin):
 
8
    additional_colors = """
 
9
spi_bg                #80ff80
 
10
"""
 
11
    additional_ftrace_parsers = [
 
12
        ]
 
13
    additional_process_types = {
 
14
            "spi":(tcProcess, MISC_TRACES_CLASS),
 
15
        }
 
16
    @staticmethod
 
17
    def do_function_spi_sync(proj,event):
 
18
        global last_spi
 
19
        process = proj.generic_find_process(0,"spi:%s"%(event.caller),"spi")
 
20
        last_spi.append(process)
 
21
        proj.generic_process_start(process,event,False)
 
22
    @staticmethod
 
23
    def do_function_spi_complete(proj,event):
 
24
        global last_spi
 
25
        if len(last_spi):
 
26
            process = last_spi.pop(0)
 
27
            proj.generic_process_end(process,event,False)
 
28
    @staticmethod
 
29
    def do_function_spi_async(proj,event):
 
30
        if event.caller != 'spi_sync':
 
31
            spi.do_function_spi_sync(proj,event)
 
32
 
 
33
plugin_register(spi)