Brendan Jackman | e81fdcb | 2017-01-04 17:10:29 +0000 | [diff] [blame] | 1 | # Copyright 2015-2017 ARM Limited |
Javi Merino | c47d2df | 2015-02-06 16:04:03 +0000 | [diff] [blame] | 2 | # |
Javi Merino | aace7c0 | 2015-08-10 14:10:47 +0100 | [diff] [blame] | 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 | |
Javi Merino | 67958b1 | 2014-04-10 16:22:13 +0100 | [diff] [blame] | 16 | |
Javi Merino | fecb267 | 2015-12-21 18:34:57 +0000 | [diff] [blame] | 17 | import warnings |
Javi Merino | 08f3c34 | 2015-12-21 17:20:12 +0000 | [diff] [blame] | 18 | from trappy.bare_trace import BareTrace |
Javi Merino | 435457c | 2015-08-10 15:59:10 +0100 | [diff] [blame] | 19 | from trappy.compare_runs import summary_plots, compare_runs |
Javi Merino | c26a323 | 2015-12-11 18:00:30 +0000 | [diff] [blame] | 20 | from trappy.ftrace import FTrace |
Javi Merino | 46458d6 | 2016-03-22 11:34:30 +0000 | [diff] [blame] | 21 | from trappy.systrace import SysTrace |
Javi Merino | 712e6f9 | 2016-06-16 15:29:02 +0100 | [diff] [blame] | 22 | from trappy.version import __version__ |
Javi Merino | ec2ffe0 | 2015-12-07 15:05:13 +0000 | [diff] [blame] | 23 | try: |
| 24 | from trappy.plotter.LinePlot import LinePlot |
| 25 | except ImportError as exc: |
| 26 | class LinePlot(object): |
| 27 | def __init__(self, *args, **kwargs): |
| 28 | raise exc |
Kapileshwar Singh | 8741ef1 | 2015-04-28 15:35:26 +0100 | [diff] [blame] | 29 | try: |
Javi Merino | 435457c | 2015-08-10 15:59:10 +0100 | [diff] [blame] | 30 | from trappy.plotter.ILinePlot import ILinePlot |
| 31 | from trappy.plotter.EventPlot import EventPlot |
John Pocock | e706884 | 2016-01-13 16:18:34 +0000 | [diff] [blame] | 32 | from trappy.plotter.BarPlot import BarPlot |
Kapileshwar Singh | 8741ef1 | 2015-04-28 15:35:26 +0100 | [diff] [blame] | 33 | except ImportError: |
| 34 | pass |
Javi Merino | b280b4f | 2015-12-22 14:53:24 +0000 | [diff] [blame] | 35 | from trappy.dynamic import register_dynamic_ftrace, register_ftrace_parser, \ |
| 36 | unregister_ftrace_parser |
Kapileshwar Singh | 7712c8f | 2016-04-26 01:04:00 +0200 | [diff] [blame] | 37 | import trappy.nbexport |
Javi Merino | b280b4f | 2015-12-22 14:53:24 +0000 | [diff] [blame] | 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() |
| 44 | unregister_dynamic_ftrace = unregister_ftrace_parser |
Javi Merino | 338a3ab | 2014-06-13 10:54:26 +0100 | [diff] [blame] | 45 | |
Javi Merino | c26a323 | 2015-12-11 18:00:30 +0000 | [diff] [blame] | 46 | # Load all the modules to make sure all classes are registered with FTrace |
Javi Merino | 323bb8d | 2015-04-20 17:09:15 +0100 | [diff] [blame] | 47 | import os |
| 48 | for fname in os.listdir(os.path.dirname(__file__)): |
| 49 | import_name, extension = os.path.splitext(fname) |
Javi Merino | ec2ffe0 | 2015-12-07 15:05:13 +0000 | [diff] [blame] | 50 | if (extension == ".py") and (fname != "__init__.py") and \ |
| 51 | (fname != "plot_utils.py"): |
Javi Merino | 435457c | 2015-08-10 15:59:10 +0100 | [diff] [blame] | 52 | __import__("trappy.{}".format(import_name)) |
Javi Merino | 323bb8d | 2015-04-20 17:09:15 +0100 | [diff] [blame] | 53 | |
| 54 | del fname, import_name, extension |