コード例 #1
0
ファイル: lttng_cli_control.py プロジェクト: eepp/lttngc
    def _channel_attributes_from_node(channel_node, bt):
        attr = model.ChannelAttributes()
        attr_node = channel_node.find('attributes')
        mode_node = attr_node.find('overwrite_mode')
        attr.mode = LttngCliControl._CHANNEL_MODE_NAME_TO_ENUM[mode_node.text]
        attr.subbuf_size = int(attr_node.find('subbuffer_size').text)
        attr.subbuf_count = int(attr_node.find('subbuffer_count').text)
        switch_timer_interval = attr_node.find('switch_timer_interval').text
        attr.switch_timer_interval = utils.usec_to_sec(switch_timer_interval)
        read_timer_interval = attr_node.find('read_timer_interval').text
        attr.read_timer_interval = utils.usec_to_sec(read_timer_interval)
        ot = attr_node.find('output_type').text
        output_type = LttngCliControl._CHANNEL_OUTPUT_TYPE_NAME_TO_ENUM[ot]
        attr.output_type = output_type
        attr.tracefile_size = int(attr_node.find('tracefile_size').text)
        attr.tracefile_count = int(attr_node.find('tracefile_count').text)
        buffer_scheme = LttngCliControl._CHANNEL_BUFFER_SCHEME_NAME_TO_ENUM[bt]
        attr.buffer_scheme = buffer_scheme

        return attr
コード例 #2
0
ファイル: lttng_cli_control.py プロジェクト: eepp/lttngc
    def _session_summary_from_node(session_node):
        name = session_node.find('name').text
        output_path = session_node.find('path').text
        enabled = session_node.find('enabled').text
        enabled = _bool_from_node_text(enabled)
        snapshot_mode = session_node.find('snapshot_mode').text
        is_snapshot_mode = _bool_from_node_text(snapshot_mode)
        live_timer_interval = session_node.find('live_timer_interval').text
        live_timer_interval = utils.usec_to_sec(live_timer_interval)
        summary = model.SessionSummary(name, output_path, enabled,
                                       is_snapshot_mode, live_timer_interval)

        return summary
コード例 #3
0
ファイル: add_channel_dialog.py プロジェクト: eepp/lttngc
    def channel_attributes(self):
        attr = model.ChannelAttributes()
        attr.mode = self.mode
        attr.subbuf_size = self._subbuf_size_edit.text()
        attr.subbuf_count = self._subbuf_count_spinbox.value()
        attr.output_type = self.output_type
        attr.buffer_scheme = self.buffer_scheme

        if self._tracefile_ucount_msize_radio.isChecked():
            attr.tracefile_size = self._tracefile_size_edit.text()
        elif self._tracefile_mcount_msize_radio.isChecked():
            attr.tracefile_count = self._tracefile_count_edit.value()
            attr.tracefile_size = self._tracefile_size_edit.text()

        if not self._read_timer_stopped_check.isChecked():
            sec = utils.usec_to_sec(int(self._read_timer_period_edit.text()))
            attr.read_timer_interval = sec

        if not self._switch_timer_stopped_check.isChecked():
            sec = utils.usec_to_sec(int(self._switch_timer_period_edit.text()))
            attr.switch_timer_interval = sec

        return attr
コード例 #4
0
ファイル: model.py プロジェクト: eepp/lttngc
    def create_default(cls, domain):
        attr = cls()
        attr.mode = ChannelMode.DISCARD
        attr.subbuf_count = 4

        if domain == Domain.KERNEL:
            attr.subbuf_size = 256 * 1024
            attr.read_timer_interval = utils.usec_to_sec(200000)
            attr.output_type = ChannelOutputType.SPLICE
            attr.buffer_scheme = ChannelBufferScheme.GLOBAL
        elif domain == Domain.USER:
            attr.subbuf_size = 128 * 1024
            attr.output_type = ChannelOutputType.MMAP
            attr.buffer_scheme = ChannelBufferScheme.PER_UID

        return attr