예제 #1
0
    def __init__(self):
        super().__init__()
        self._hooks = [
            ("sched_switch", self.hook_schedSwitch),
            ("irq_handler_entry", self.hook_irq),
            ("irq_handler_exit", self.hook_irqExit),
            ("softirq_entry", self.hook_softIrq),
            ("softirq_exit", self.hook_softIrqExit),
        ]

        # We only need to set up manually the idle thread and the traced
        # application Paraver entries, the other processes entries will be
        # installed in the callback_newProcessName
        binaryName = ParaverTrace.getBinaryName()
        values = {
            self.Status.Idle:
            "Idle",  # The KernelModel always sets up id 0 for Idle threads
            self.Status.ThisProcess:
            binaryName,  # The KernelModel always sets up id 1 for the traced app
            self.Status.Irq: "IRQ",
            self.Status.SoftIrq: "Soft IRQ",
        }
        ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.KERNEL_PREEMPTIONS,
                                          values, "Kernel Preemptions")
        KernelModel.registerNewProcessNameCallback(
            self.callback_newProcessName)
        KernelModel.registerNewThreadCallback(self.callback_newThread)
예제 #2
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:task_start", self.hook_taskExecute),
         ("nanos6:task_end", self.hook_taskStop),
         ("nanos6:tc:task_create_enter", self.hook_taskStop),
         ("nanos6:tc:task_submit_exit", self.hook_taskExecute),
         ("nanos6:tc:taskwait_enter", self.hook_taskStop),
         ("nanos6:tc:taskwait_exit", self.hook_taskExecute),
         ("nanos6:tc:waitfor_enter", self.hook_taskStop),
         ("nanos6:tc:waitfor_exit", self.hook_taskExecute),
         ("nanos6:tc:mutex_lock_enter", self.hook_taskStop),
         ("nanos6:tc:mutex_lock_exit", self.hook_taskExecute),
         ("nanos6:tc:mutex_unlock_enter", self.hook_taskStop),
         ("nanos6:tc:mutex_unlock_exit", self.hook_taskExecute),
         ("nanos6:tc:blocking_api_block_enter", self.hook_taskStop),
         ("nanos6:tc:blocking_api_block_exit", self.hook_taskExecute),
         ("nanos6:tc:blocking_api_unblock_enter", self.hook_taskStop),
         ("nanos6:tc:blocking_api_unblock_exit", self.hook_taskExecute),
         ("nanos6:tc:spawn_function_enter", self.hook_taskStop),
         ("nanos6:tc:spawn_function_exit", self.hook_taskExecute),
     ]
     values = {
         RuntimeActivity.End: "End",
         RuntimeActivity.Task: "Task",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_TASKS,
                                       values, "Runtime: Task Code")
예제 #3
0
    def __init__(self):
        super().__init__()
        self._hooks = [
            ("sched_switch", self.hook_schedSwitch),
        ]
        self._syscallMap = {}
        self._sys_enter_prefix = len("sys_enter_")
        self._sys_exit_prefix = len("sys_exit_")

        binaryName = ParaverTrace.getBinaryName()

        values = {
            0: "Idle",
            1: binaryName,
            2: "Other Process",
        }

        # Create hooks based on the available syscalls detected
        syscallsEntry, syscallsExit = KernelModel.getSyscallDefinitions()

        index = 3
        for syscall in syscallsEntry:
            self._hooks.append((syscall, self.hook_syscallEntry))
            # Create and map id for this syscall in Paraver's pcf
            name = syscall[self._sys_enter_prefix:]
            self._syscallMap[name] = index
            values[index] = name
            index += 1

        for syscall in syscallsExit:
            self._hooks.append((syscall, self.hook_syscallExit))

        ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.KERNEL_SYSCALLS,
                                          values, "Kernel System Calls")
        KernelModel.registerNewThreadCallback(self.callback_newThread)
예제 #4
0
    def hook_debugRegister(self, event, payload):
        name = event["name"]
        debugId = event["id"]

        extraeId = self.Status.Debug + debugId
        extraeName = "Debug: " + str(name)
        ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_SUBSYSTEMS,
                                          {extraeId: extraeName})
예제 #5
0
 def hook_threadCreate(self, event, payload):
     tid = event["tid"]
     assert (not tid in self._colorMap.keys())
     color = self._colorMap_indx
     self._colorMap[tid] = color
     self._colorMap_indx += 1
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_THREAD_TID,
                                       {color: "thread " + str(tid)})
예제 #6
0
 def __init__(self):
     super().__init__()
     self._hooks = [("nanos6:task_execute", self.hook_taskExecute),
                    ("nanos6:task_block", self.hook_taskStop),
                    ("nanos6:task_end", self.hook_taskStop)]
     values = {
         RuntimeActivity.End: "End",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_TASK_ID,
                                       values, "Task ID")
예제 #7
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:ctf_flush", self.hook_flush),
     ]
     values = {
         0: "End",
         1: "flush",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.CTF_FLUSH, values,
                                       "Nanos6 CTF buffers writes to disk")
     self.blockedThreads = set()
예제 #8
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:thread_shutdown", self.hook_threadShutdown),
         ("nanos6:worker_enter_busy_wait", self.hook_enterBusyWait),
         ("nanos6:worker_exit_busy_wait", self.hook_exitBusyWait)
     ]
     values = {
         RuntimeActivity.End: "End",
         RuntimeActivity.BusyWaiting: "BusyWait",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_BUSYWAITING,
                                       values, "Runtime: Busy Waiting")
예제 #9
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:thread_create", self.hook_initStack),
         ("nanos6:external_thread_create", self.hook_initStack),
         ("nanos6:thread_resume", self.hook_eventContinue),
         ("nanos6:external_thread_resume", self.hook_eventContinue),
         ("nanos6:thread_suspend", self.hook_eventStop),
         ("nanos6:external_thread_suspend", self.hook_eventStop),
         ("nanos6:thread_shutdown", self.hook_eventStop),
         ("nanos6:external_thread_shutdown", self.hook_eventStop),
         ("nanos6:task_execute", self.hook_task),
         ("nanos6:task_block", self.hook_unstack),
         ("nanos6:task_end", self.hook_unstack),
         ("nanos6:worker_enter_busy_wait", self.hook_busyWait),
         ("nanos6:worker_exit_busy_wait", self.hook_unstack),
         ("nanos6:dependency_register_enter", self.hook_dependencyRegister),
         ("nanos6:dependency_register_exit", self.hook_unstack),
         ("nanos6:dependency_unregister_enter",
          self.hook_dependencyUnregister),
         ("nanos6:dependency_unregister_exit", self.hook_unstack),
         ("nanos6:scheduler_add_task_enter", self.hook_schedulerAddTask),
         ("nanos6:scheduler_add_task_exit", self.hook_unstack),
         ("nanos6:scheduler_get_task_enter", self.hook_schedulerGetTask),
         ("nanos6:scheduler_get_task_exit", self.hook_unstack),
         ("nanos6:task_create_enter", self.hook_taskCreate),
         ("nanos6:task_create_exit", self.hook_taskBetweenCreateAndSubmit),
         ("nanos6:task_submit_enter", self.hook_taskSubmit),
         ("nanos6:task_submit_exit", self.hook_unstack),
         ("nanos6:taskfor_init_enter", self.hook_taskforInit),
         ("nanos6:taskfor_init_exit", self.hook_unstack),
         ("nanos6:debug_register", self.hook_debugRegister),
         ("nanos6:debug_enter", self.hook_debug),
         ("nanos6:debug_exit", self.hook_unstack),
     ]
     status = {
         self.Status.Idle: "Idle",
         self.Status.Runtime: "Runtime",
         self.Status.BusyWait: "Busy Wait",
         self.Status.Task: "Task",
         self.Status.DependencyRegister: "Dependency: Register",
         self.Status.DependencyUnregister: "Dependency: Unregister",
         self.Status.SchedulerAddTask: "Scheduler: Add Ready Task",
         self.Status.SchedulerGetTask: "Scheduler: Get Ready Task",
         self.Status.TaskCreate: "Task: Create",
         self.Status.TaskArgsInit: "Task: Arguments Init",
         self.Status.TaskSubmit: "Task: Submit",
         self.Status.TaskforInit: "Task: Taskfor Collaborator Init",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_SUBSYSTEMS,
                                       status, "Runtime Subsystems")
예제 #10
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:thread_resume", self.hook_threadResume),
         ("nanos6:external_thread_resume", self.hook_threadResume),
         ("nanos6:thread_suspend", self.hook_threadStop),
         ("nanos6:external_thread_suspend", self.hook_threadStop),
         ("nanos6:thread_shutdown", self.hook_threadStop),
         ("nanos6:external_thread_shutdown", self.hook_threadStop),
     ]
     values = {
         RuntimeActivity.End: "End",
         RuntimeActivity.Runtime: "Runtime"
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_CODE,
                                       values, "Runtime: Runtime Code")
예제 #11
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:task_label", self.hook_taskLabel),
         ("nanos6:task_start", self.hook_taskExecute),
         ("nanos6:task_end", self.hook_taskStop),
         ("nanos6:task_block", self.hook_taskStop),
         ("nanos6:task_unblock", self.hook_taskExecute),
         ("nanos6:thread_resume", self.hook_threadResume),
         ("nanos6:thread_suspend", self.hook_threadSuspend),
     ]
     values = {
         RuntimeActivity.End: "End",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_TASK_SOURCE,
                                       values, "Running Task Source")
예제 #12
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:external_thread_create", self.hook_threadCreate),
         ("nanos6:thread_create", self.hook_threadCreate),
         ("nanos6:thread_resume", self.hook_threadResume),
         ("nanos6:external_thread_resume", self.hook_threadResume),
         ("nanos6:thread_suspend", self.hook_threadSuspend),
         ("nanos6:external_thread_suspend", self.hook_threadSuspend),
         ("nanos6:thread_shutdown", self.hook_threadSuspend),
         ("nanos6:external_thread_shutdown", self.hook_threadSuspend),
     ]
     self._colorMap = {}
     self._colorMap_indx = 1
     values = {
         RuntimeActivity.End: "End",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_THREAD_TID,
                                       values, "Worker Thread Id (TID)")
예제 #13
0
 def hook_taskLabel(self, event, _):
     source = event["source"]
     taskTypeID = event["type"]
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_TASK_SOURCE,
                                       {taskTypeID: source})
예제 #14
0
 def hook_taskLabel(self, event, _):
     label = event["label"]
     taskTypeID = event["type"]
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNNING_TASK_LABEL,
                                       {taskTypeID: label})
예제 #15
0
    def callback_newProcessName(self, name, perProcessExtraeId):
        """ This is called every time a thread with an unseen command name
		"comm_next" is scheduled for the first time. The kernel model assings an id (perProcessExtraeId) to each of the new command names. The id 0 always corresponds to Idle, the Id 1 to the traced process, and the next process will start at 100. The ids in between are reserved for specific uses such as IRQ. """
        ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.KERNEL_PREEMPTIONS,
                                          {perProcessExtraeId: name})
예제 #16
0
 def __init__(self):
     super().__init__()
     self._hooks = [
         ("nanos6:thread_create", self.hook_initStack),
         ("nanos6:external_thread_create",
          self.hook_initExternalThreadStack),
         ("nanos6:thread_resume", self.hook_eventContinue),
         ("nanos6:external_thread_resume", self.hook_runtime),
         ("nanos6:thread_suspend", self.hook_eventStop),
         ("nanos6:external_thread_suspend", self.hook_unstack),
         ("nanos6:thread_shutdown", self.hook_eventStop),
         ("nanos6:external_thread_shutdown", self.hook_eventStop),
         ("nanos6:task_start", self.hook_task),
         ("nanos6:task_end", self.hook_unstack),
         ("nanos6:tc:taskwait_enter", self.hook_taskWait),
         ("nanos6:tc:taskwait_exit", self.hook_unstack),
         ("nanos6:tc:waitfor_enter", self.hook_waitFor),
         ("nanos6:tc:waitfor_exit", self.hook_unstack),
         ("nanos6:tc:mutex_lock_enter", self.hook_lock),
         ("nanos6:tc:mutex_lock_exit", self.hook_unstack),
         ("nanos6:tc:mutex_unlock_enter", self.hook_unlock),
         ("nanos6:tc:mutex_unlock_exit", self.hook_unstack),
         ("nanos6:tc:blocking_api_block_enter", self.hook_blockingAPIBlock),
         ("nanos6:tc:blocking_api_block_exit", self.hook_unstack),
         ("nanos6:tc:blocking_api_unblock_enter",
          self.hook_blockingAPIUnblock),
         ("nanos6:tc:blocking_api_unblock_exit", self.hook_unstack),
         ("nanos6:oc:blocking_api_unblock_enter",
          self.hook_blockingAPIUnblock),
         ("nanos6:oc:blocking_api_unblock_exit", self.hook_unstack),
         ("nanos6:tc:spawn_function_enter", self.hook_spawnFunction),
         ("nanos6:tc:spawn_function_exit", self.hook_unstack),
         ("nanos6:oc:spawn_function_enter", self.hook_spawnFunction),
         ("nanos6:oc:spawn_function_exit", self.hook_unstack),
         ("nanos6:worker_enter_busy_wait", self.hook_busyWait),
         ("nanos6:worker_exit_busy_wait", self.hook_unstack),
         ("nanos6:dependency_register_enter", self.hook_dependencyRegister),
         ("nanos6:dependency_register_exit", self.hook_unstack),
         ("nanos6:dependency_unregister_enter",
          self.hook_dependencyUnregister),
         ("nanos6:dependency_unregister_exit", self.hook_unstack),
         ("nanos6:scheduler_add_task_enter", self.hook_schedulerAddTask),
         ("nanos6:scheduler_add_task_exit", self.hook_unstack),
         ("nanos6:scheduler_get_task_enter", self.hook_schedulerGetTask),
         ("nanos6:scheduler_get_task_exit", self.hook_unstack),
         ("nanos6:tc:task_create_enter", self.hook_taskCreate),
         ("nanos6:tc:task_create_exit",
          self.hook_taskBetweenCreateAndSubmit),
         ("nanos6:oc:task_create_enter", self.hook_taskCreate),
         ("nanos6:oc:task_create_exit",
          self.hook_taskBetweenCreateAndSubmit),
         ("nanos6:tc:task_submit_enter", self.hook_taskSubmit),
         ("nanos6:tc:task_submit_exit", self.hook_unstack),
         ("nanos6:oc:task_submit_enter", self.hook_taskSubmit),
         ("nanos6:oc:task_submit_exit", self.hook_unstack),
         ("nanos6:taskfor_init_enter", self.hook_taskforInit),
         ("nanos6:taskfor_init_exit", self.hook_unstack),
         ("nanos6:scheduler_lock_client", self.hook_schedLockClient),
         ("nanos6:scheduler_lock_server", self.hook_schedLockServer),
         ("nanos6:scheduler_lock_assign", self.hook_schedLockAssign),
         ("nanos6:scheduler_lock_server_exit", self.hook_unstack),
         ("nanos6:debug_register", self.hook_debugRegister),
         ("nanos6:debug_enter", self.hook_debug),
         ("nanos6:debug_transition", self.hook_debugTransition),
         ("nanos6:debug_exit", self.hook_unstack),
     ]
     status = {
         self.Status.Idle: "Idle",
         self.Status.Runtime: "Runtime",
         self.Status.BusyWait: "Busy Wait",
         self.Status.Task: "Task",
         self.Status.DependencyRegister: "Dependency: Register",
         self.Status.DependencyUnregister: "Dependency: Unregister",
         self.Status.SchedulerAddTask: "Scheduler: Add Ready Task",
         self.Status.SchedulerGetTask: "Scheduler: Get Ready Task",
         self.Status.TaskCreate: "Task: Create",
         self.Status.TaskArgsInit: "Task: Arguments Init",
         self.Status.TaskSubmit: "Task: Submit",
         self.Status.TaskforInit: "Task: Taskfor Collaborator Init",
         self.Status.TaskWait: "Task: TaskWait",
         self.Status.WaitFor: "Task: WaitFor",
         self.Status.Lock: "Task: User Mutex: Lock",
         self.Status.Unlock: "Task: User Mutex: Unlock",
         self.Status.BlockingAPIBlock: "Task: Blocking API: Block",
         self.Status.BlockingAPIUnblock: "Task: Blocking API: Unblock",
         self.Status.SpawnFunction: "SpawnFunction: Spawn",
         self.Status.SchedulerLockEnter: "Scheduler: Lock: Enter",
         self.Status.SchedulerLockServing: "Scheduler: Lock: Serving tasks",
     }
     ParaverTrace.addEventTypeAndValue(ExtraeEventTypes.RUNTIME_SUBSYSTEMS,
                                       status, "Runtime Subsystems")
     self._servedTasks = {}