flamegraph

Fork of flamegraph without J***S*****.
git clone git://git.laack.co/flamegraph.git
Log | Files | Refs | README

commit cb52be935989820f06e092f5bb415f1dc5da4a51
parent 90c194e6ac537b0fc4393abc9a7d778548242119
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date:   Sat, 27 Jun 2015 17:02:26 -0700

Merge pull request #53 from xmo-odoo/patch-1

Fix quoting in mouseover
Diffstat:
Mflamegraph.pl | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flamegraph.pl b/flamegraph.pl @@ -794,6 +794,7 @@ while (my ($id, $node) = each %Node) { $escaped_func =~ s/&/&amp;/g; $escaped_func =~ s/</&lt;/g; $escaped_func =~ s/>/&gt;/g; + $escaped_func =~ s/"/&quot;/g; unless (defined $delta) { $info = "$escaped_func ($samples_txt $countname, $pct%)"; } else { @@ -805,8 +806,10 @@ while (my ($id, $node) = each %Node) { } my $nameattr = { %{ $nameattr{$func}||{} } }; # shallow clone + my $jsinfo = $info; + $jsinfo =~ s/'/\\'/g; $nameattr->{class} ||= "func_g"; - $nameattr->{onmouseover} ||= "s('".$info."')"; + $nameattr->{onmouseover} ||= "s('".$jsinfo."')"; $nameattr->{onmouseout} ||= "c()"; $nameattr->{onclick} ||= "zoom(this)"; $nameattr->{title} ||= $info;