Merge branch 'small-fixes' into 'master'
Fix lint and formatting errors See merge request micro-ROS/ros2_tracing!21
This commit is contained in:
commit
70b9c780cb
7 changed files with 32 additions and 17 deletions
|
@ -16,8 +16,8 @@
|
|||
|
||||
from ros2cli.command import CommandExtension
|
||||
from ros2trace.api import add_trace_arguments
|
||||
from ros2trace.api import init
|
||||
from ros2trace.api import fini
|
||||
from ros2trace.api import init
|
||||
|
||||
|
||||
class TraceCommand(CommandExtension):
|
||||
|
|
|
@ -7,8 +7,14 @@ setup(
|
|||
packages=find_packages(exclude=['test']),
|
||||
install_requires=['ros2cli'],
|
||||
zip_safe=True,
|
||||
maintainer='Christophe Bedard, Ingo Lütkebohle',
|
||||
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com',
|
||||
maintainer=(
|
||||
'Christophe Bedard, '
|
||||
'Ingo Lütkebohle'
|
||||
),
|
||||
maintainer_email=(
|
||||
'fixed-term.christophe.bourquebedard@de.bosch.com, '
|
||||
'ingo.luetkebohle@de.bosch.com'
|
||||
),
|
||||
author='Christophe Bedard',
|
||||
author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
|
||||
# url=',
|
||||
|
|
|
@ -14,8 +14,14 @@ setup(
|
|||
('share/' + package_name + '/launch', glob.glob('launch/*.launch.py')),
|
||||
],
|
||||
install_requires=['setuptools'],
|
||||
maintainer='Christophe Bedard, Ingo Lütkebohle',
|
||||
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com',
|
||||
maintainer=(
|
||||
'Christophe Bedard, '
|
||||
'Ingo Lütkebohle'
|
||||
),
|
||||
maintainer_email=(
|
||||
'fixed-term.christophe.bourquebedard@de.bosch.com, '
|
||||
'ingo.luetkebohle@de.bosch.com'
|
||||
),
|
||||
author='Christophe Bedard',
|
||||
author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
|
||||
# url='',
|
||||
|
|
|
@ -11,8 +11,14 @@ setup(
|
|||
('share/' + package_name, ['package.xml']),
|
||||
],
|
||||
install_requires=['setuptools'],
|
||||
maintainer='Christophe Bedard, Ingo Lütkebohle',
|
||||
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com',
|
||||
maintainer=(
|
||||
'Christophe Bedard, '
|
||||
'Ingo Lütkebohle'
|
||||
),
|
||||
maintainer_email=(
|
||||
'fixed-term.christophe.bourquebedard@de.bosch.com, '
|
||||
'ingo.luetkebohle@de.bosch.com'
|
||||
),
|
||||
author='Christophe Bedard',
|
||||
author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
|
||||
# url='',
|
||||
|
|
|
@ -32,9 +32,7 @@ class DefaultArgValueCompleter:
|
|||
|
||||
|
||||
def parse_args():
|
||||
"""
|
||||
Parse args for tracing.
|
||||
"""
|
||||
"""Parse args for tracing."""
|
||||
parser = argparse.ArgumentParser(description='Setup and launch an LTTng tracing session.')
|
||||
add_arguments(parser)
|
||||
return parser.parse_args()
|
||||
|
@ -52,15 +50,15 @@ def add_arguments(parser):
|
|||
arg = parser.add_argument(
|
||||
'--ust', '-u', nargs='*', dest='events_ust', default=names.DEFAULT_EVENTS_ROS,
|
||||
help='the ROS UST events to enable (default: all events) '
|
||||
'[to disable all UST events, '
|
||||
'provide this flag without any event name]')
|
||||
'[to disable all UST events, '
|
||||
'provide this flag without any event name]')
|
||||
arg.completer = DefaultArgValueCompleter(arg)
|
||||
arg = parser.add_argument(
|
||||
'--kernel', '-k', nargs='*', dest='events_kernel',
|
||||
default=names.DEFAULT_EVENTS_KERNEL,
|
||||
help='the kernel events to enable (default: all events) '
|
||||
'[to disable all UST events, '
|
||||
'provide this flag without any event name]')
|
||||
'[to disable all UST events, '
|
||||
'provide this flag without any event name]')
|
||||
arg.completer = DefaultArgValueCompleter(arg)
|
||||
parser.add_argument(
|
||||
'--list', '-l', dest='list', action='store_true',
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
"""Interface for tracing with LTTng."""
|
||||
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
# Temporary workaround
|
||||
sys.path = ['/usr/local/lib/python3.6/site-packages'] + sys.path
|
||||
from typing import List
|
||||
|
||||
import lttng # noqa: E402
|
||||
|
||||
|
@ -206,7 +206,7 @@ def _create_session(session_name: str, full_path: str) -> None:
|
|||
if result == -LTTNG_ERR_EXIST_SESS:
|
||||
# Sessions seem to persist, so if it already exists,
|
||||
# just destroy it and try again
|
||||
lttng_destroy(session_name)
|
||||
_lttng_destroy(session_name)
|
||||
result = lttng.create(session_name, full_path)
|
||||
if result < 0:
|
||||
raise RuntimeError(f'session creation failed: {lttng.strerror(result)}')
|
||||
|
|
|
@ -19,7 +19,6 @@ import os
|
|||
|
||||
from tracetools_trace.tools import args
|
||||
from tracetools_trace.tools import lttng
|
||||
from tracetools_trace.tools import names
|
||||
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue