Fix lint errors in tracetools_analysis
This commit is contained in:
parent
c98d525d4b
commit
e5b8d1782f
7 changed files with 20 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
# Event handler
|
||||
|
||||
import sys
|
||||
|
||||
from . import lttng_models
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
# Model objects for LTTng traces/events
|
||||
|
||||
|
||||
def get_field(event, field_name, default=None):
|
||||
return event.get(field_name, default)
|
||||
|
||||
|
||||
def get_name(event):
|
||||
return get_field(event, '_name')
|
||||
|
||||
|
||||
class EventMetadata():
|
||||
"""Container for event metadata."""
|
||||
|
||||
def __init__(self, event_name, pid, tid, timestamp, procname):
|
||||
self._event_name = event_name
|
||||
self._pid = pid
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Process trace events and create ROS model
|
||||
|
||||
import sys
|
||||
from .lttng_models import get_field
|
||||
from .handler import EventHandler
|
||||
from .lttng_models import get_field
|
||||
|
||||
|
||||
def ros_process(events):
|
||||
"""
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Convert processor object to pandas dataframe
|
||||
|
||||
import pandas as pd
|
||||
from .ros_processor import RosProcessor
|
||||
|
||||
|
||||
def callback_durations_to_df(ros_processor):
|
||||
callback_addresses = []
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# CTF to pickle conversion
|
||||
|
||||
import babeltrace
|
||||
from pickle import Pickler
|
||||
import time
|
||||
|
||||
import babeltrace
|
||||
|
||||
# List of ignored CTF fields
|
||||
_IGNORED_FIELDS = [
|
||||
'content_size', 'cpu_id', 'events_discarded', 'id', 'packet_size', 'packet_seq_num',
|
||||
|
@ -11,6 +11,7 @@ _IGNORED_FIELDS = [
|
|||
]
|
||||
_DISCARD = 'events_discarded'
|
||||
|
||||
|
||||
def ctf_to_pickle(trace_directory, target):
|
||||
"""
|
||||
Load CTF trace and convert to a pickle file.
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
# Entrypoint/script to convert CTF trace data to a pickle file
|
||||
# TODO
|
||||
|
||||
import sys
|
||||
from pickle import Pickler
|
||||
import sys
|
||||
|
||||
from tracetools_analysis.conversion import ctf
|
||||
|
||||
|
||||
def main(argv=sys.argv):
|
||||
if len(argv) != 3:
|
||||
print("usage: /trace/directory pickle_target_file")
|
||||
print('usage: /trace/directory pickle_target_file')
|
||||
exit(1)
|
||||
|
||||
trace_directory = sys.argv[1]
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
# Entrypoint/script to process events from a pickle file to build a ROS model
|
||||
|
||||
import sys
|
||||
import pickle
|
||||
import pandas as pd
|
||||
import sys
|
||||
|
||||
from tracetools_analysis.analysis import ros_processor, to_pandas
|
||||
|
||||
|
||||
def main(argv=sys.argv):
|
||||
if len(argv) != 2:
|
||||
print('usage: pickle_file')
|
||||
|
@ -27,6 +28,6 @@ def _get_events_from_pickled_file(file):
|
|||
while True:
|
||||
try:
|
||||
events.append(p.load())
|
||||
except EOFError as _:
|
||||
except EOFError:
|
||||
break # we're done
|
||||
return events
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue