mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: Some of the output from 'malloc-aggregation.d' trips up the 'stackdiff-dtrace.py' script -- especially when used with the output from recent 5.4 builds. The regex for numbers includes hex which trips us up when we try to convert that match to an int. Since we only use this pattern for matching allocation counts, where we don't expect hex, we can just modify the pattern. Also the input parsing is a little tricky to follow without context so I tidied it up little. Modifications: - relax the number regex (we don't expect counts to be in hex) - drop the stack regex (it wasn't used) - aggregate the current stack in a list (instead of a string) - filter out non-stack lines (which were erroneously used to key the first stack!) - a few comments Result: stackdiff-dtrace.py doesn't blow up on output from newer builds