summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-16 08:10:45 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-16 08:10:45 +0000
commitb23fc2511f18e931a58cf300080a7be88c5e8bfe (patch)
tree6a0941de57bd151f944e309944a4532e5c087cdb /tools
parent8159b9ee9ae0c0a81819a9ebd1e33b9308ed1e68 (diff)
downloadrockbox-b23fc2511f18e931a58cf300080a7be88c5e8bfe.tar.gz
rockbox-b23fc2511f18e931a58cf300080a7be88c5e8bfe.tar.bz2
rockbox-b23fc2511f18e931a58cf300080a7be88c5e8bfe.zip
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
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mkinfo.pl19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/mkinfo.pl b/tools/mkinfo.pl
index bc6421ffe5..c97ff68a4d 100755
--- a/tools/mkinfo.pl
+++ b/tools/mkinfo.pl
@@ -29,6 +29,23 @@ sub cmd1line {
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) {
print "Usage: mkinfo.pl <filename>\n";
exit;
@@ -50,6 +67,7 @@ printf O ("Version: %s\n", $ENV{'VERSION'});
printf O ("Binary: %s\n", $ENV{'BINARY'});
printf O ("Binary size: %s\n", filesize($ENV{'BINARY'}));
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
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'});
close(O);
-