blob: 3b3c41931624647e48b2cbf6651a65009cf56ae5 [file] [log] [blame]
Brendan Jackmane81fdcb2017-01-04 17:10:29 +00001# Copyright 2015-2017 ARM Limited
Javi Merinoc47d2df2015-02-06 16:04:03 +00002#
Javi Merinoaace7c02015-08-10 14:10:47 +01003# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
Javi Merino67958b12014-04-10 16:22:13 +010016
Javi Merinofecb2672015-12-21 18:34:57 +000017import warnings
Javi Merino08f3c342015-12-21 17:20:12 +000018from trappy.bare_trace import BareTrace
Javi Merino435457c2015-08-10 15:59:10 +010019from trappy.compare_runs import summary_plots, compare_runs
Javi Merinoc26a3232015-12-11 18:00:30 +000020from trappy.ftrace import FTrace
Javi Merino46458d62016-03-22 11:34:30 +000021from trappy.systrace import SysTrace
Javi Merino712e6f92016-06-16 15:29:02 +010022from trappy.version import __version__
Javi Merinoec2ffe02015-12-07 15:05:13 +000023try:
24 from trappy.plotter.LinePlot import LinePlot
25except ImportError as exc:
26 class LinePlot(object):
27 def __init__(self, *args, **kwargs):
28 raise exc
Kapileshwar Singh8741ef12015-04-28 15:35:26 +010029try:
Javi Merino435457c2015-08-10 15:59:10 +010030 from trappy.plotter.ILinePlot import ILinePlot
31 from trappy.plotter.EventPlot import EventPlot
John Pococke7068842016-01-13 16:18:34 +000032 from trappy.plotter.BarPlot import BarPlot
Kapileshwar Singh8741ef12015-04-28 15:35:26 +010033except ImportError:
34 pass
Javi Merinob280b4f2015-12-22 14:53:24 +000035from trappy.dynamic import register_dynamic_ftrace, register_ftrace_parser, \
36 unregister_ftrace_parser
Kapileshwar Singh7712c8f2016-04-26 01:04:00 +020037import trappy.nbexport
Javi Merinob280b4f2015-12-22 14:53:24 +000038
39# We define unregister_dynamic_ftrace() because it undoes what
40# register_dynamic_ftrace(). Internally it does exactly the same as
41# unregister_ftrace_parser() though but with these two names the API
42# makes more sense: register with register_dynamic_ftrace(),
43# unregister with unregister_dynamic_ftrace()
44unregister_dynamic_ftrace = unregister_ftrace_parser
Javi Merino338a3ab2014-06-13 10:54:26 +010045
Javi Merinoc26a3232015-12-11 18:00:30 +000046# Load all the modules to make sure all classes are registered with FTrace
Javi Merino323bb8d2015-04-20 17:09:15 +010047import os
48for fname in os.listdir(os.path.dirname(__file__)):
49 import_name, extension = os.path.splitext(fname)
Javi Merinoec2ffe02015-12-07 15:05:13 +000050 if (extension == ".py") and (fname != "__init__.py") and \
51 (fname != "plot_utils.py"):
Javi Merino435457c2015-08-10 15:59:10 +010052 __import__("trappy.{}".format(import_name))
Javi Merino323bb8d2015-04-20 17:09:15 +010053
54del fname, import_name, extension