* [PATCH] trace-cruncher: Fix the class 'event' constructor
@ 2021-09-23 8:25 Yordan Karadzhov (VMware)
0 siblings, 0 replies; only message in thread
From: Yordan Karadzhov (VMware) @ 2021-09-23 8:25 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)
The constructor must fail in the case when the event is not found
on the system.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
tracecruncher/ft_utils.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tracecruncher/ft_utils.py b/tracecruncher/ft_utils.py
index 1fc0648..b5f031a 100644
--- a/tracecruncher/ft_utils.py
+++ b/tracecruncher/ft_utils.py
@@ -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
--
2.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-23 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 8:25 [PATCH] trace-cruncher: Fix the class 'event' constructor Yordan Karadzhov (VMware)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).