diff mbox series

[2/4] trace-cruncher: Add local_tep() to utils

Message ID 20210712123242.223500-2-y.karadz@gmail.com (mailing list archive)
State Accepted
Headers show
Series [1/4] trace-cruncher: Add set_ftrace_loglevel() | expand

Commit Message

Yordan Karadzhov July 12, 2021, 12:32 p.m. UTC
The function can be used to retrieve the "tep" event of the
current (local) system.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 tracecruncher/ft_utils.py | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tracecruncher/ft_utils.py b/tracecruncher/ft_utils.py
index 5b4f2f2..8c245b1 100644
--- a/tracecruncher/ft_utils.py
+++ b/tracecruncher/ft_utils.py
@@ -11,6 +11,15 @@  import ctypes
 from . import ftracepy as ft
 
 
+def local_tep():
+    """ Get the "tep" event of the current system (local).
+    """
+    tep = ft.tep_handle();
+    tep.init_local(dir=ft.dir());
+
+    return tep
+
+
 def find_event_id(system, event):
     """ Get the unique identifier of a trace event.
     """