osa_machine_query osa_mapper_control
API Reference Manual  /  7 Simulator-to-Simulator Interfaces  / 

osa_mapper_admin

Description

tracker_updated is called from the node tree when entities are added, modified or removed. To receive such an update, the mapper must subscribe to tracker updates by calling subscribe_tracker in the osa_tracker_state_notification interface. The initiator argument is the processor object that initiated the transaction. This can be nil if the transaction was not initiated by a processor (for example, enable or disable tracker). The format of changeset is a dictionary with tracker objects that were updated as keys and other dictionaries as values.

The dictionary that is set as the value for each tracker contains the following keywords: "added", "modified", "removed" and "events".

The value for "added" is a dictionary which contains the added entity IDs as keys and the attributes of those entities as values.

An example of "added" where two entities were added:

"added": {0x1000: {"name": "task1", "pid": 1},
          0x2000: {"name": "task2", "pid": 2}}

The value for "modified" is a dictionary which contains the modified entity IDs as keys and a dictionary with the attribute name as key and a list of old and new values for that attribute as its value. Only the attributes that have changed will be included. If an attribute is removed that will be set so that it changed to nil. If an attribute was added that will be set so that it changed from nil.

An example of "modified", entity 0x1000 had "name" changed and entity 0x2000 had "tgid" added and "pid" removed:

"modified": {0x1000: {"name": ["task1", "new_name"]},
             0x2000: {"tgid": [None, 4], "pid": [2, None]}}

The value for "removed" is a list which contains the entity IDs for the entities that have been removed.

The value for "events" is a dictionary indexed by the entity id. Each value is a list of lists, each inner list is an event. The first element of the inner list is the event name and the second element is user defined data associated with the event.

An example of "events" where entity 0x1000 has two associated events and entity 0x2000 has one associated event:

"events": {0x1000: [["event1", {}], ["event2", {}]],
           0x2000: [["syscall", {'sys_num': 0x10, 'sys_name': "open"}]]}

An example of how the complete changeset might look like:

{<the tracker 'tracker1_obj'>: {"added": {0x1000: {"name": "task"}},
                                "modified": {0x2000: {"dummy": [1, 2]}},
                                "removed": [0x3000, 0x3100]},}

SIM_INTERFACE(osa_mapper_admin) {
        void (*tracker_updated)(conf_object_t *NOTNULL obj,
                                conf_object_t *initiator,
                                attr_value_t changeset);
};
#define OSA_MAPPER_ADMIN_INTERFACE "osa_mapper_admin"

Execution Context
Cell Context for all methods.

osa_machine_query osa_mapper_control