Skip to contentSkip to conversation

trace-cruncher: Fix the class 'event' constructor

PATCH New Yordan Karadzhov (VMware) 1 participant 1 message Sep 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cruncher: Fix the class 'event' constructor

The constructor must fail in the case when the event is not found on the system.

---
 tracecruncher/ft_utils.py | 2 ++
 1 file changed, 2 insertions(+)
tracecruncher/ft_utils.py +2 -0
index 1fc0648..b5f031a 100644
@@ -46,6 +46,8 @@ class event:
         self.instance_list = []
         if static:
             self.evt_id = find_event_id(system, name)
+            if self.evt_id < 0:
+                raise ValueError('Faild to find event {0}/{1}'.format(system, name))
         else:
             self.evt_id = -1
 
Signature · 1 line
2.30.2