Esempio n. 1
0
    def events(self):
        """
        Generates the ordered :class:`Event` objects of all the opened
        traces contained in this trace collection.

        Due to limitations of the native Babeltrace API, only one event
        may be "alive" at a given time, i.e. a user **should never**
        store a copy of the events returned by this function for
        ulterior use. Users shall make sure to copy the information
        they need *from* an event before accessing the next one.
        """

        begin_pos_ptr = nbt._bt_python_create_iter_pos()
        end_pos_ptr = nbt._bt_python_create_iter_pos()
        begin_pos_ptr.type = nbt.SEEK_BEGIN
        end_pos_ptr.type = nbt.SEEK_LAST

        for event in self._events(begin_pos_ptr, end_pos_ptr):
            yield event

        nbt._bt_iter_free_pos(begin_pos_ptr);
        nbt._bt_iter_free_pos(end_pos_ptr);
Esempio n. 2
0
    def events_timestamps(self, timestamp_begin, timestamp_end):
        """
        Generates the ordered :class:`Event` objects of all the opened
        traces contained in this trace collection from *timestamp_begin*
        to *timestamp_end*.

        *timestamp_begin* and *timestamp_end* are given in nanoseconds
        since Epoch.

        See :attr:`events` for notes and limitations.
        """

        begin_pos_ptr = nbt._bt_python_create_iter_pos()
        end_pos_ptr = nbt._bt_python_create_iter_pos()
        begin_pos_ptr.type = end_pos_ptr.type = nbt.SEEK_TIME
        begin_pos_ptr.u.seek_time = timestamp_begin
        end_pos_ptr.u.seek_time = timestamp_end

        for event in self._events(begin_pos_ptr, end_pos_ptr):
            yield event

        nbt._bt_iter_free_pos(begin_pos_ptr)
        nbt._bt_iter_free_pos(end_pos_ptr)
Esempio n. 3
0
    def events_timestamps(self, timestamp_begin, timestamp_end):
        """
        Generates the ordered :class:`Event` objects of all the opened
        traces contained in this trace collection from *timestamp_begin*
        to *timestamp_end*.

        *timestamp_begin* and *timestamp_end* are given in nanoseconds
        since Epoch.

        See :attr:`events` for notes and limitations.
        """

        begin_pos_ptr = nbt._bt_python_create_iter_pos()
        end_pos_ptr = nbt._bt_python_create_iter_pos()
        begin_pos_ptr.type = end_pos_ptr.type = nbt.SEEK_TIME
        begin_pos_ptr.u.seek_time = timestamp_begin
        end_pos_ptr.u.seek_time = timestamp_end

        for event in self._events(begin_pos_ptr, end_pos_ptr):
            yield event

        nbt._bt_iter_free_pos(begin_pos_ptr);
        nbt._bt_iter_free_pos(end_pos_ptr);
Esempio n. 4
0
    def events(self):
        """
        Generates the ordered :class:`Event` objects of all the opened
        traces contained in this trace collection.

        Due to limitations of the native Babeltrace API, only one event
        may be "alive" at a given time, i.e. a user **should never**
        store a copy of the events returned by this function for
        ulterior use. Users shall make sure to copy the information
        they need *from* an event before accessing the next one.
        """

        begin_pos_ptr = nbt._bt_python_create_iter_pos()
        end_pos_ptr = nbt._bt_python_create_iter_pos()

        if not self.intersect_mode:
            begin_pos_ptr.type = nbt.SEEK_BEGIN
            end_pos_ptr.type = nbt.SEEK_LAST

        for event in self._events(begin_pos_ptr, end_pos_ptr):
            yield event

        nbt._bt_iter_free_pos(begin_pos_ptr)
        nbt._bt_iter_free_pos(end_pos_ptr)