Skip to content

Commit

Permalink
Merge pull request #26 from agentzh/encoding
Browse files Browse the repository at this point in the history
Add --encoding option to flamegraph.pl
  • Loading branch information
brendangregg committed Jan 5, 2014
2 parents d9d56df + eb471ab commit 354cdc8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flamegraph.pl
Expand Up @@ -70,6 +70,7 @@
use Getopt::Long;

# tunables
my $encoding;
my $fonttype = "Verdana";
my $imagewidth = 1200; # max width, pixels
my $frameheight = 16; # max height is dynamic
Expand All @@ -94,6 +95,7 @@
'fonttype=s' => \$fonttype,
'width=i' => \$imagewidth,
'height=i' => \$frameheight,
'encoding=s' => \$encoding,
'fontsize=f' => \$fontsize,
'fontwidth=f' => \$fontwidth,
'minwidth=f' => \$minwidth,
Expand Down Expand Up @@ -158,8 +160,12 @@

sub header {
my ($self, $w, $h) = @_;
my $enc_attr = '';
if (defined $encoding) {
$enc_attr = qq{ encoding="$encoding"};
}
$self->{svg} .= <<SVG;
<?xml version="1.0" standalone="no"?>
<?xml version="1.0"$enc_attr standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" width="$w" height="$h" onload="init(evt)" viewBox="0 0 $w $h" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
SVG
Expand Down

0 comments on commit 354cdc8

Please sign in to comment.