Example #1
0
    def __init__(self, function_name = None, steps = None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type = aftermath.templates.postprocess.PostprocessFunction)

        TagWithSteps.__init__(self, steps)
        PostprocessFunction.__init__(self, function_name = function_name)
Example #2
0
 def __init__(self, function_name = None, has_type_param = False):
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type = aftermath.templates.dsk.WriteToBufferFunction)
     WriteToBufferFunction.__init__(self,
                                    function_name = function_name,
                                    has_type_param = has_type_param)
Example #3
0
    def __init__(self,
                 num_elements_field_name,
                 array_field_name,
                 verbatim_field_names,
                 function_name = None):
        """`Num_elements_field` is the name of the field that contains the number of
        elements to be read. `Array_field_name` is the name of the field that
        will point to the array's elements after reading the elements from
        disk. `verbatim_field_names` is a list of names of fields that are to be
        read verbatim from disk. Their order specifies the order in which they
        are read from disk. This list must contain num_elements_field_name."""

        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type = aftermath.templates.dsk.ArrayReadFunction)
        ReadFunction.__init__(self, function_name = function_name)

        enforce_type(num_elements_field_name, str)
        enforce_type(array_field_name, str)

        if not num_elements_field_name in verbatim_field_names:
            raise Exception("The field '" + num_elements_field_name + " with " +
                            "the number of elements must appear in list of " +
                            "fields to be read verbatim")

        self.__num_elements_field_name = num_elements_field_name
        self.__array_field_name = array_field_name
        self.__verbatim_field_names = verbatim_field_names
Example #4
0
    def __init__(self,
                 node_array_struct_name,
                 node_array_ident,
                 rootp_array_struct_name,
                 rootp_array_ident,
                 min_count,
                 max_count,
                 triggers_only_if_at_leats_one_node=True,
                 function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.postprocess.graph.
            CheckRootCountFunction)
        CheckRootCountFunction.__init__(self, function_name=function_name)

        enforce_type(node_array_struct_name, str)
        enforce_type(node_array_ident, str)
        enforce_type(rootp_array_struct_name, str)
        enforce_type(rootp_array_ident, str)
        enforce_type(min_count, int)
        enforce_type(max_count, int)
        enforce_type(triggers_only_if_at_leats_one_node, bool)

        if min_count > max_count:
            raise Exception("Maximum count must be greater than or equal to " +
                            "the minimum count")

        self.__node_array_struct_name = node_array_struct_name
        self.__node_array_ident = node_array_ident
        self.__rootp_array_struct_name = rootp_array_struct_name
        self.__rootp_array_ident = rootp_array_ident
        self.__min_count = min_count
        self.__max_count = max_count
        self.__triggers_only_if_at_leats_one_node = triggers_only_if_at_leats_one_node
Example #5
0
    def __init__(self, function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.mem.
            GenerateProcessCollectSourcesFunction)

        ProcessCollectSourcesFunction.__init__(self,
                                               function_name=function_name)
Example #6
0
    def __init__(self, function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.process.
            TraceMinMaxTimestampCompoundScan)

        TraceMinMaxTimestampCompoundScan.__init__(self,
                                                  function_name=function_name)
Example #7
0
    def __init__(self, function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.dsk.tomem.
            MatchAllMetaStructArraysFunction)

        MatchAllMetaStructArraysFunction.__init__(self,
                                                  function_name=function_name)
Example #8
0
    def __init__(self, dsk_type, mem_type, function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.dsk.tomem.
            AddToAllMetaStructArraysFunction)

        AddToAllMetaStructArraysFunction.__init__(self,
                                                  function_name=function_name)

        enforce_type(dsk_type, Type)
        enforce_type(mem_type, Type)
        self.__dsk_type = dsk_type
        self.__mem_type = mem_type
Example #9
0
    def __init__(self, event_collection_id_dsk_field, function_name=None):
        """`event_collection_id_dsk_field` is a Field of the on-disk type that
        contains the ID of the target event collection.
        """

        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.dsk.tomem.
            PerEventCollectionArrayFunction)

        PerEventCollectionArrayFunction.__init__(self,
                                                 function_name=function_name)

        enforce_type(event_collection_id_dsk_field, Field)

        self.__event_collection_id_dsk_field = event_collection_id_dsk_field
    def __init__(self,
                 template_type,
                 event_array_ident=None,
                 event_array_struct_name=None):
        """The string `event_array_ident` is the string identifier of the event
        collection's event array (e.g., "am::core::state_event"). If this
        value is not specified, the string identifier is determined by using the
        string identifier published by the structure that contains the in-memory
        representation of the on-disk data structure.

        The string `event_array_struct_name` specifies the name of the data
        structure of the per-event collection array. If not specified, it is
        automatically derived from the in-memory type name by appending "_array"

        +--------------------+
        | Trace              |
        +--------------------+
        |                    |
        | Event collections  |--- [ event_collection_id_dsk_field ] --+
        |                    |                                        |
        |                    |                           +----------------------+
        |                    |                           | Event collection     |
        +--------------------+                           +----------------------+
                                                         |                      |
                 +------- [ event_array_ident ] ---------| Event arrays         |
                 |                                       |                      |
        +----------------------------+                   |                      |
        | event_array_struct_name    |                   +----------------------+
        +----------------------------+
        | in-memory event type       |
        | in-memory event type       |
        | in-memory event type       |
        | ...                        |
        | in-memory event type       |
        |                            | <--- insert position
        +----------------------------+
        """

        TemplatedGenerateFunctionTag.__init__(self,
                                              template_type=template_type)

        enforce_type(event_array_ident, [str, type(None)])
        enforce_type(event_array_struct_name, [str, type(None)])

        self.__event_array_ident = event_array_ident
        self.__event_array_struct_name = event_array_struct_name
Example #11
0
    def __init__(self,
                 parent_field,
                 target_array_struct_name,
                 target_array_ident,
                 function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.postprocess.graph.
            CollectGraphRootsFunction)
        CollectGraphRootsFunction.__init__(self, function_name=function_name)

        enforce_type(parent_field, Field)
        enforce_type(target_array_struct_name, str)
        enforce_type(target_array_ident, str)

        self.__parent_field = parent_field
        self.__target_array_struct_name = target_array_struct_name
        self.__target_array_ident = target_array_ident
Example #12
0
    def __init__(self,
                 template_type,
                 trace_array_ident=None,
                 trace_array_struct_name=None):
        """`trace_array_ident` is the string identifier of the per-trace array (e.g.,
        "am::core::state_description"). If not specified, it is determined
        automatically by using the in-memory type's array identifier.

        `trace_array_struct_name` is a string indicating the name of the
        structure that represents the per-trace array (e.g.,
        "am_state_description_array"). If not specified, it is derived by
        extending the in-memory type's name with "_array".

        +--------------------+
        | Trace              |
        +--------------------+
        |                    |
        | Trace arrays       |---- [ trace_array_ident ] --+
        |                    |                             |
        |                    |                       +--------------------------+
        |                    |                       | trace_array_struct_name  |
        +--------------------+                       +--------------------------+
                                                     |                          |
                                                     | in-memory event type     |
                                                     | in-memory event type     |
                                                     | in-memory event type     |
                                                     | ...                      |
                                                     | in-memory event type     |
                                insert position ---> |                          |
                                                     +--------------------------+
        """

        TemplatedGenerateFunctionTag.__init__(self,
                                              template_type=template_type)

        enforce_type(trace_array_ident, [str, type(None)])
        enforce_type(trace_array_struct_name, [str, type(None)])

        self.__trace_array_ident = trace_array_ident
        self.__trace_array_struct_name = trace_array_struct_name
Example #13
0
    def instantiateTemplate(self):
        # If this is a compound type, the types of all fields must also define a
        # WriteToBufferFunction, since this function is invoked for each field.

        if self.getType().isCompound():
            for field in self.getType().getFields():
                if not field.getType().getTagInheriting(WriteToBufferFunction):
                    raise Exception("Cannot generate WriteToBufferFunction for "
                                    "compound type "
                                    "'" + self.getType().getName() + "': Field "
                                    "'" + field.getName() + "' has type "
                                    "'" + field.getType().getName() + "', which "
                                    "does not have a WriteToBufferFunction.")

        return TemplatedGenerateFunctionTag.instantiateTemplate(self)
    def __init__(self,
                 template_type,
                 sub_array_id_type,
                 event_collection_array_ident=None,
                 event_collection_array_struct_name=None,
                 event_array_ident=None,
                 event_array_struct_name=None):
        """`event_collection_id_dsk_field` is a Field of the on-disk type that
        contains the ID of the target event collection.

        `event_id_dsk_field` is the field of the on-disk data type that
        identifies the sub array.

        `event_collection_array_ident` is the string identifier of the array
        owned by the event collection (e.g., "am::core::counter_event"). If
        not specified, it is set to the array identifier of the in-memory
        representationof the event.

        `event_collection_array_struct_name` is the name of the data structure
        representing the array owned by the event collection (e.g.,
        "am_counter_event_array_collection"). If not specified, this name is
        derived from the event array name by appending "_array".

        `event_array_struct_name` is the name of the data structure representing
        the array containing the events (e.g., "counter_event_array"). If not
        specified, this value is generated by adding the suffix "_array" to the
        name of the in-memory data structure.

        +--------------------+
        | Trace              |
        +--------------------+
        |                    |
        | Event collections  |---- [event_collection_id_dsk_field] --+
        |                    |                                       |
        |                    |                           +----------------------+
        |                    |                           | Event collection     |
        +--------------------+                           +----------------------+
                                                         |                      |
                 +-- [ event_collection_array_ident ] ---| Event arrays         |
                 |                                       |                      |
        +------------------------------------+           |                      |
        | event_collection_array_struct_name |           +----------------------+
        +------------------------------------+
        | ID 0                               |
        | ID 7                               |
        | ID 82                              |--- [ event_id_dsk_field ] --+
        | ID 104                             |                             |
        | ...                                |                             |
        +------------------------------------+                             |
                                                   +----------------------------+
                                                   | event_array_struct_name    |
                                                   +----------------------------+
                                                   | in-memory event type       |
                                                   | in-memory event type       |
                                                   | in-memory event type       |
                                                   | ...                        |
                                                   | in-memory event type       |
                              insert position ---> |                            |
                                                   +----------------------------+
        """

        TemplatedGenerateFunctionTag.__init__(self,
                                              template_type=template_type)

        self.__sub_array_id_type = sub_array_id_type
        self.__event_collection_array_ident = event_collection_array_ident
        self.__event_collection_array_struct_name = event_collection_array_struct_name
        self.__event_array_struct_name = event_array_struct_name
        self.__event_array_ident = event_array_ident
Example #15
0
 def __init__(self, function_name = None, steps = None):
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type = aftermath.templates.teardown.TeardownFunction)
     TagWithSteps.__init__(self, steps)
     TeardownFunction.__init__(self, function_name = function_name)
 def __init__(self, function_name=None):
     DestroyAllArraysFunction.__init__(self, function_name=function_name)
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type=aftermath.templates.mem.store.
         pereventcollectionsubarray.DestroyAllArraysFunction)
Example #17
0
    def setType(self, t):
        enforce_type(t, aftermath.types.CompoundType)

        TemplatedGenerateFunctionTag.setType(self, t)
        self.__accessors = self.__findTimestampsCompoundRec(t)
Example #18
0
    def __init__(self, function_name=None, steps=None):
        TemplatedGenerateFunctionTag.__init__(
            self, template_type=aftermath.templates.assertion.AssertFunction)

        TagWithSteps.__init__(self, steps)
        AssertFunction.__init__(self, function_name=function_name)
Example #19
0
 def __init__(self, function_name = None, steps = None):
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type = aftermath.templates.finalize.FinalizeFunction)
     TagWithSteps.__init__(self, steps)
     FinalizeFunction.__init__(self, function_name = function_name)
Example #20
0
    def __init__(self, function_name=None):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type=aftermath.templates.dsk.tomem.PerTraceArrayFunction)

        PerTraceArrayFunction.__init__(self, function_name=function_name)
Example #21
0
 def __init__(self, function_name=None):
     PostConversionFunction.__init__(self, function_name=function_name)
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type=aftermath.templates.dsk.tomem.PostConversionFunction)
     TagWithSteps.__init__(self)
Example #22
0
 def __init__(self, function_name = None):
     TemplatedGenerateFunctionTag.__init__(
         self,
         template_type = aftermath.templates.dsk.DumpStdoutFunction)
     DumpStdoutFunction.__init__(self, function_name = function_name)
Example #23
0
    def __init__(self):
        TemplatedGenerateFunctionTag.__init__(
            self,
            template_type = aftermath.templates.dsk.WriteWithDefaultIDFunction)

        WriteWithDefaultIDFunction.__init__(self)