Title: [137666] trunk/Tools
- Revision
- 137666
- Author
- e...@webkit.org
- Date
- 2012-12-13 15:30:51 -0800 (Thu, 13 Dec 2012)
Log Message
Make --profile output easier to understand for pprof on linux
https://bugs.webkit.org/show_bug.cgi?id=104957
Reviewed by Dirk Pranke.
pprof is kinda mysterious, so we print some information
on how to use it, and how to learn how to read the sample dump.
This is similar to what we've done for perf output for Chromium Android.
* Scripts/webkitpy/common/system/profiler.py:
(GooglePProf._pprof_path):
(GooglePProf.profile_after_exit):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (137665 => 137666)
--- trunk/Tools/ChangeLog 2012-12-13 23:28:12 UTC (rev 137665)
+++ trunk/Tools/ChangeLog 2012-12-13 23:30:51 UTC (rev 137666)
@@ -1,3 +1,18 @@
+2012-12-13 Eric Seidel <e...@webkit.org>
+
+ Make --profile output easier to understand for pprof on linux
+ https://bugs.webkit.org/show_bug.cgi?id=104957
+
+ Reviewed by Dirk Pranke.
+
+ pprof is kinda mysterious, so we print some information
+ on how to use it, and how to learn how to read the sample dump.
+ This is similar to what we've done for perf output for Chromium Android.
+
+ * Scripts/webkitpy/common/system/profiler.py:
+ (GooglePProf._pprof_path):
+ (GooglePProf.profile_after_exit):
+
2012-12-13 Dirk Pranke <dpra...@chromium.org>
Revert r137407 - it didn't actually work right.
Modified: trunk/Tools/Scripts/webkitpy/common/system/profiler.py (137665 => 137666)
--- trunk/Tools/Scripts/webkitpy/common/system/profiler.py 2012-12-13 23:28:12 UTC (rev 137665)
+++ trunk/Tools/Scripts/webkitpy/common/system/profiler.py 2012-12-13 23:30:51 UTC (rev 137666)
@@ -94,19 +94,25 @@
match = re.search("^Total:[^\n]*\n((?:[^\n]*\n){0,10})", pprof_output, re.MULTILINE)
return match.group(1) if match else None
- def profile_after_exit(self):
+ def _pprof_path(self):
# FIXME: We should have code to find the right google-pprof executable, some Googlers have
# google-pprof installed as "pprof" on their machines for them.
- # FIXME: Similarly we should find the right perl!
+ return '/usr/bin/google-pprof'
+ def profile_after_exit(self):
# google-pprof doesn't check its arguments, so we have to.
if not (self._host.filesystem.exists(self._output_path)):
print "Failed to gather profile, %s does not exist." % self._output_path
return
- pprof_args = ['/usr/bin/perl', '/usr/bin/google-pprof', '--text', self._executable_path, self._output_path]
+ pprof_args = [self._pprof_path(), '--text', self._executable_path, self._output_path]
profile_text = self._host.executive.run_command(pprof_args)
+ print "First 10 lines of pprof --text:"
print self._first_ten_lines_of_profile(profile_text)
+ print "http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html documents output."
+ print
+ print "To interact with the the full profile, including produce graphs:"
+ print ' '.join([self._pprof_path(), self._executable_path, self._output_path])
class Sample(SingleFileOutputProfiler):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes