diff --git a/.travis.yml b/.travis.yml index e771c37a12a11c304b414b39d7a5246ab69fcbad..ecc70adc7375508759f965a8d7606d0ae3d2908b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,12 @@ sudo: required language: python install: # Use IPython 5.x because 6.0+ only supports Python 3.3 - - pip install --upgrade "ipython<6.0.0" Cython trappy bart-py devlib psutil wrapt jupyter matplotlib + - pip install --upgrade "ipython<6.0.0" Cython trappy bart-py devlib psutil + wrapt jupyter matplotlib sphinx script: - cd $TRAVIS_BUILD_DIR - - source init_env && lisa-test tests/lisa/ + - source init_env + - lisa-test tests/lisa/ + # -W is like -Werror. + # Ideally we should use -n too, which is like -Wall, but we have too many errors for that. + - cd doc/ && sphinx-build -W -b html . _build/html diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..88f9974bd731af1d8130ca70ed32cc8d77aa9fb6 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +_build/* diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7ab1b0ff73b76e31bf180bec3d0db06a347daeb7 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/LISA.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/LISA.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/LISA" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/LISA" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..a5a97ed2fbaf2f23dab7d7d2d0b80551483c158b --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +# +# LISA documentation build configuration file, created by +# sphinx-quickstart on Tue Dec 13 14:20:00 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import logging +import os +import re +import subprocess +import sys + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) +lisa_home = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') +sys.path.insert(0, lisa_home) +for lib in ['utils', 'wlgen', 'trappy', 'bart', 'devlib']: + sys.path.insert(0, os.path.join(lisa_home, 'libs', lib)) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.imgmath', + 'sphinx.ext.viewcode', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'LISA' +copyright = u'2017, ARM-Software' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# + +try: + git_description = subprocess.check_output( + ['git', 'describe', '--tags', '--match=v??.??']) + version = re.match('v([0-9][0-9]\.[0-9][0-9]).*', git_description).group(1) + release = version +except Exception as e: + logging.error("Couldn't set project version from git: {}".format(e)) + version = release = 'UNKNOWN_VERSION' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'LISAdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'LISA.tex', u'LISA Documentation', + u'ARM-Software', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'lisa', u'LISA Documentation', + [u'ARM-Software'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'LISA', u'LISA Documentation', + u'ARM-Software', 'LISA', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'http://docs.python.org/': None} + +# +# Fix autodoc +# + +# Include __init__ docstrings (obviously) +autoclass_content = 'both' + +autodoc_default_flags = [ + 'show-inheritance', # Show parent class + 'undoc-members', # Show members even if they don't have docstrings +] diff --git a/doc/getting_started.rst b/doc/getting_started.rst new file mode 100644 index 0000000000000000000000000000000000000000..681e0f69ddcdd620ed172874fc88b3255d5de5dc --- /dev/null +++ b/doc/getting_started.rst @@ -0,0 +1,77 @@ +.. _getting-started: + +Getting Started with LISA +==================================== + +Once you’ve installed LISA, source init\_env to initialize the LISA Shell, +which provides a convenient set of shell commands for easy access to +many LISA related functions. + +.. code:: shell + + $ source init_env + +**Run ``lisa-help``** to see an overview of the provided LISA commands. + +Starting the IPython server to use LISA notebooks +------------------------------------------------- + +To start the IPython Notebook Server required to use this Notebook, on a +LISAShell run: + +.. code:: shell + + [LISAShell lisa] \> lisa-ipython start + + Starting IPython Notebooks... + Starting IPython Notebook server... + IP Address : http://127.0.0.1:8888/ + Folder : /home/derkling/Code/lisa/ipynb + Logfile : /home/derkling/Code/lisa/ipynb/server.log + PYTHONPATH : + /home/derkling/Code/lisa/libs/bart + /home/derkling/Code/lisa/libs/trappy + /home/derkling/Code/lisa/libs/devlib + /home/derkling/Code/lisa/libs/wlgen + /home/derkling/Code/lisa/libs/utils + + + Notebook server task: [1] 24745 + +The main folder served by the server is: http://127.0.0.1:8888/ + +Once the server is started you can have a look at the provided **tutorial +notebooks** are accessible by following (in your browser) this link: + +http://127.0.0.1:8888/notebooks/tutorial/00\_LisaInANutshell.ipynb + +This intial tutorial can be seen (but not executed) also on GitHub: + +https://github.com/ARM-software/lisa/blob/master/ipynb/tutorial/00\_LisaInANutshell.ipynb + +.. _running-tests: + +Running automated tests +----------------------- + +To run automated tests, you’ll first need to configure the test +framework to access your target. Edit ``target.config`` with these +details - this file contains comments describing the information you’ll +need to add. For example: + +- For an SSH (Linux) target you’ll usually need to edit: + - The “platform” field to “linux” + - The “board” field to the name of your device (leave blank if it isn’t + listed as an option) + - The “host” field to provide the IP address + - The “username” and “password” fields, or the “keyfile” field to + provide login credentials. +- For an ADB (Android) target, you’ll usually need to edit: + - The “platform” to “android” + - The “board” field to the name of your device (leave blank if it isn’t + listed as an option) + - The “device” field to provide the Android device ID. + +Once your target is set up, you can run automated tests via the +``lisa-test`` command in the LISA shell. Run ``lisa-test help`` to see +the format of this command. diff --git a/doc/images/overall_design_view.png b/doc/images/overall_design_view.png new file mode 100644 index 0000000000000000000000000000000000000000..cc74301230a2751ee9d55a27fe94b4fb58d73e19 Binary files /dev/null and b/doc/images/overall_design_view.png differ diff --git a/doc/images/vbox_add_usb_filter.png b/doc/images/vbox_add_usb_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..696dc19b92c4052e77e70b0c3db21de42597f365 Binary files /dev/null and b/doc/images/vbox_add_usb_filter.png differ diff --git a/doc/images/vbox_enable_usb.png b/doc/images/vbox_enable_usb.png new file mode 100644 index 0000000000000000000000000000000000000000..69b073f79a81e4d4c80587d5f4a3fe37b56aa333 Binary files /dev/null and b/doc/images/vbox_enable_usb.png differ diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..2f18c3cac68cd3fe23bd7aac5f3a226dbd076c70 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,102 @@ +.. LISA documentation master file, created by + sphinx-quickstart on Tue Dec 13 14:20:00 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +LISA Documentation +============================================== + +LISA - "Linux Integrated System Analysis" is a toolkit for interactive analysis +and automated regression testing of Linux kernel behaviour. + +See :ref:`install` for info on setup and usage. See :ref:`getting-started` to +get up and running using LISA. + +Lisa is hosted on Github at https://github.com/ARM-software/lisa. + +This site contains documentation for LISA's APIs. For some parts of LISA, API +documentation is a work-in-progress. Where the API documentation is lacking, see +the example/tutorial notebooks provided with LISA, or just dive in and read the +code. Contributions to LISA and its documentation are very welcome, and handled +via Github pull requests. + +What is LISA? +================= + +LISA helps Linux kernel developers to measure the impact of modifications in +core parts of the kernel. The focus is on the scheduler, power management and +thermal frameworks. Nevertheless, LISA is generic and can be used for other +purposes too. + +.. TODO link to APIs mentioned + +LISA provides an API for modelling use-cases of interest and developing +regression tests for use-cases. A ready made set of test-cases to support +regression testing of core kernel features is provided. In addition, LISA uses +the excellent IPython Notebook framework and a set of example notebooks for live +experiments on a target platform. + +Goals & Motivation +========================= +The main goals of LISA are: + +- Support study of existing behaviours (i.e. *“how does PELT work?”*) +- Support analysis of new code being developed (i.e. *“what is the + impact on existing code?”*) +- Get insights on what’s not working and possibly chase down why +- Share reproducible experiments by means of a **common language** + that: + + - is **flexible enough** to reproduce the same experiment on + different targets + - **simplifies** generation and execution of well defined workloads + - **defines** a set of metrics to evaluate kernel behaviours + - **enables** kernel developers to easily post process data to + produce statistics and plots + +Overall Design View +~~~~~~~~~~~~~~~~~~~~~ + +.. TODO move this to its own page going over the design & implementation + +.. figure:: images/overall_design_view.png + :alt: LISA Overall View + +External Links +~~~~~~~~~~~~~~ + +- Linux Integrated System Analysis (LISA) & Friends `Slides`_ and + `Video`_ + +.. _Slides: http://events.linuxfoundation.org/sites/events/files/slides/ELC16_LISA_20160326.pdf +.. _Video: https://www.youtube.com/watch?v=yXZzzUEngiU + + +.. _Readme: + +Documentatoin Contents: +================================= + +.. TODO: due to our slightly weird package structure the index here is wildly + nested where it needn't be. + +.. toctree:: + + install + getting_started + modules + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + + +Building this documentation +============================== +- Install ``sphinx-doc`` +- From the root of the LISA source tree: ``source init_env && make -C doc/ html`` +- Find the HTML in ``doc/_build/html`` diff --git a/doc/install.rst b/doc/install.rst new file mode 100644 index 0000000000000000000000000000000000000000..ac80bca6596ede0bf03ea6ef5336ce53516e3c72 --- /dev/null +++ b/doc/install.rst @@ -0,0 +1,213 @@ +.. _install: + +Installing LISA +=============== +This assumes installation from scratch on a freshly installed Ubuntu 16.04 +system. If you have a different system (e.g. OSX or an older version of Ubuntu) +you can refer to the `Virtual Machine based installation`_. + +Contents +-------- +There are two ways to install LISA. + +1. `Standard Installation`_ + + Install directly to a Linux machine. These directions assume you are using + Ubuntu 16.04; it may be possible to run LISA on another Linux system but it + will not have been tested. + +2. `Virtual Machine based installation`_ + + If standard installation is not possible, a configuration is provided for + automatically creating a virtual machine with LISA installed. Some features, + such as device access via USB, will need additional configuration or be + unavailable. + +Standard Installation +--------------------- + +Required dependencies +~~~~~~~~~~~~~~~~~~~~~ + +:: + + # Install common build related tools + $ sudo apt-get install build-essential autoconf automake libtool pkg-config + + # Install additional tools required for some notebooks and tests + $ sudo apt-get install trace-cmd sshpass kernelshark + + # Install optional tools required for some notebooks and tests + $ sudo apt-get install nmap net-tools tree + + # Install required python packages + $ sudo apt-get install python-matplotlib python-numpy libfreetype6-dev libpng12-dev python-nose + + # Install the Python package manager + $ sudo apt-get install python-pip python-dev + + # Install (upgrade) required Python libraries + $ sudo pip install --upgrade Cython trappy bart-py devlib psutil wrapt + +*NOTE:* TRAPpy and BART depend on ``ipython`` and ``jupyter``. Some +IPython Notebooks examples are written using the notebooks JSON nbformat +version 4, which might not be supported by the IPython version installed +by ``apt-get``. It is suggested to remove apt-get installed IPython and +install it using ``pip``, which will provides the most updated version: + +:: + + # Remove (eventually) already installed versions + $ sudo apt-get remove ipython ipython-notebook + # Install most update version of the notebook + $ sudo pip install ipython jupyter + +Installing Jupyter NBextensions (optional) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Jupyter notebook server installed in the previous step is just a basic +version. Although it’s just enough to open and use all the notebooks provided by +LISA, if you want to take maximum advantage of the Notebooks a standard set of +extensions are provided as a dependency repository. + +To install the extensions you should follow the instructions on this official +websiste: + +[[https://github.com/ipython-contrib/jupyter\_contrib\_nbextensions]] + +The requires steps should be: + +:: + + $ pip install jupyter_contrib_nbextensions + $ jupyter contrib nbextension install --user + +Clone the LISA repository +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The code of the LISA toolkit with all the supported tests and Notebooks can be +cloned from the official GitHub repository with this command: + +:: + + $ git clone https://github.com/ARM-software/lisa.git + +Clone the submodules +~~~~~~~~~~~~~~~~~~~~~~~ + +LISA depends on ``bart``, ``devlib`` and ``TRAPpy``. + +:: + + $ source init_env + $ lisa-update submodules + +Virtual Machine based installation +---------------------------------- +LISA provides a Vagrant recipe which allows to automate the generation +of a VirtualBox based virtual machine pre-configured to run LISA. To +generate and use such a virtual machine you need: + +- VirtualBox intalled in your machine, you can download the VM + installer for your specific system from this page: + https://www.virtualbox.org/wiki/Downloads + +- Vagrant installed in your machine, you can download the installer for + your specific system from this page: + https://www.vagrantup.com/downloads.html + + .. code:: bash + + $ wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.deb + $ sudo dpkg -i ./vagrant_1.8.1_x86_64.deb + + Once these two components are available in your machine, to install + LISA you need to: + +- clone the LISA repository in a local folder + + .. code:: bash + + # Clone the master LISA repository + $ git clone https://github.com/ARM-software/lisa.git + +- create and start a Vagrant/VirtualBox VM + + .. code:: bash + + # Enter the LISA source tree + $ cd lisa + # Install LISA and its dependencies within the virtual machine + $ vagrant up + + This last command builds and executes the VM according to the + description provided by the Vagrant file available in the root folder + of the LISA source tree. The first time you run this command it will + take some time to download the base Ubuntu image and to install the + required LISA dependencies. The actual time depends on the speed of + your internet connection. + +Enable USB Controller +~~~~~~~~~~~~~~~~~~~~~ + +To be able to access devices connected through the USB, it is necessary +to enable the USB controller for the VM in ``VirtualBox``. The following +steps explain how to do it: + +- Halt the vagrant VM by running + +.. code:: bash + + vagrant halt + +- Open the ``VirtualBox`` VM Manager + +- Select the ``lisa_default_*`` virtual machine and click **Settings** + +- Select the **USB** tab and enable the USB controller as shown in the + screen-shot + +.. image:: images/vbox_enable_usb.png + +- Add a **USB filter** for each of the devices that should be available + in the VM as shown in the screen-shot below + +.. image:: images/vbox_add_usb_filter.png + +- Finally click **OK** to save the settings + +It is now possible to start the VM by running: + +.. code:: bash + + vagrant up + +Run LISA in vagrant +~~~~~~~~~~~~~~~~~~~ + +When the installation complete you will get a prompt from the LISA shell +which is running within the VM you just built. This VM shell can be +accessed from another terminal using this command + +.. code:: bash + + # from within the LISA root folder... + $ vagrant ssh + +Once you exit all the LISA shell the VM is automatically stopped by +vagrant. The next time you run the “up” command the VM will be started +again and you will get a LISA shell. + +From within the LISA shell you can start the IPython Notebooks server by +following the instructions `here`_. + +.. _here: TODO + + +- Overview of LISA usage model + - You Will Need +- How to install +- How to learn + +Example use cases. Overview of how to write tests. + diff --git a/doc/libs.rst b/doc/libs.rst new file mode 100644 index 0000000000000000000000000000000000000000..1af3a1992fedf0c35317a7226f9f5a0e9e2f7322 --- /dev/null +++ b/doc/libs.rst @@ -0,0 +1,17 @@ +libs package +============ + +Subpackages +----------- + +.. toctree:: + + libs.utils + +Module contents +--------------- + +.. automodule:: libs + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/libs.utils.android.rst b/doc/libs.utils.android.rst new file mode 100644 index 0000000000000000000000000000000000000000..d49a1a747d9ecc5325e06a1199c6afb538b6a87d --- /dev/null +++ b/doc/libs.utils.android.rst @@ -0,0 +1,38 @@ +libs.utils.android package +========================== + +Submodules +---------- + +libs.utils.android.screen module +-------------------------------- + +.. automodule:: libs.utils.android.screen + :members: + :undoc-members: + :show-inheritance: + +libs.utils.android.system module +-------------------------------- + +.. automodule:: libs.utils.android.system + :members: + :undoc-members: + :show-inheritance: + +libs.utils.android.workload module +---------------------------------- + +.. automodule:: libs.utils.android.workload + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: libs.utils.android + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/libs.utils.rst b/doc/libs.utils.rst new file mode 100644 index 0000000000000000000000000000000000000000..23da13c19f2cf8f8c09b0b46bef75f3e7b0f9ede --- /dev/null +++ b/doc/libs.utils.rst @@ -0,0 +1,117 @@ +libs.utils package +================== + +Subpackages +----------- + +.. toctree:: + + libs.utils.android + +Submodules +---------- + +libs.utils.analysis_module module +--------------------------------- + +.. automodule:: libs.utils.analysis_module + :members: + :undoc-members: + :show-inheritance: + +libs.utils.analysis_register module +----------------------------------- + +.. automodule:: libs.utils.analysis_register + :members: + :undoc-members: + :show-inheritance: + +libs.utils.colors module +------------------------ + +.. automodule:: libs.utils.colors + :members: + :undoc-members: + :show-inheritance: + +libs.utils.conf module +---------------------- + +.. automodule:: libs.utils.conf + :members: + :undoc-members: + :show-inheritance: + +libs.utils.energy module +------------------------ + +.. automodule:: libs.utils.energy + :members: + :undoc-members: + :show-inheritance: + +libs.utils.env module +--------------------- + +.. automodule:: libs.utils.env + :members: + :undoc-members: + :show-inheritance: + +libs.utils.executor module +-------------------------- + +.. automodule:: libs.utils.executor + :members: + :undoc-members: + :show-inheritance: + +libs.utils.perf_analysis module +------------------------------- + +.. automodule:: libs.utils.perf_analysis + :members: + :undoc-members: + :show-inheritance: + +libs.utils.report module +------------------------ + +.. automodule:: libs.utils.report + :members: + :undoc-members: + :show-inheritance: + +libs.utils.results module +------------------------- + +.. automodule:: libs.utils.results + :members: + :undoc-members: + :show-inheritance: + +libs.utils.test module +---------------------- + +.. automodule:: libs.utils.test + :members: + :undoc-members: + :show-inheritance: + +libs.utils.trace module +----------------------- + +.. automodule:: libs.utils.trace + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: libs.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/modules.rst b/doc/modules.rst new file mode 100644 index 0000000000000000000000000000000000000000..6ebf22d803c8451670cb81feb50220c3f775832d --- /dev/null +++ b/doc/modules.rst @@ -0,0 +1,7 @@ +libs +==== + +.. toctree:: + :maxdepth: 4 + + libs diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..cd67d5547f8510e17f05f4e55188d4be64a64a3c --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,7 @@ +Cython>=0.25.1 +bart-py>=1.7.0 +devlib>=0.0.3 +psutil>=4.4.2 +wrapt>=1.10.8 +ipython>=4.2.0 +matplotlib>=1.4.2 diff --git a/libs/__init__.py b/libs/__init__.py index 29e6046ff8dc97f2cff59455fc569e54378b05ff..f6c5eb07c61096cfe676613a124a745e163ce5bf 100644 --- a/libs/__init__.py +++ b/libs/__init__.py @@ -13,5 +13,14 @@ # limitations under the License. # +""" +.. automodule:: libs.utils + :members: + :show-inheritance: +.. automodule:: wlgen + :members: + :show-inheritance: +""" + import wlgen import utils diff --git a/libs/utils/__init__.py b/libs/utils/__init__.py index 294c6a063c041e8e2322bb0e67e2e9c2d785421b..8ae1d5e577973ff1eab2996d367bfb95931bb5d7 100644 --- a/libs/utils/__init__.py +++ b/libs/utils/__init__.py @@ -15,7 +15,11 @@ # limitations under the License. # -"""Initialization for utils module""" +""" +..automdule:: env + :members: + :show-inheritance: +""" from env import TestEnv from executor import Executor diff --git a/libs/utils/analysis/cpus_analysis.py b/libs/utils/analysis/cpus_analysis.py index bb4a1f038387fc1854aa837fe7fdd09318083b72..24b0e3d7b5c6b40f4957ae8eceb61abe093ffe92 100644 --- a/libs/utils/analysis/cpus_analysis.py +++ b/libs/utils/analysis/cpus_analysis.py @@ -31,7 +31,7 @@ class CpusAnalysis(AnalysisModule): Support for CPUs Signals Analysis :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/eas_analysis.py b/libs/utils/analysis/eas_analysis.py index e34c4614dff94000630c66db94825bcb6347be00..26fcfd56cc84210f5491f9d0bafa12ee20bd97ec 100644 --- a/libs/utils/analysis/eas_analysis.py +++ b/libs/utils/analysis/eas_analysis.py @@ -29,7 +29,7 @@ class EasAnalysis(AnalysisModule): Support for EAS signals anaysis :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/frequency_analysis.py b/libs/utils/analysis/frequency_analysis.py index 9a617b8ab3ceb0459bf7f2312fb69245f60ebec5..84929c96119188e68f2faba7ffbdc8ed61e73985 100644 --- a/libs/utils/analysis/frequency_analysis.py +++ b/libs/utils/analysis/frequency_analysis.py @@ -35,7 +35,7 @@ class FrequencyAnalysis(AnalysisModule): Support for plotting Frequency Analysis data :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/functions_analysis.py b/libs/utils/analysis/functions_analysis.py index 4f4e7da44a9ef99bd54e0d81132cd6a1080a6230..7ae3d21f2e51ed4423634d150d36f5db60247053 100644 --- a/libs/utils/analysis/functions_analysis.py +++ b/libs/utils/analysis/functions_analysis.py @@ -27,7 +27,7 @@ class FunctionsAnalysis(AnalysisModule): Support for kernel functions profiling and analysis :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/idle_analysis.py b/libs/utils/analysis/idle_analysis.py index 3f3d660d3dd8859ae94f658b3619b5cace462d17..3a2bbb4ac658007a54394f43a2e7beef521bc3b4 100644 --- a/libs/utils/analysis/idle_analysis.py +++ b/libs/utils/analysis/idle_analysis.py @@ -32,7 +32,7 @@ class IdleAnalysis(AnalysisModule): Support for plotting Idle Analysis data :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/latency_analysis.py b/libs/utils/analysis/latency_analysis.py index d0464c4716ecf3fe4e6999ced45f418b0bb1bd6a..2e9af7ae88c42002f132755c67d377f214f79686 100644 --- a/libs/utils/analysis/latency_analysis.py +++ b/libs/utils/analysis/latency_analysis.py @@ -39,7 +39,7 @@ class LatencyAnalysis(AnalysisModule): Support for plotting Latency Analysis data :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/status_analysis.py b/libs/utils/analysis/status_analysis.py index a87522c7b10d2f1139122427662a4ff4cd7b434c..823465823dfe1532c10fa3968192690775db53ec 100644 --- a/libs/utils/analysis/status_analysis.py +++ b/libs/utils/analysis/status_analysis.py @@ -30,7 +30,7 @@ class StatusAnalysis(AnalysisModule): Support for System Status analysis :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis/tasks_analysis.py b/libs/utils/analysis/tasks_analysis.py index 7fc749b4e88530f4345b4b6815aa83fe69176bab..b9b51943320b51398e23f00a33a4541c43d321fb 100644 --- a/libs/utils/analysis/tasks_analysis.py +++ b/libs/utils/analysis/tasks_analysis.py @@ -33,7 +33,7 @@ class TasksAnalysis(AnalysisModule): Support for Tasks signals analysis. :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis_module.py b/libs/utils/analysis_module.py index c14b9561048e15dde4a017c5af8ecb213fff324d..9f03d37b532664b1a01d1b5af1df1c3f48d0d3ee 100644 --- a/libs/utils/analysis_module.py +++ b/libs/utils/analysis_module.py @@ -25,7 +25,7 @@ class AnalysisModule(object): Base class for Analysis modules. :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace): diff --git a/libs/utils/analysis_register.py b/libs/utils/analysis_register.py index ba5be1e3406bbc1f94d0738a7e090afc88b5cd25..a42b05936f538ce34d0452457f78b96eb103fca2 100644 --- a/libs/utils/analysis_register.py +++ b/libs/utils/analysis_register.py @@ -34,7 +34,7 @@ class AnalysisRegister(object): Define list of supported Analysis Classes. :param trace: input Trace object - :type trace: :mod:`libs.utils.Trace` + :type trace: :class:`trace.Trace` """ def __init__(self, trace):