Skip to content

Commit

Permalink
PerfMon support
Browse files Browse the repository at this point in the history
  • Loading branch information
agacek committed Jan 18, 2017
1 parent 4532831 commit 4a1c21f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion camkes/runner/Filters.py
Expand Up @@ -17,7 +17,7 @@
from camkes.internal.seven import cmp, filter, map, zip

import os, re, six, subprocess
from capdl import seL4_FrameObject, Cap, CNode, Frame, TCB, SC, page_sizes, lookup_architecture
from capdl import seL4_FrameObject, Cap, CNode, Frame, TCB, SC, page_sizes, lookup_architecture, Object
from capdl.util import IA32Arch, X64Arch
from camkes.internal.memoization import memoize
from .NameMangling import Perspective
Expand Down Expand Up @@ -836,6 +836,20 @@ def remove_tcb_caps(cspaces, options, **_):
if v is not None and isinstance(v.referent, TCB)]:
del space.cnode[slot]

def add_perfmon_tcb_caps(cspaces, options, **_):
'''Add all TCB caps to PerfMon component.'''
if 'perfmon' in cspaces:
tcbs = set()
for cs in cspaces.values():
for cap in cs.cnode.slots.values():
if cap and isinstance(cap.referent, Object.TCB):
tcbs.add(cap.referent)

perfmon = cspaces['perfmon']
for tcb in tcbs:
assert perfmon.alloc(tcb) >= 0


CAPDL_FILTERS = [
set_tcb_info,
set_tcb_caps,
Expand All @@ -847,6 +861,7 @@ def remove_tcb_caps(cspaces, options, **_):
tcb_properties,
tcb_domains,
remove_tcb_caps,
add_perfmon_tcb_caps,
sc_default_properties,
sc_properties,
]

0 comments on commit 4a1c21f

Please sign in to comment.