From 2c3056b6a44d7068de65977fa11ee7c5fd9c7ffd Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 6 Dec 2015 16:24:20 -0500 Subject: [PATCH] Support floating point numbers in instruments CSV When I generate Instruments data with the sample interval set to 40 microseconds instead of 1 ms and then export the data, I get Self values that are sometimes floating point fractional numbers of ms. Modify the regex to account for the potential of these numbers. --- stackcollapse-instruments.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackcollapse-instruments.pl b/stackcollapse-instruments.pl index 00ecfb32..fb017b9a 100755 --- a/stackcollapse-instruments.pl +++ b/stackcollapse-instruments.pl @@ -14,7 +14,7 @@ <>; foreach (<>) { chomp; - /\d+\.\d+ms[^,]+,(\d+),\s+,(\s*)(.+)/ or die; + /\d+\.\d+ms[^,]+,(\d+(?:\.\d*)?),\s+,(\s*)(.+)/ or die; my $func = $3; my $depth = length ($2); $stack [$depth] = $3;