Hello community,

here is the log from the commit of package python-gprof2dot for 
openSUSE:Factory checked in at 2020-05-06 11:04:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gprof2dot (Old)
 and      /work/SRC/openSUSE:Factory/.python-gprof2dot.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-gprof2dot"

Wed May  6 11:04:41 2020 rev:4 rq:800573 version:2019.11.30

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gprof2dot/python-gprof2dot.changes        
2019-01-11 14:05:01.991827572 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-gprof2dot.new.2738/python-gprof2dot.changes  
    2020-05-06 11:04:44.455323683 +0200
@@ -1,0 +2,14 @@
+Wed May  6 06:34:30 UTC 2020 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Update to version 2019.11.30:
+  * add keyword argv to main
+  * Sum call counts in JSON format.
+  * Add dtrace support.
+  * Add --nodel-label option to specify the measurements shown
+  * Don't hardcode theme names in opt parsing code
+  * Fix a typo in gprof2dot.py
+  * fix Profile.prune() for cases when filename is not set
+  * Add README and LICENSE to the manifest. 
+- Drop Source10 (copy of LICENSE), now included in upstream tarball.
+
+-------------------------------------------------------------------

Old:
----
  LICENSE.txt
  gprof2dot-2017.9.19.tar.gz

New:
----
  gprof2dot-2019.11.30.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-gprof2dot.spec ++++++
--- /var/tmp/diff_new_pack.rlg9Oq/_old  2020-05-06 11:04:45.091325049 +0200
+++ /var/tmp/diff_new_pack.rlg9Oq/_new  2020-05-06 11:04:45.095325057 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-gprof2dot
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,15 +18,12 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-gprof2dot
-Version:        2017.9.19
+Version:        2019.11.30
 Release:        0
-%define gitver  2017.09.19
 Summary:        Script to generate a dot graph from the output of several 
profilers
 License:        LGPL-3.0-or-later
-Group:          Development/Languages/Python
-Url:            https://github.com/jrfonseca/gprof2dot
+URL:            https://github.com/jrfonseca/gprof2dot
 Source:         
https://files.pythonhosted.org/packages/source/g/gprof2dot/gprof2dot-%{version}.tar.gz
-Source10:       
https://raw.githubusercontent.com/jrfonseca/gprof2dot/%{gitver}/LICENSE.txt
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -40,7 +37,6 @@
 
 %prep
 %setup -q -n gprof2dot-%{version}
-cp %{SOURCE10} .
 sed -i -e '/^#!\//, 1d' gprof2dot.py 
 
 %build

++++++ gprof2dot-2017.9.19.tar.gz -> gprof2dot-2019.11.30.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/LICENSE.txt 
new/gprof2dot-2019.11.30/LICENSE.txt
--- old/gprof2dot-2017.9.19/LICENSE.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/gprof2dot-2019.11.30/LICENSE.txt        2010-03-24 00:34:01.000000000 
+0100
@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/MANIFEST.in 
new/gprof2dot-2019.11.30/MANIFEST.in
--- old/gprof2dot-2017.9.19/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100
+++ new/gprof2dot-2019.11.30/MANIFEST.in        2018-06-16 23:20:49.000000000 
+0200
@@ -0,0 +1,2 @@
+include README.md
+include LICENSE.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/PKG-INFO 
new/gprof2dot-2019.11.30/PKG-INFO
--- old/gprof2dot-2017.9.19/PKG-INFO    2017-09-19 11:04:43.000000000 +0200
+++ new/gprof2dot-2019.11.30/PKG-INFO   2019-11-30 21:47:19.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: gprof2dot
-Version: 2017.9.19
+Version: 2019.11.30
 Summary: Generate a dot graph from the output of several profilers.
 Home-page: https://github.com/jrfonseca/gprof2dot
 Author: Jose Fonseca
@@ -16,7 +16,7 @@
 Classifier: Intended Audience :: Developers
 Classifier: Operating System :: OS Independent
 Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or 
later (LGPLv3+)
-Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/README.md 
new/gprof2dot-2019.11.30/README.md
--- old/gprof2dot-2017.9.19/README.md   1970-01-01 01:00:00.000000000 +0100
+++ new/gprof2dot-2019.11.30/README.md  2019-11-30 21:29:12.000000000 +0100
@@ -0,0 +1,298 @@
+# About _gprof2dot_
+
+This is a Python script to convert the output from many profilers into a [dot 
graph](http://www.graphviz.org/doc/info/lang.html).
+
+It can:
+
+  * read output from:
+    * [Linux perf](http://perf.wiki.kernel.org/)
+    * [Valgrind's callgrind 
tool](http://valgrind.org/docs/manual/cl-manual.html)
+    * [oprofile](http://oprofile.sourceforge.net/)
+    * [sysprof](http://www.daimi.au.dk/~sandmann/sysprof/)
+    * 
[xperf](https://msdn.microsoft.com/en-us/windows/hardware/commercialize/test/wpt/index)
+    * [VTune Amplifier 
XE](http://software.intel.com/en-us/intel-vtune-amplifier-xe)
+    * [Very Sleepy](http://www.codersnotes.com/sleepy/)
+    * [python 
profilers](http://docs.python.org/2/library/profile.html#profile-stats)
+    * [Java's 
HPROF](http://docs.oracle.com/javase/7/docs/technotes/samples/hprof.html)
+    * prof, [gprof](https://sourceware.org/binutils/docs/gprof/)
+    * [DTrace](https://en.wikipedia.org/wiki/DTrace)
+  * prune nodes and edges below a certain threshold;
+  * use an heuristic to propagate time inside mutually recursive functions;
+  * use color efficiently to draw attention to hot-spots;
+  * work on any platform where Python and Graphviz is available, i.e, 
virtually anywhere.
+
+**If you want an interactive viewer for the graphs generated by _gprof2dot_, 
check [xdot.py](https://github.com/jrfonseca/xdot.py).**
+
+
+# Status
+
+_gprof2dot_ currently fulfills my needs, and I have little or no time for its
+maintenance.  So I'm afraid that any requested features are unlikely to be
+implemented, and I might be slow processing issue reports or pull requests.
+
+[![CircleCI](https://circleci.com/gh/jrfonseca/gprof2dot/tree/master.svg?style=svg)](https://circleci.com/gh/jrfonseca/gprof2dot/tree/master)
+[![Build 
Status](https://travis-ci.org/jrfonseca/gprof2dot.svg?branch=master)](https://travis-ci.org/jrfonseca/gprof2dot)
+
+
+# Example
+
+This is the result from the [example 
data](http://linuxgazette.net/100/misc/vinayak/overall-profile.txt) in the 
[Linux Gazette article](http://linuxgazette.net/100/vinayak.html) with the 
default settings:
+
+<!-- pngquant --speed=1 --ordered  --quality 0-85 ... -->
+![Sample](sample.png)
+
+# Requirements
+
+  * [Python](http://www.python.org/download/): known to work with version 2.7 
and 3.3; it will most likely _not_ work with earlier releases.
+  * [Graphviz](http://www.graphviz.org/Download.php): tested with version 
2.26.3, but should work fine with other versions.
+
+## Windows users
+
+  * Download and install [Python for Windows](http://www.python.org/download/)
+  * Download and install [Graphviz for 
Windows](http://www.graphviz.org/Download_windows.php)
+
+## Linux users
+
+On Debian/Ubuntu run:
+
+    apt-get install python3 graphviz
+
+On RedHat/Fedora run
+
+    yum install python3 graphviz
+
+
+# Download
+
+  * [PyPI](https://pypi.python.org/pypi/gprof2dot/)
+
+        pip install gprof2dot
+
+  * [Standalone 
script](https://raw.githubusercontent.com/jrfonseca/gprof2dot/master/gprof2dot.py)
+
+  * [Git repository](https://github.com/jrfonseca/gprof2dot)
+
+
+# Documentation
+
+## Usage
+
+    Usage:
+            gprof2dot.py [options] [file] ...
+    
+    Options:
+      -h, --help            show this help message and exit
+      -o FILE, --output=FILE
+                            output filename [stdout]
+      -n PERCENTAGE, --node-thres=PERCENTAGE
+                            eliminate nodes below this threshold [default: 0.5]
+      -e PERCENTAGE, --edge-thres=PERCENTAGE
+                            eliminate edges below this threshold [default: 0.1]
+      -f FORMAT, --format=FORMAT
+                            profile format: axe, callgrind, hprof, json, 
oprofile,
+                            perf, prof, pstats, sleepy, sysprof or xperf 
[default:
+                            prof]
+      --total=TOTALMETHOD   preferred method of calculating total time: 
callratios
+                            or callstacks (currently affects only perf format)
+                            [default: callratios]
+      -c THEME, --colormap=THEME
+                            color map: color, pink, gray, bw, or print 
[default:
+                            color]
+      -s, --strip           strip function parameters, template parameters, and
+                            const modifiers from demangled C++ function names
+      -w, --wrap            wrap function names
+      --show-samples        show function samples
+      -z ROOT, --root=ROOT  prune call graph to show only descendants of 
specified
+                            root function
+      -l LEAF, --leaf=LEAF  prune call graph to show only ancestors of 
specified
+                            leaf function
+      --skew=THEME_SKEW     skew the colorization curve.  Values < 1.0 give 
more
+                            variety to lower percentages.  Values > 1.0 give 
less
+                            variety to lower percentages
+
+## Examples
+
+### Linux perf
+
+    perf record -g -- /path/to/your/executable
+    perf script | c++filt | gprof2dot.py -f perf | dot -Tpng -o output.png
+
+### oprofile
+
+    opcontrol --callgraph=16
+    opcontrol --start
+    /path/to/your/executable arg1 arg2
+    opcontrol --stop
+    opcontrol --dump
+    opreport -cgf | gprof2dot.py -f oprofile | dot -Tpng -o output.png
+
+### xperf
+
+If you're not familiar with xperf then read [this excellent 
article](http://blogs.msdn.com/b/pigscanfly/archive/2009/08/06/stack-walking-in-xperf.aspx)
 first. Then do:
+
+  * Start xperf as
+
+        xperf -on Latency -stackwalk profile
+
+  * Run your application.
+
+  * Save the data.
+`
+        xperf -d output.etl
+
+  * Start the visualizer:
+
+        xperf output.etl
+
+  * In _Trace_ menu, select _Load Symbols_. _Configure Symbol Paths_ if 
necessary.
+
+  * Select an area of interest on the _CPU sampling graph_, right-click, and 
select _Summary Table_.
+
+  * In the _Columns_ menu, make sure the _Stack_ column is enabled and visible.
+
+  * Right click on a row, choose _Export Full Table_, and save to _output.csv_.
+
+  * Then invoke gprof2dot as
+
+        gprof2dot.py -f xperf output.csv | dot -Tpng -o output.png
+
+### VTune Amplifier XE
+
+  * Collect profile data as (also can be done from GUI):
+
+        amplxe-cl -collect hotspots -result-dir output -- your-app
+
+  * Visualize profile data as:
+
+        amplxe-cl -report gprof-cc -result-dir output -format text 
-report-output output.txt
+        gprof2dot.py -f axe output.txt | dot -Tpng -o output.png
+
+See also [Kirill Rogozhin's blog 
post](http://software.intel.com/en-us/blogs/2013/04/05/making-visualized-call-graph-from-intel-vtune-amplifier-xe-results).
+
+### gprof
+
+    /path/to/your/executable arg1 arg2
+    gprof path/to/your/executable | gprof2dot.py | dot -Tpng -o output.png
+
+### python profile
+
+    python -m profile -o output.pstats path/to/your/script arg1 arg2
+    gprof2dot.py -f pstats output.pstats | dot -Tpng -o output.png
+
+### python cProfile (formerly known as lsprof)
+
+    python -m cProfile -o output.pstats path/to/your/script arg1 arg2
+    gprof2dot.py -f pstats output.pstats | dot -Tpng -o output.png
+
+### Java HPROF
+
+    java -agentlib:hprof=cpu=samples ...
+    gprof2dot.py -f hprof java.hprof.txt | dot -Tpng -o output.png
+
+See [Russell Power's blog post](http://rjp.io/2012/07/03/java-profiling/) for 
details.
+
+### DTrace
+
+    dtrace -x ustackframes=100 -n 'profile-97 /pid == 12345/ { @[ustack()] = 
count(); } tick-60s { exit(0); }' -o out.user_stacks
+    gprof2dot.py -f dtrace out.user_stacks | dot -Tpng -o output.png
+
+    # Notice: sometimes, the dtrace outputs format may be latin-1, and 
gprof2dot will fail to parse it.
+    # To solve this problem, you should use iconv to convert to UTF-8 
explicitly.
+    # TODO: add an encoding flag to tell gprof2dot how to decode the profile 
file.
+    iconv -f ISO-8859-1 -t UTF-8 out.user_stacks | gprof2dot.py -f dtrace
+
+## Output
+
+A node in the output graph represents a function and has the following layout:
+
+    +------------------------------+
+    |        function name         |
+    | total time % ( self time % ) |
+    |         total calls          |
+    +------------------------------+
+
+where:
+
+  * _total time %_ is the percentage of the running time spent in this 
function and all its children;
+  * _self time %_ is the percentage of the running time spent in this function 
alone;
+  * _total calls_ is the total number of times this function was called 
(including recursive calls).
+
+An edge represents the calls between two functions and has the following 
layout:
+
+               total time %
+                  calls
+    parent --------------------> children
+
+Where:
+
+  * _total time %_ is the percentage of the running time transfered from the 
children to this parent (if available);
+  * _calls_ is the number of calls the parent function called the children.
+
+Note that in recursive cycles, the _total time %_ in the node is the same for 
the whole functions in the cycle, and there is no _total time %_ figure in the 
edges inside the cycle, since such figure would make no sense.
+
+The color of the nodes and edges varies according to the _total time %_ value. 
In the default _temperature-like_ color-map, functions where most time is spent 
(hot-spots) are marked as saturated red, and functions where little time is 
spent are marked as dark blue. Note that functions where negligible or no time 
is spent do not appear in the graph by default.
+
+## Frequently Asked Questions
+
+### How can I generate a complete call graph?
+
+By default `gprof2dot.py` generates a _partial_ call graph, excluding nodes 
and edges with little or no impact in the total computation time. If you want 
the full call graph then set a zero threshold for nodes and edges via the `-n` 
/ `--node-thres`  and `-e` / `--edge-thres` options, as:
+
+    gprof2dot.py -n0 -e0
+
+### The node labels are too wide. How can I narrow them?
+
+The node labels can get very wide when profiling C++ code, due to inclusion of 
scope, function arguments, and template arguments in demangled C++ function 
names.
+
+If you do not need function and template arguments information, then pass the 
`-s` / `--strip` option to strip them.
+
+If you want to keep all that information, or if the labels are still too wide, 
then you can pass the `-w` / `--wrap`, to wrap the labels. Note that because 
`dot` does not wrap labels automatically the label margins will not be 
perfectly aligned.
+
+### Why there is no output, or it is all in the same color?
+
+Likely, the total execution time is too short, so there is not enough 
precision in the profile to determine where time is being spent.
+
+You can still force displaying the whole graph by setting a zero threshold for 
nodes and edges via the `-n` / `--node-thres`  and `-e` / `--edge-thres` 
options, as:
+
+    gprof2dot.py -n0 -e0
+
+But to get meaningful results you will need to find a way to run the program 
for a longer time period (aggregate results from multiple runs).
+
+### Why don't the percentages add up?
+
+You likely have an execution time too short, causing the round-off errors to 
be large.
+
+See question above for ways to increase execution time.
+
+### Which options should I pass to gcc when compiling for profiling?
+
+Options which are _essential_ to produce suitable results are:
+
+  * **`-g`** : produce debugging information
+  * **`-fno-omit-frame-pointer`** : use the frame pointer (frame pointer usage 
is disabled by default in some architectures like x86\_64 and for some 
optimization levels; it is impossible to walk the call stack without it)
+
+_If_ you're using gprof you will also need `-pg` option, but nowadays you can 
get much better results with other profiling tools, most of which require no 
special code instrumentation when compiling.
+
+You want the code you are profiling to be as close as possible as the code 
that you will
+be releasing. So you _should_ include all options that you use in your release 
code, typically:
+
+  * **`-O2`** : optimizations that do not involve a space-speed tradeoff
+  * **`-DNDEBUG`** : disable debugging code in the standard library (such as 
the assert macro)
+
+However many of the optimizations performed by gcc interfere with the 
accuracy/granularity of the profiling results.  You _should_ pass these options 
to disable those particular optimizations:
+
+  * **`-fno-inline-functions`** : do not inline functions into their parents 
(otherwise the time spent on these functions will be attributed to the caller)
+  * **`-fno-inline-functions-called-once`** : similar to above
+  * **`-fno-optimize-sibling-calls`** : do not optimize sibling and tail 
recursive calls (otherwise tail calls may be attributed to the parent function)
+
+If the granularity is still too low, you _may_ pass these options to achieve 
finer granularity:
+
+  * **`-fno-default-inline`** : do not make member functions inline by default 
merely because they are defined inside the class scope
+  * **`-fno-inline`** : do not pay attention to the inline keyword
+Note however that with these last options the timings of functions called many 
times will be distorted due to the function call overhead. This is particularly 
true for typical C++ code which _expects_ that these optimizations to be done 
for decent performance.
+
+See the [full list of gcc optimization 
options](http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html) for more 
information.
+
+# Links
+
+See the [wiki](https://github.com/jrfonseca/gprof2dot/wiki) for external 
resources, including complementary/alternative tools.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/gprof2dot.egg-info/PKG-INFO 
new/gprof2dot-2019.11.30/gprof2dot.egg-info/PKG-INFO
--- old/gprof2dot-2017.9.19/gprof2dot.egg-info/PKG-INFO 2017-09-19 
11:04:43.000000000 +0200
+++ new/gprof2dot-2019.11.30/gprof2dot.egg-info/PKG-INFO        2019-11-30 
21:47:19.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: gprof2dot
-Version: 2017.9.19
+Version: 2019.11.30
 Summary: Generate a dot graph from the output of several profilers.
 Home-page: https://github.com/jrfonseca/gprof2dot
 Author: Jose Fonseca
@@ -16,7 +16,7 @@
 Classifier: Intended Audience :: Developers
 Classifier: Operating System :: OS Independent
 Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or 
later (LGPLv3+)
-Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/gprof2dot.egg-info/SOURCES.txt 
new/gprof2dot-2019.11.30/gprof2dot.egg-info/SOURCES.txt
--- old/gprof2dot-2017.9.19/gprof2dot.egg-info/SOURCES.txt      2017-09-19 
11:04:43.000000000 +0200
+++ new/gprof2dot-2019.11.30/gprof2dot.egg-info/SOURCES.txt     2019-11-30 
21:47:19.000000000 +0100
@@ -1,3 +1,6 @@
+LICENSE.txt
+MANIFEST.in
+README.md
 gprof2dot.py
 setup.py
 gprof2dot.egg-info/PKG-INFO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/gprof2dot.py 
new/gprof2dot-2019.11.30/gprof2dot.py
--- old/gprof2dot-2017.9.19/gprof2dot.py        2017-09-19 10:30:52.000000000 
+0200
+++ new/gprof2dot-2019.11.30/gprof2dot.py       2019-11-30 21:29:12.000000000 
+0100
@@ -149,6 +149,14 @@
 TOTAL_TIME = Event("Total time", 0.0, fail)
 TOTAL_TIME_RATIO = Event("Total time ratio", 0.0, fail, percentage)
 
+labels = {
+    'self-time': TIME,
+    'self-time-percentage': TIME_RATIO,
+    'total-time': TOTAL_TIME,
+    'total-time-percentage': TOTAL_TIME_RATIO,
+}
+defaultLabelNames = ['total-time-percentage', 'self-time-percentage']
+
 totalMethod = 'callratios'
 
 
@@ -681,7 +689,7 @@
                     call[outevent] = ratio(call[inevent], self[inevent])
         self[outevent] = 1.0
 
-    def prune(self, node_thres, edge_thres, paths, colour_nodes_by_selftime):
+    def prune(self, node_thres, edge_thres, paths, color_nodes_by_selftime):
         """Prune the profile"""
 
         # compute the prune ratios
@@ -714,17 +722,19 @@
         # prune file paths
         for function_id in compat_keys(self.functions):
             function = self.functions[function_id]
-            if paths and not any(function.filename.startswith(path) for path 
in paths):
+            if paths and function.filename and not 
any(function.filename.startswith(path) for path in paths):
+                del self.functions[function_id]
+            elif paths and function.module and not 
any((function.module.find(path)>-1) for path in paths):
                 del self.functions[function_id]
 
-        # prune the egdes
+        # prune the edges
         for function in compat_itervalues(self.functions):
             for callee_id in compat_keys(function.calls):
                 call = function.calls[callee_id]
                 if callee_id not in self.functions or call.weight is not None 
and call.weight < edge_thres:
                     del function.calls[callee_id]
 
-        if colour_nodes_by_selftime:
+        if color_nodes_by_selftime:
             weights = []
             for function in compat_itervalues(self.functions):
                 try:
@@ -848,6 +858,7 @@
             except KeyError:
                 pass
             function[SAMPLES] = 0
+            function.called = 0
             profile.add_function(function)
 
         for event in obj['events']:
@@ -857,6 +868,10 @@
                 function = profile.functions[functionIndex]
                 callchain.append(function)
 
+            # increment the call count of the first in the callchain
+            function = profile.functions[event['callchain'][0]]
+            function.called = function.called + 1
+
             cost = event['cost'][0]
 
             callee = callchain[0]
@@ -2740,6 +2755,151 @@
 
         return self.profile
 
+class DtraceParser(LineParser):
+    """Parser for linux perf callgraph output.
+
+    It expects output generated with
+        
+        # Refer to https://github.com/brendangregg/FlameGraph#dtrace
+        # 60 seconds of user-level stacks, including time spent in-kernel, for 
PID 12345 at 97 Hertz     
+        sudo dtrace -x ustackframes=100 -n 'profile-97 /pid == 12345/ { 
@[ustack()] = count(); } tick-60s { exit(0); }' -o out.user_stacks
+        
+        # The dtrace output
+        gprof2dot.py -f dtrace out.user_stacks
+
+        # Notice: sometimes, the dtrace outputs format may be latin-1, and 
gprof2dot will fail to parse it.
+        # To solve this problem, you should use iconv to convert to UTF-8 
explicitly.
+        # TODO: add an encoding flag to tell gprof2dot how to decode the 
profile file.
+        iconv -f ISO-8859-1 -t UTF-8 out.user_stacks | gprof2dot.py -f dtrace
+    """
+
+    def __init__(self, infile):
+        LineParser.__init__(self, infile)
+        self.profile = Profile()
+
+    def readline(self):
+        # Override LineParser.readline to ignore comment lines
+        while True:
+            LineParser.readline(self)
+            if self.eof():
+                break
+
+            line = self.lookahead().strip()
+            if line.startswith('CPU'):
+                # The format likes:
+                # CPU     ID                    FUNCTION:NAME
+                #   1  29684                        :tick-60s 
+                # Skip next line
+                LineParser.readline(self)
+            elif not line == '':
+                break
+
+
+    def parse(self):
+        # read lookahead
+        self.readline()
+
+        profile = self.profile
+        profile[SAMPLES] = 0
+        while not self.eof():
+            self.parse_event()
+
+        # compute derived data
+        profile.validate()
+        profile.find_cycles()
+        profile.ratio(TIME_RATIO, SAMPLES)
+        profile.call_ratios(SAMPLES2)
+        if totalMethod == "callratios":
+            # Heuristic approach.  TOTAL_SAMPLES is unused.
+            profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
+        elif totalMethod == "callstacks":
+            # Use the actual call chains for functions.
+            profile[TOTAL_SAMPLES] = profile[SAMPLES]
+            profile.ratio(TOTAL_TIME_RATIO, TOTAL_SAMPLES)
+            # Then propagate that total time to the calls.
+            for function in compat_itervalues(profile.functions):
+                for call in compat_itervalues(function.calls):
+                    if call.ratio is not None:
+                        callee = profile.functions[call.callee_id]
+                        call[TOTAL_TIME_RATIO] = call.ratio * 
callee[TOTAL_TIME_RATIO]
+        else:
+            assert False
+
+        return profile
+
+    def parse_event(self):
+        if self.eof():
+            return
+
+        callchain, count = self.parse_callchain()
+        if not callchain:
+            return
+
+        callee = callchain[0]
+        callee[SAMPLES] += count
+        self.profile[SAMPLES] += count
+
+        for caller in callchain[1:]:
+            try:
+                call = caller.calls[callee.id]
+            except KeyError:
+                call = Call(callee.id)
+                call[SAMPLES2] = count
+                caller.add_call(call)
+            else:
+                call[SAMPLES2] += count
+
+            callee = caller
+
+        # Increment TOTAL_SAMPLES only once on each function.
+        stack = set(callchain)
+        for function in stack:
+            function[TOTAL_SAMPLES] += count
+
+
+    def parse_callchain(self):
+        callchain = []
+        count = 0
+        while self.lookahead():
+            function, count = self.parse_call()
+            if function is None:
+                break
+            callchain.append(function)
+        return callchain, count
+
+    call_re = re.compile(r'^\s+(?P<module>.*)`(?P<symbol>.*)')
+    addr2_re = re.compile(r'\+0x[0-9a-fA-F]+$')
+
+    def parse_call(self):
+        line = self.consume()
+        mo = self.call_re.match(line)
+        if not mo:
+            # The line must be the stack count
+            return None, int(line.strip())
+
+        function_name = mo.group('symbol')
+
+        # If present, amputate program counter from function name.
+        if function_name:
+            function_name = re.sub(self.addr2_re, '', function_name)
+
+        # if not function_name or function_name == '[unknown]':
+        #     function_name = mo.group('address')
+
+        module = mo.group('module')
+
+        function_id = function_name + ':' + module
+
+        try:
+            function = self.profile.functions[function_id]
+        except KeyError:
+            function = Function(function_id, function_name)
+            function.module = os.path.basename(module)
+            function[SAMPLES] = 0
+            function[TOTAL_SAMPLES] = 0
+            self.profile.add_function(function)
+
+        return function, None
 
 formats = {
     "axe": AXEParser,
@@ -2753,6 +2913,7 @@
     "sleepy": SleepyParser,
     "sysprof": SysprofParser,
     "xperf": XPerfParser,
+    "dtrace": DtraceParser,
 }
 
 
@@ -3160,7 +3321,7 @@
         return ''.join(values)
 
 
-def main():
+def main(argv=sys.argv[1:]):
     """Main program."""
 
     global totalMethod
@@ -3168,6 +3329,12 @@
     formatNames = list(formats.keys())
     formatNames.sort()
 
+    themeNames = list(themes.keys())
+    themeNames.sort()
+
+    labelNames = list(labels.keys())
+    labelNames.sort()
+
     optparser = optparse.OptionParser(
         usage="\n\t%prog [options] [file] ...")
     optparser.add_option(
@@ -3194,19 +3361,24 @@
         help="preferred method of calculating total time: callratios or 
callstacks (currently affects only perf format) [default: %default]")
     optparser.add_option(
         '-c', '--colormap',
-        type="choice", choices=('color', 'pink', 'gray', 'bw', 'print'),
+        type="choice", choices=themeNames,
         dest="theme", default="color",
-        help="color map: color, pink, gray, bw, or print [default: %default]")
+        help="color map: %s [default: %%default]" % naturalJoin(themeNames))
     optparser.add_option(
         '-s', '--strip',
         action="store_true",
         dest="strip", default=False,
         help="strip function parameters, template parameters, and const 
modifiers from demangled C++ function names")
     optparser.add_option(
+        '--color-nodes-by-selftime',
+        action="store_true",
+        dest="color_nodes_by_selftime", default=False,
+        help="color nodes by self time, rather than by total time (sum of self 
and descendants)")
+    optparser.add_option(
         '--colour-nodes-by-selftime',
         action="store_true",
-        dest="colour_nodes_by_selftime", default=False,
-        help="colour nodes by self time, rather than by total time (sum of 
self and descendants)")
+        dest="color_nodes_by_selftime",
+        help=optparse.SUPPRESS_HELP)
     optparser.add_option(
         '-w', '--wrap',
         action="store_true",
@@ -3217,6 +3389,13 @@
         action="store_true",
         dest="show_samples", default=False,
         help="show function samples")
+    optparser.add_option(
+        '--node-label', metavar='MEASURE',
+        type='choice', choices=labelNames,
+        action='append',
+        dest='node_labels',
+        help="measurements to on show the node (can be specified multiple 
times): %s [default: %s]" % (
+            naturalJoin(labelNames), ', '.join(defaultLabelNames)))
     # add option to create subtree or show paths
     optparser.add_option(
         '-z', '--root',
@@ -3243,7 +3422,7 @@
         '-p', '--path', action="append",
         type="string", dest="filter_paths",
         help="Filter all modules not in a specified path")
-    (options, args) = optparser.parse_args(sys.argv[1:])
+    (options, args) = optparser.parse_args(argv)
 
     if len(args) > 1 and options.format != 'pstats':
         optparser.error('incorrect number of arguments')
@@ -3297,11 +3476,14 @@
     dot = DotWriter(output)
     dot.strip = options.strip
     dot.wrap = options.wrap
+
+    labelNames = options.node_labels or defaultLabelNames
+    dot.show_function_events = [labels[l] for l in labelNames]
     if options.show_samples:
         dot.show_function_events.append(SAMPLES)
 
     profile = profile
-    profile.prune(options.node_thres/100.0, options.edge_thres/100.0, 
options.filter_paths, options.colour_nodes_by_selftime)
+    profile.prune(options.node_thres/100.0, options.edge_thres/100.0, 
options.filter_paths, options.color_nodes_by_selftime)
 
     if options.root:
         rootIds = profile.getFunctionIds(options.root)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gprof2dot-2017.9.19/setup.py 
new/gprof2dot-2019.11.30/setup.py
--- old/gprof2dot-2017.9.19/setup.py    2017-09-19 10:52:25.000000000 +0200
+++ new/gprof2dot-2019.11.30/setup.py   2019-11-30 21:32:16.000000000 +0100
@@ -3,19 +3,18 @@
 # The purpose of this script is to enable uploading gprof2dot.py to the Python
 # Package Index, which can be easily done by doing:
 #
-#   python setup.py register
-#   python setup.py sdist upload
+#   python3 setup.py sdist upload
 #
 # See also:
 # - https://packaging.python.org/distributing/
-# - https://docs.python.org/2/distutils/packageindex.html
+# - https://docs.python.org/3/distutils/packageindex.html
 #
 
 from setuptools import setup
 
 setup(
     name='gprof2dot',
-    version='2017.09.19',
+    version='2019.11.30',
     author='Jose Fonseca',
     author_email='jose.r.fons...@gmail.com',
     url='https://github.com/jrfonseca/gprof2dot',
@@ -41,7 +40,7 @@
 
         'License :: OSI Approved :: GNU Lesser General Public License v3 or 
later (LGPLv3+)',
 
-        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',


Reply via email to