Title: -m pstats should combine all the profiles given as arguments
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: anacrolix, eric.araujo, georg.brandl, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-01-23 03:38 by anacrolix, last changed 2012-03-14 16:54 by pitrou. This issue is now closed.

File name Uploaded Description Edit
m-pstats-merge-profiles.patch anacrolix, 2012-01-23 03:38 review
Messages (4)
msg151795 - (view) Author: Matt Joiner (anacrolix) Date: 2012-01-23 03:38
Frequently when profiling multiple threads, I need to combine several dump stat files. Currently -m pstats reads the profiling data at only the first path given. It should merge all the profiling data from all the paths given.

$ python3.3 -m pstats prof/5506-7f00f*

Minimalist patch attached.
msg152682 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2012-02-05 12:34
This sounds like a reasonable request.  The patch needs tests, probably using test.script_helper.assert_python_ok.
msg155766 - (view) Author: Roundup Robot (python-dev) Date: 2012-03-14 16:51
New changeset 3a5a0e7d38c5 by Antoine Pitrou in branch 'default':
Issue #13839: When invoked on the command-line, the pstats module now accepts several filenames of profile stat files and merges them all.
msg155767 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-03-14 16:54
I've committed the patch. Eric, adding a test suite for pstats' command-line interface is a separate concern.
Date User Action Args
2012-03-14 16:54:39pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg155767

resolution: fixed
stage: test needed -> resolved
2012-03-14 16:51:38python-devsetnosy: + python-dev
messages: + msg155766
2012-02-05 12:34:15eric.araujosetnosy: + eric.araujo
messages: + msg152682
2012-01-27 23:06:08terry.reedysetnosy: + georg.brandl
stage: test needed

versions: - Python 2.6, Python 3.1, Python 2.7, Python 3.2, Python 3.4
2012-01-23 03:38:16anacrolixcreate