Tests: lttngctl.py: allow the creation of per-pid buffers
[lttng-tools.git] / tests / utils / lttngtest / lttngctl.py
index b034308f3685b3de30b135c8168addd414594aa7..c2afa885f56f14448ea9c5c30bd0688afcfd9a25 100644 (file)
@@ -89,6 +89,17 @@ class TracingDomain(enum.Enum):
         return "<%s.%s>" % (self.__class__.__name__, self.name)
 
 
+@enum.unique
+class BufferSharingPolicy(enum.Enum):
+    """Buffer sharing policy."""
+
+    PerUID = "Per-UID buffering"
+    PerPID = "Per-PID buffering"
+
+    def __repr__(self):
+        return "<%s.%s>" % (self.__class__.__name__, self.name)
+
+
 class EventRule(abc.ABC):
     """Event rule base class, see LTTNG-EVENT-RULE(7)."""
 
@@ -351,8 +362,13 @@ class Session(abc.ABC):
         pass
 
     @abc.abstractmethod
-    def add_channel(self, domain, channel_name=None):
-        # type: (TracingDomain, Optional[str]) -> Channel
+    def add_channel(
+        self,
+        domain,
+        channel_name=None,
+        buffer_sharing_policy=BufferSharingPolicy.PerUID,
+    ):
+        # type: (TracingDomain, Optional[str], BufferSharingPolicy) -> Channel
         """Add a channel with default attributes to the session."""
         pass
 
@@ -371,6 +387,11 @@ class Session(abc.ABC):
         # type: () -> None
         pass
 
+    @abc.abstractmethod
+    def is_active(self):
+        # type: () -> bool
+        pass
+
     @abc.abstractproperty
     def kernel_pid_process_attribute_tracker(self):
         # type: () -> Type[ProcessIDProcessAttributeTracker]
@@ -442,3 +463,83 @@ class Controller(abc.ABC):
         to create a session without an output.
         """
         pass
+
+    @abc.abstractmethod
+    def start_session_by_name(self, name):
+        # type: (str) -> None
+        """
+        Start a session by name.
+        """
+        pass
+
+    @abc.abstractmethod
+    def start_session_by_glob_pattern(self, pattern):
+        # type: (str) -> None
+        """
+        Start sessions whose name matches `pattern`, see GLOB(7).
+        """
+        pass
+
+    @abc.abstractmethod
+    def start_sessions_all(self):
+        """
+        Start all sessions visible to the current user.
+        """
+        # type: () -> None
+        pass
+
+    @abc.abstractmethod
+    def stop_session_by_name(self, name):
+        # type: (str) -> None
+        """
+        Stop a session by name.
+        """
+        pass
+
+    @abc.abstractmethod
+    def stop_session_by_glob_pattern(self, pattern):
+        # type: (str) -> None
+        """
+        Stop sessions whose name matches `pattern`, see GLOB(7).
+        """
+        pass
+
+    @abc.abstractmethod
+    def stop_sessions_all(self):
+        """
+        Stop all sessions visible to the current user.
+        """
+        # type: () -> None
+        pass
+
+    @abc.abstractmethod
+    def destroy_session_by_name(self, name):
+        # type: (str) -> None
+        """
+        Destroy a session by name.
+        """
+        pass
+
+    @abc.abstractmethod
+    def destroy_session_by_glob_pattern(self, pattern):
+        # type: (str) -> None
+        """
+        Destroy sessions whose name matches `pattern`, see GLOB(7).
+        """
+        pass
+
+    @abc.abstractmethod
+    def destroy_sessions_all(self):
+        # type: () -> None
+        """
+        Destroy all sessions visible to the current user.
+        """
+        pass
+
+    @abc.abstractmethod
+    def list_sessions(self):
+        # type: () -> List[Session]
+        """
+        List all sessions visible to the current user.
+        """
+        pass
This page took 0.036169 seconds and 4 git commands to generate.