Skip to content

Commit

Permalink
add visualizations for basic blocks and function arguments
Browse files Browse the repository at this point in the history
Three new visualizations are introduced in this commit: basicblocks,
funcargs, and treemap.

The basicblocks visualization is a sunburst graph that contains
run-times (or number of executions) of functions with their basic
blocks. It supports basic mapping of the basic blocks to the source
code. The mapping is, however bit tricky to incorporate into the graph,
thus treemap visualization utilizing different library was created.
This visualization uses old version of bokehlibrary and might be retired
in the future.

The funcargs visualization is a scatter graph that shows dependency
between function run-time and values of collected arguments.

The treemap visualization has multiple forms of representation as a
graph: tree-map, sunburst, and flame graph. Each visualizes
the call graph as a tree in a slightly different way. It supports
mapping of basic blocks to source code.
  • Loading branch information
PeterMocary committed Apr 2, 2024
1 parent b6ae89f commit 067e3e5
Show file tree
Hide file tree
Showing 7 changed files with 744 additions and 2 deletions.
9 changes: 7 additions & 2 deletions perun/view/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
2. By **using python interpreter** together with internal modules for
manipulation, conversion and querying the profiles (refer to
:ref:`profile-api`, :ref:`profile-query-api`, and
:ref:`profile-conversion-api`) and external statistical libraries, like
e.g. using pandas_.
:ref:`profile-conversion-api`) and external statistical libraries, like e.g. using pandas_.
The format of input profiles has to be w.r.t. :ref:`profile-spec`, in
particular the intepreted profiles should contain the :pkey:`resources` region
Expand Down Expand Up @@ -57,6 +56,9 @@ def lazy_get_cli_commands() -> list[Callable[..., Any]]:
import perun.view.raw.run as raw_run
import perun.view.scatter.run as scatter_run
import perun.view.tableof.run as tableof_run
import perun.view.funcargs.run as funcargs_run
import perun.view.treemap.run as treemap_run
import perun.view.basicblocks.run as basicblocks_run

return [
bars_run.bars,
Expand All @@ -65,4 +67,7 @@ def lazy_get_cli_commands() -> list[Callable[..., Any]]:
raw_run.raw,
scatter_run.scatter,
tableof_run.tableof,
funcargs_run.funcargs,
treemap_run.treemap,
basicblocks_run.basicblocks
]
16 changes: 16 additions & 0 deletions perun/view/basicblocks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""`Basic Blocks` - displays information about basic blocks as a sunburst graph.
Displays the percentage of time spent exclusively in visualized functions as
well as time spent in the top basic blocks from each of these functions, which
helps to point out the most demanding functions and also basic blocks. this
visualization also provides ability to modify its output by filtering how many
functions or basic blocks to display. Besides the time metrics, similar
information about number of executions is displayed as well.
.. _Bokeh: http://docs.bokeh.org/en/0.12.6/docs/gallery/burtin.html
"""

SUPPORTED_PROFILES = ['mixed']


__author__ = 'Peter Močáry'
Loading

0 comments on commit 067e3e5

Please sign in to comment.