Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) #!/usr/bin/env perl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) # Copyright 2008, Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) # This file is part of the Linux kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) # Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) # 	Arjan van de Ven <arjan@linux.intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) # This script turns a dmesg output into a SVG graphic that shows which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) # functions take how much time. You can view SVG graphics with various
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) # programs, including Inkscape, The Gimp and Firefox.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) # For this script to work, the kernel needs to be compiled with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) # CONFIG_PRINTK_TIME configuration option enabled, and with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) # "initcall_debug" passed on the kernel command line.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) # usage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) # 	dmesg | perl scripts/bootgraph.pl > output.svg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) use strict;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) use Getopt::Long;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) my $header = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) sub help {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	my $text = << "EOM";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) Usage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 1) dmesg | perl scripts/bootgraph.pl [OPTION] > output.svg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 2) perl scripts/bootgraph.pl -h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) Options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	-header	Insert kernel version and date
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) EOM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	my $std=shift;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	if ($std == 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		print STDERR $text;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		print $text;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) GetOptions(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	'h|help'	=>\&help,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	'header'	=>\$header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) my %start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) my %end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) my %type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) my $done = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) my $maxtime = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) my $firsttime = 99999;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) my $count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) my %pids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) my %pidctr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) my $headerstep = 20;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) my $xheader = 15;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) my $yheader = 25;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) my $cyheader = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) while (<>) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	my $line = $_;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	if ($line =~ /([0-9\.]+)\] calling  ([a-zA-Z0-9\_\.]+)\+/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		my $func = $2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		if ($done == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 			$start{$func} = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 			$type{$func} = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 			if ($1 < $firsttime) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 				$firsttime = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		if ($line =~ /\@ ([0-9]+)/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			$pids{$func} = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		$count = $count + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	if ($line =~ /([0-9\.]+)\] async_waiting @ ([0-9]+)/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		my $pid = $2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		my $func;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		if (!defined($pidctr{$pid})) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 			$func = "wait_" . $pid . "_1";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 			$pidctr{$pid} = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 			$pidctr{$pid} = $pidctr{$pid} + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 			$func = "wait_" . $pid . "_" . $pidctr{$pid};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		if ($done == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			$start{$func} = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			$type{$func} = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 			if ($1 < $firsttime) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 				$firsttime = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		$pids{$func} = $pid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		$count = $count + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_\.]+)\+.*returned/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		if ($done == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 			$end{$2} = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			$maxtime = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	if ($line =~ /([0-9\.]+)\] async_continuing @ ([0-9]+)/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		my $pid = $2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		my $func =  "wait_" . $pid . "_" . $pidctr{$pid};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		$end{$func} = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		$maxtime = $1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	if ($line =~ /Write protecting the/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		$done = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if ($line =~ /Freeing unused kernel memory/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		$done = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) if ($count == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)     print STDERR <<END;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) No data found in the dmesg. Make sure that 'printk.time=1' and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 'initcall_debug' are passed on the kernel command line.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	help(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)     exit 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) print "<?xml version=\"1.0\" standalone=\"no\"?> \n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) if ($header) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	my $version = `uname -a`;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	my $date = `date`;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	print "<text transform=\"translate($xheader,$yheader)\">Kernel version: $version</text>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	$cyheader = $yheader+$headerstep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	print "<text transform=\"translate($xheader,$cyheader)\">Date: $date</text>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) my @styles;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) $styles[0] = "fill:rgb(0,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) $styles[1] = "fill:rgb(0,255,0);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) $styles[2] = "fill:rgb(255,0,20);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) $styles[3] = "fill:rgb(255,255,20);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) $styles[4] = "fill:rgb(255,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) $styles[5] = "fill:rgb(0,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) $styles[6] = "fill:rgb(0,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) $styles[7] = "fill:rgb(0,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) $styles[8] = "fill:rgb(255,0,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) my $style_wait = "fill:rgb(128,128,128);fill-opacity:0.5;stroke-width:0;stroke:rgb(0,0,0)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) my $mult = 1950.0 / ($maxtime - $firsttime);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) my $threshold2 = ($maxtime - $firsttime) / 120.0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) my $threshold = $threshold2/10;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) my $stylecounter = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) my %rows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) my $rowscount = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) foreach my $key (@initcalls) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	my $duration = $end{$key} - $start{$key};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	if ($duration >= $threshold) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		my ($s, $s2, $s3, $e, $w, $y, $y2, $style);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		my $pid = $pids{$key};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		if (!defined($rows{$pid})) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 			$rows{$pid} = $rowscount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 			$rowscount = $rowscount + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		$s = ($start{$key} - $firsttime) * $mult;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		$s2 = $s + 6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		$s3 = $s + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		$e = ($end{$key} - $firsttime) * $mult;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		$w = $e - $s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		$y = $rows{$pid} * 150;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		$y2 = $y + 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		$style = $styles[$stylecounter];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		$stylecounter = $stylecounter + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		if ($stylecounter > 11) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 			$stylecounter = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		if ($type{$key} == 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 			$y = $y + 15;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 			print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"115\" style=\"$style_wait\"/>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 			print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 			if ($duration >= $threshold2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 				print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 				print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) # print the time line on top
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) my $time = $firsttime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) my $step = ($maxtime - $firsttime) / 15;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) while ($time < $maxtime) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	my $s3 = ($time - $firsttime) * $mult;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	my $tm = int($time * 100) / 100.0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	$time = $time + $step;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) print "</svg>\n";