Re-structure directories and modules
This commit is contained in:
parent
4ccdbb688d
commit
2e37db5a79
10 changed files with 42 additions and 59 deletions
|
@ -1,51 +0,0 @@
|
||||||
# Copyright 2019 Robert Bosch GmbH
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
"""Module LTTng traces/events models."""
|
|
||||||
|
|
||||||
|
|
||||||
class EventMetadata():
|
|
||||||
"""Container for event metadata."""
|
|
||||||
|
|
||||||
def __init__(self, event_name, pid, tid, timestamp, procname, cpu_id) -> None:
|
|
||||||
self._event_name = event_name
|
|
||||||
self._pid = pid
|
|
||||||
self._tid = tid
|
|
||||||
self._timestamp = timestamp
|
|
||||||
self._procname = procname
|
|
||||||
self._cpu_id = cpu_id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def event_name(self):
|
|
||||||
return self._event_name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def pid(self):
|
|
||||||
return self._pid
|
|
||||||
|
|
||||||
@property
|
|
||||||
def tid(self):
|
|
||||||
return self._tid
|
|
||||||
|
|
||||||
@property
|
|
||||||
def timestamp(self):
|
|
||||||
return self._timestamp
|
|
||||||
|
|
||||||
@property
|
|
||||||
def procname(self):
|
|
||||||
return self._procname
|
|
||||||
|
|
||||||
@property
|
|
||||||
def cpu_id(self):
|
|
||||||
return self._cpu_id
|
|
|
@ -19,8 +19,8 @@ import argparse
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from tracetools_analysis.loading import load_pickle
|
from tracetools_analysis.loading import load_pickle
|
||||||
from tracetools_analysis.analysis.cpu_time_processor import CpuTimeProcessor
|
from tracetools_analysis.processor.cpu_time import CpuTimeProcessor
|
||||||
from tracetools_analysis.analysis.ros2_processor import Ros2Processor
|
from tracetools_analysis.processor.ros2 import Ros2Processor
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
|
|
|
@ -18,9 +18,9 @@ from typing import Dict
|
||||||
|
|
||||||
from tracetools_read.utils import get_field
|
from tracetools_read.utils import get_field
|
||||||
|
|
||||||
from .data_model.cpu_time import CpuTimeDataModel
|
from ..data_model.cpu_time import CpuTimeDataModel
|
||||||
from .handler import EventHandler
|
from .handler import EventHandler
|
||||||
from .lttng_models import EventMetadata
|
from .handler import EventMetadata
|
||||||
|
|
||||||
|
|
||||||
class CpuTimeProcessor(EventHandler):
|
class CpuTimeProcessor(EventHandler):
|
|
@ -12,7 +12,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""Module for event handler."""
|
"""Module for event handling."""
|
||||||
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
@ -21,7 +21,41 @@ from typing import List
|
||||||
from tracetools_read.utils import get_event_name
|
from tracetools_read.utils import get_event_name
|
||||||
from tracetools_read.utils import get_field
|
from tracetools_read.utils import get_field
|
||||||
|
|
||||||
from .lttng_models import EventMetadata
|
|
||||||
|
class EventMetadata():
|
||||||
|
"""Container for event metadata."""
|
||||||
|
|
||||||
|
def __init__(self, event_name, pid, tid, timestamp, procname, cpu_id) -> None:
|
||||||
|
self._event_name = event_name
|
||||||
|
self._pid = pid
|
||||||
|
self._tid = tid
|
||||||
|
self._timestamp = timestamp
|
||||||
|
self._procname = procname
|
||||||
|
self._cpu_id = cpu_id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def event_name(self):
|
||||||
|
return self._event_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def pid(self):
|
||||||
|
return self._pid
|
||||||
|
|
||||||
|
@property
|
||||||
|
def tid(self):
|
||||||
|
return self._tid
|
||||||
|
|
||||||
|
@property
|
||||||
|
def timestamp(self):
|
||||||
|
return self._timestamp
|
||||||
|
|
||||||
|
@property
|
||||||
|
def procname(self):
|
||||||
|
return self._procname
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cpu_id(self):
|
||||||
|
return self._cpu_id
|
||||||
|
|
||||||
|
|
||||||
class EventHandler():
|
class EventHandler():
|
|
@ -18,9 +18,9 @@ from typing import Dict
|
||||||
|
|
||||||
from tracetools_read.utils import get_field
|
from tracetools_read.utils import get_field
|
||||||
|
|
||||||
from .data_model.ros import RosDataModel
|
from ..data_model.ros import RosDataModel
|
||||||
from .handler import EventHandler
|
from .handler import EventHandler
|
||||||
from .lttng_models import EventMetadata
|
from .handler import EventMetadata
|
||||||
|
|
||||||
|
|
||||||
class Ros2Processor(EventHandler):
|
class Ros2Processor(EventHandler):
|
Loading…
Add table
Add a link
Reference in a new issue