forked from len0rd/rockbox
Added a "RAM usage:" line to rockbox-info.txt which basically says how large
portion of ram this rockbox occupies. The info is extracted from the map file, end - loadaddress. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14366 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8159b9ee9a
commit
b23fc2511f
1 changed files with 18 additions and 1 deletions
|
@ -29,6 +29,23 @@ sub cmd1line {
|
||||||
return $out[0];
|
return $out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub mapscan {
|
||||||
|
my ($f)=@_;
|
||||||
|
my $start, $end;
|
||||||
|
open(M, "<$f");
|
||||||
|
while(<M>) {
|
||||||
|
if($_ =~ / +0x([0-9a-f]+) *_end = \./) {
|
||||||
|
$end = $1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
elsif($_ =~ / +0x([0-9a-f]+) *_loadaddress = \./) {
|
||||||
|
$start = $1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# return number of bytes
|
||||||
|
return hex($end) - hex($start);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$output) {
|
if(!$output) {
|
||||||
print "Usage: mkinfo.pl <filename>\n";
|
print "Usage: mkinfo.pl <filename>\n";
|
||||||
exit;
|
exit;
|
||||||
|
@ -50,6 +67,7 @@ printf O ("Version: %s\n", $ENV{'VERSION'});
|
||||||
printf O ("Binary: %s\n", $ENV{'BINARY'});
|
printf O ("Binary: %s\n", $ENV{'BINARY'});
|
||||||
printf O ("Binary size: %s\n", filesize($ENV{'BINARY'}));
|
printf O ("Binary size: %s\n", filesize($ENV{'BINARY'}));
|
||||||
printf O ("Actual size: %s\n", filesize("apps/rockbox.bin"));
|
printf O ("Actual size: %s\n", filesize("apps/rockbox.bin"));
|
||||||
|
printf O ("RAM usage: %s\n", mapscan("apps/rockbox.map"));
|
||||||
|
|
||||||
# Variables identifying tool and build environment details
|
# Variables identifying tool and build environment details
|
||||||
printf O ("gcc: %s\n", cmd1line("$ENV{'CC'} --version"));
|
printf O ("gcc: %s\n", cmd1line("$ENV{'CC'} --version"));
|
||||||
|
@ -58,4 +76,3 @@ printf O ("Host gcc: %s\n", cmd1line("$ENV{'HOSTCC'} --version"));
|
||||||
printf O ("Host system: %s\n", $ENV{'UNAME'});
|
printf O ("Host system: %s\n", $ENV{'UNAME'});
|
||||||
|
|
||||||
close(O);
|
close(O);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue