Bug 56378 - Enhancement: New Script to Format malloc_history output as tree
Summary: Enhancement: New Script to Format malloc_history output as tree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P3 Enhancement
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 08:35 PDT by Michael Saboff
Modified: 2011-06-18 12:25 PDT (History)
1 user (show)

See Also:


Attachments
New script to process malloc_history output to tree format (7.89 KB, patch)
2011-03-15 08:47 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2011-03-15 08:35:48 PDT
Add a script to process the output from MacOS malloc_history output to hierarchical tree format.
Comment 1 Michael Saboff 2011-03-15 08:47:29 PDT
Created attachment 85812 [details]
New script to process malloc_history output to tree format
Comment 2 Eric Seidel (no email) 2011-03-18 14:57:45 PDT
Comment on attachment 85812 [details]
New script to process malloc_history output to tree format

View in context: https://bugs.webkit.org/attachment.cgi?id=85812&action=review

This seems OK.  It's written as a one-off w/o much re-use in mind, which is kinda the opposite of how I try to write python. :)  I think this could use another round of cleanup to make this more hackable for others in the future.

I'm glad you're adding this though. :)

> Tools/Scripts/malloc-tree:60
> +

I think pep8 says two spaces between globals, but I could be wrong.

> Tools/Scripts/malloc-tree:102
> +    def printNode(self, prefix = ' '):
> +        global hotspot
> +        global scaleSize
> +        global showBars

Seems this could just take an options object instead of using globals.

> Tools/Scripts/malloc-tree:137
> +def main():

I would have broken this up into smaller functions.

> Tools/Scripts/malloc-tree:163
> +        if hotspot:
> +            scaleSize = False
> +        else:
> +            scaleSize = True

Seems long-winded.
Comment 3 Eric Seidel (no email) 2011-04-28 11:41:57 PDT
Comment on attachment 85812 [details]
New script to process malloc_history output to tree format

In general this is fine.  We should land this and iterate.
Comment 4 WebKit Review Bot 2011-06-18 12:25:00 PDT
Comment on attachment 85812 [details]
New script to process malloc_history output to tree format

Clearing flags on attachment: 85812

Committed r89195: <http://trac.webkit.org/changeset/89195>
Comment 5 WebKit Review Bot 2011-06-18 12:25:04 PDT
All reviewed patches have been landed.  Closing bug.