aboutsummaryrefslogtreecommitdiff
path: root/trappy/bare_trace.py
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-04-23 03:52:01 -0700
committerJoel Fernandes <joelaf@google.com>2017-06-02 12:49:36 -0700
commit45e01409cece3a944aee60f8dc13023a393fede6 (patch)
treea6b112d85472f680077c960436a852ba3ef5071f /trappy/bare_trace.py
parentac25b4e59ed854c8ef7139083f5327850ce46973 (diff)
downloadtrappy-45e01409cece3a944aee60f8dc13023a393fede6.tar.gz
trace: Add support for skipping build of dataframes
For event callback driven scripts, its useful to save time to not build data frames that aren't going to be used anyway, add a parameter to skip building of data frames. This saves ~30% of the time an event callback based script takes. Signed-off-by: Joel Fernandes <joelaf@google.com>
Diffstat (limited to 'trappy/bare_trace.py')
-rw-r--r--trappy/bare_trace.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/trappy/bare_trace.py b/trappy/bare_trace.py
index f3fbd58..9787f04 100644
--- a/trappy/bare_trace.py
+++ b/trappy/bare_trace.py
@@ -27,12 +27,13 @@ class BareTrace(object):
"""
- def __init__(self, name=""):
+ def __init__(self, name="", build_df=True):
self.name = name
self.normalized_time = False
self.class_definitions = {}
self.trace_classes = []
self.basetime = 0
+ self.build_df = build_df
def get_duration(self):
"""Returns the largest time value of all classes,
@@ -133,6 +134,8 @@ class BareTrace(object):
setattr(self, name, event)
def finalize_objects(self):
+ if not self.build_df:
+ return
for trace_class in self.trace_classes:
trace_class.create_dataframe()
trace_class.finalize_object()