Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --encoding option to flamegraph.pl #26

Merged
merged 1 commit into from Jan 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion flamegraph.pl
Expand Up @@ -70,6 +70,7 @@
use Getopt::Long; use Getopt::Long;


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


sub header { sub header {
my ($self, $w, $h) = @_; my ($self, $w, $h) = @_;
my $enc_attr = '';
if (defined $encoding) {
$enc_attr = qq{ encoding="$encoding"};
}
$self->{svg} .= <<SVG; $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"> <!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 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 SVG
Expand Down