1#    Copyright 2015-2017 ARM Limited
2#
3# 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
16
17import warnings
18from trappy.bare_trace import BareTrace
19from trappy.compare_runs import summary_plots, compare_runs
20from trappy.ftrace import FTrace
21from trappy.systrace import SysTrace
22from trappy.version import __version__
23try:
24    from trappy.plotter.LinePlot import LinePlot
25except ImportError as exc:
26    class LinePlot(object):
27        def __init__(self, *args, **kwargs):
28            raise exc
29try:
30    from trappy.plotter.ILinePlot import ILinePlot
31    from trappy.plotter.EventPlot import EventPlot
32    from trappy.plotter.BarPlot import BarPlot
33except ImportError:
34    pass
35from trappy.dynamic import register_dynamic_ftrace, register_ftrace_parser, \
36    unregister_ftrace_parser
37import trappy.nbexport
38
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
45
46# Load all the modules to make sure all classes are registered with FTrace
47import os
48for fname in os.listdir(os.path.dirname(__file__)):
49    import_name, extension = os.path.splitext(fname)
50    if (extension == ".py") and (fname != "__init__.py") and \
51       (fname != "plot_utils.py"):
52        __import__("trappy.{}".format(import_name))
53
54del fname, import_name, extension
55