dv-flow-mgr 1.8.14920283751rc0__py3-none-any.whl → 1.8.14930698570rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dv_flow/mgr/__init__.py CHANGED
@@ -32,6 +32,6 @@ from .task_runner import TaskSetRunner
32
32
  from .task_listener_log import TaskListenerLog
33
33
 
34
34
  VERSION="1.8.0"
35
- SUFFIX="14920283751rc0"
35
+ SUFFIX="14930698570rc0"
36
36
  __version__="%s%s" % (VERSION, SUFFIX)
37
37
 
@@ -58,6 +58,32 @@ class TaskListenerTrace(object):
58
58
  del self._task_tid_map[task]
59
59
  self._free_tids.append(tid)
60
60
 
61
+ def _get_task_data(self, task: TaskNode) -> dict:
62
+ """Extract serializable task data"""
63
+ data = {}
64
+
65
+ # Add any parameters
66
+ if hasattr(task, 'params') and task.params:
67
+ # If params is a dataclass or has __dict__, get its fields
68
+ if hasattr(task.params, '__dict__'):
69
+ data['params'] = task.params.__dict__
70
+ elif isinstance(task.params, dict):
71
+ data['params'] = task.params
72
+
73
+ # Add inputs if present
74
+ if hasattr(task, 'needs') and task.needs:
75
+ inputs = []
76
+ for need, _ in task.needs:
77
+ if hasattr(need, 'output') and need.output:
78
+ inputs.append({
79
+ 'task': need.name,
80
+ 'data': need.output.__dict__ if hasattr(need.output, '__dict__') else need.output
81
+ })
82
+ if inputs:
83
+ data['inputs'] = inputs
84
+
85
+ return data
86
+
61
87
  def event(self, task: TaskNode, reason: str):
62
88
  """Record a task execution event.
63
89
 
@@ -74,87 +100,72 @@ class TaskListenerTrace(object):
74
100
  # Get current timestamp in microseconds
75
101
  ts = int(time.time() * 1_000_000) if reason == "enter" else int(task.end.timestamp() * 1_000_000)
76
102
 
77
- # Create the duration event
103
+ # Create the duration event with initial args
104
+ args = {}
105
+
106
+ # Add task data
107
+ if reason == "enter":
108
+ # Add input data on task start
109
+ input_data = self._get_task_data(task)
110
+ if input_data:
111
+ args = input_data
112
+
113
+ elif reason == 'leave':
114
+ if task.result:
115
+ # Add status and change info
116
+ args["status"] = task.result.status
117
+ args["changed"] = task.result.changed
118
+
119
+ # Add output data if present
120
+ if hasattr(task.result, 'output') and task.result.output:
121
+ args["output"] = [
122
+ out.__dict__ if hasattr(out, '__dict__') else out
123
+ for out in task.result.output
124
+ ]
125
+
126
+ self._release_tid(task)
127
+
128
+ # Create the event with collected args
78
129
  event = {
79
130
  "name": task.name,
80
131
  "cat": "task",
81
132
  "ph": ph,
82
133
  "pid": 1,
83
134
  "tid": tid,
84
- "ts": ts
135
+ "ts": ts,
136
+ "args": args
85
137
  }
86
138
 
87
139
  # Store the duration event
88
140
  self._events.append(event)
89
141
 
142
+ # Add flow event for dependencies
90
143
  if reason == "enter":
91
- # When a task starts, create flow events from all its dependencies
144
+ # When task starts, add flow event from each dependency
92
145
  for need, _ in task.needs:
93
- flow_id = self._next_flow_id
94
- self._next_flow_id += 1
95
-
96
- # # Add flow end event connecting to this task
97
- # flow_end = {
98
- # "name": f"{need.name} -> {task.name}",
99
- # "cat": "flow",
100
- # "ph": "e", # Flow end
101
- # "pid": 1,
102
- # "tid": tid, # Target task's thread
103
- # "ts": ts,
104
- # "id": flow_id,
105
- # "bp": "e" # Connect to enclosing slice
106
- # }
107
- # self._events.append(flow_end)
108
-
109
- # # Add flow start event from dependency
110
- # flow_start = {
111
- # "name": f"{need.name} -> {task.name}",
112
- # "cat": "flow",
113
- # "ph": "b", # Flow begin
114
- # "pid": 1,
115
- # "tid": self._task_tid_map.get(need, 0), # Source task's thread
116
- # "ts": int(need.end.timestamp() * 1_000_000) if need.end else ts,
117
- # "id": flow_id,
118
- # "bp": "e" # Connect to enclosing slice
119
- # }
120
- # self._events.append(flow_start)
121
-
122
- elif reason == 'leave':
123
- # For completed tasks, emit flow start events
124
- if task.result:
125
- event["args"] = {
126
- "status": task.result.status,
127
- "changed": task.result.changed
146
+ # Create flow start from completed task to this one
147
+ flow = {
148
+ "name": f"{need.name} -> {task.name}",
149
+ "cat": "flow",
150
+ "ph": "s", # Flow start
151
+ "pid": 1,
152
+ "tid": self._task_tid_map.get(need, 0),
153
+ "ts": int(need.end.timestamp() * 1_000_000) if need.end else ts,
154
+ "id": self._next_flow_id,
155
+ "bp": "e"
128
156
  }
129
-
130
- # Find any tasks that depend on this one and create flow events
131
- for dep_task, dep_tid in self._task_tid_map.items():
132
- if any(need[0] is task for need in dep_task.needs):
133
- # # Create flow start event
134
- # flow = {
135
- # "name": f"{task.name} -> {dep_task.name}",
136
- # "cat": "flow",
137
- # "ph": "s", # Flow start
138
- # "pid": 1,
139
- # "tid": tid, # Source task's thread
140
- # "ts": ts, # Use task end time
141
- # "id": self._next_flow_id,
142
- # "bp": "e" # Connect to enclosing slice
143
- # }
144
- # self._events.append(flow)
145
-
146
- # # Create flow end event
147
- # flow_end = {
148
- # "name": f"{task.name} -> {dep_task.name}",
149
- # "cat": "flow",
150
- # "ph": "f", # Flow finish
151
- # "pid": 1,
152
- # "tid": dep_tid, # Target task's thread
153
- # "ts": ts, # Will be updated when target task starts
154
- # "id": self._next_flow_id,
155
- # "bp": "e" # Connect to enclosing slice
156
- # }
157
- # self._events.append(flow_end)
158
- self._next_flow_id += 1
159
-
160
- self._release_tid(task)
157
+ self._events.append(flow)
158
+
159
+ # Create flow finish at the start of this task
160
+ flow_end = {
161
+ "name": f"{need.name} -> {task.name}",
162
+ "cat": "flow",
163
+ "ph": "f", # Flow finish
164
+ "pid": 1,
165
+ "tid": tid,
166
+ "ts": ts,
167
+ "id": self._next_flow_id,
168
+ "bp": "e"
169
+ }
170
+ self._events.append(flow_end)
171
+ self._next_flow_id += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dv-flow-mgr
3
- Version: 1.8.14920283751rc0
3
+ Version: 1.8.14930698570rc0
4
4
  Summary: DV Flow Manager is a build system for silicon design
5
5
  Author-email: Matthew Ballance <matt.ballance@gmail.com>
6
6
  License: Apache License
@@ -1,4 +1,4 @@
1
- dv_flow/mgr/__init__.py,sha256=NUUQLnpk4-yjT3DaUH9ugThEF8n1nqhlzLs6YW9zLHU,1315
1
+ dv_flow/mgr/__init__.py,sha256=SuHUNRUr03Dy5bvMChNK6x76Zw1l66AEIps_uNN-cOQ,1315
2
2
  dv_flow/mgr/__main__.py,sha256=BogNdBkXhgg05E8_IumNkVoag6WwvfbpiI8346oOtPo,3844
3
3
  dv_flow/mgr/cond_def.py,sha256=2ZkzPusqVkN1fFMTvkDl9O_OJLPdD_cK3xzX9J75RMw,343
4
4
  dv_flow/mgr/config.py,sha256=b2MVlVVNB0psk8x4bQRAYshkpNJrtyMtV1Ymhmx9AfM,137
@@ -37,7 +37,7 @@ dv_flow/mgr/task_def.py,sha256=8NPwtTROfWDkMqcO9mKXV4dw0sC4mCMmnsNuv8uTdTY,5094
37
37
  dv_flow/mgr/task_graph_builder.py,sha256=q7BS7OLYkS6uZwQLvo6P_CtJkhIvPal_tXLZHgUuLpU,28172
38
38
  dv_flow/mgr/task_graph_dot_writer.py,sha256=qK4Imy9o2_F1aKoU1tJ-qoBHslq2BhSMbdjAUPfpN7I,6009
39
39
  dv_flow/mgr/task_listener_log.py,sha256=Ai-6X5BOoGsaNTgnlXEW0-czrjJm7__ShNK501CUmko,4337
40
- dv_flow/mgr/task_listener_trace.py,sha256=76Fqb7hiAT2GH8_-_bMRAl6T2lrTly6sP1Zis6BG3wU,6192
40
+ dv_flow/mgr/task_listener_trace.py,sha256=6MvVmy4Rc30qTYpA4yaF760Qlszk34FQOCtRD9slkNE,6064
41
41
  dv_flow/mgr/task_node.py,sha256=OC3rkeRSFv9wmgkMZ_7eJu7nuXGJcwW_b6FGQM-w7AU,5231
42
42
  dv_flow/mgr/task_node_compound.py,sha256=0biBPT_2SpCPJL7DFaFY27_K7kNxJ1taIut3Fv12HXk,3347
43
43
  dv_flow/mgr/task_node_ctor.py,sha256=YsoVMX5WbpbzcHvEK7ps_ZRV-J7MZ3F8NNozQw7vbog,4418
@@ -74,9 +74,9 @@ dv_flow/mgr/util/util.py,sha256=BO7iqP_c9ttmXkojq7nKDN-g8wl1_Pco9k-KnrXxjwE,1889
74
74
  dv_flow/mgr/util/cmds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  dv_flow/mgr/util/cmds/cmd_schema.py,sha256=IJzZdxCSEgIQ79LpYiM7UqJ9RJ-7yraqmBN2XVgAgXA,1752
76
76
  dv_flow/mgr/util/cmds/cmd_workspace.py,sha256=egmaIXpe5L-TePwmcfisfrG6tdiTUWSjqa9Za5WChVs,890
77
- dv_flow_mgr-1.8.14920283751rc0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
78
- dv_flow_mgr-1.8.14920283751rc0.dist-info/METADATA,sha256=CeTzqO-0eYhSYkg9hMV97sS0lr_W_2gulAFrOH5wy_4,13335
79
- dv_flow_mgr-1.8.14920283751rc0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
80
- dv_flow_mgr-1.8.14920283751rc0.dist-info/entry_points.txt,sha256=1roy8wAFM48LabOvr6jiOw0MUs-qE8X3Vf8YykPazxk,50
81
- dv_flow_mgr-1.8.14920283751rc0.dist-info/top_level.txt,sha256=amfVTkggzYPtWwLqNmRukfz1Buu0pGS2SrYBBLhXm04,8
82
- dv_flow_mgr-1.8.14920283751rc0.dist-info/RECORD,,
77
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
78
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/METADATA,sha256=vPln7CEjSer8daHBSV2zvvNRpQi2dYtKvYLIJ3R1yog,13335
79
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
80
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/entry_points.txt,sha256=1roy8wAFM48LabOvr6jiOw0MUs-qE8X3Vf8YykPazxk,50
81
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/top_level.txt,sha256=amfVTkggzYPtWwLqNmRukfz1Buu0pGS2SrYBBLhXm04,8
82
+ dv_flow_mgr-1.8.14930698570rc0.dist-info/RECORD,,