Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
#113170 - 04/20/18 05:31 PM Re: Compile stats [Re: Golden Child]  
Joined: Feb 2014
Posts: 142
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member

Joined: Feb 2014
Posts: 142
Oh, and how does it perform using the nbd swap and ext file?


Limiting the memory to 512M with mem=512M on the linux boot parameter: (15 hours 8 minutes 45% cpu)


Code
INSPIRON_6400_COMPILE_NEW_DEBIAN93_NBD_SWAP_AND_EXT2_J4_WITH_512M.txt

50648   Compiling generated/mame/mame/drivlist.cpp...
50657   Linking mame...
54470   20060.38user 4745.05system 15:07:49elapsed 45%CPU (0avgtext+0avgdata 437428maxresident)k
54470   797521912inputs+4718016outputs (41895787major+169318284minor)pagefaults 0swaps
54470   DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:         509780 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Genuine Intel(R) CPU           T2500  @ 2.00GHz
================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877704 Apr 18 12:54 ./mame
================================================================================
EXECUTING: md5sum ./mame
edf1bf33710bd1d52c9720e69e66de7c  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
================================================================================





Boosting the memory back to 3GB but still using the nbd ext2: (2 hours 48 minutes 185% cpu)


Code
INSPIRON_6400_COMPILE_NEW_DEBIAN93_NBD_EXT2_J4_WITH_3GB_MEM.txt
================================

9986    Linking mame...
10078   17721.81user 967.77system 2:47:57elapsed 185%CPU (0avgtext+0avgdata 2447428maxresident)k
10078   2513320inputs+4609576outputs (34354major+157379289minor)pagefaults 0swaps
10078   DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:        3106596 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Genuine Intel(R) CPU           T2500  @ 2.00GHz
================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877704 Apr 18 22:11 ./mame
================================================================================
EXECUTING: md5sum ./mame
edf1bf33710bd1d52c9720e69e66de7c  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
================================================================================

#113185 - 04/21/18 11:02 PM Re: Compile stats [Re: Golden Child]  
Joined: Feb 2014
Posts: 142
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member

Joined: Feb 2014
Posts: 142
So why does the compiled binary md5sum and the file size change when you change the comple directory path?

Running strings on the mame binary shows the compile path embedded within:

Code
$ strings /mnt/c/mame194_extract/mame/mame | grep "/mnt/c"
/mnt/c/mame194_extract/mame/build/projects/sdl/mame/gmake-linux


and I couldn't understand why a diff would show that the png.pyc was different also, for the exact same reason:

Code
$ strings /mnt/c/mame194_extract/mame/scripts/build/png.pyc | grep "/mnt/c"
/mnt/c/mame194_extract/mame/scripts/build/png.pyt
/mnt/c/mame194_extract/mame/scripts/build/png.pyt
/mnt/c/mame194_extract/mame/scripts/build/png.pyt
/mnt/c/mame194_extract/mame/scripts/build/png.pyR
/mnt/c/mame194_extract/mame/scripts/build/png.pyR
/mnt/c/mame194_extract/mame/scripts/build/png.pyt
...

#113191 - 04/23/18 12:58 AM Re: Compile stats [Re: Golden Child]  
Joined: Feb 2014
Posts: 142
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member

Joined: Feb 2014
Posts: 142
So here's a question you've always wanted to know the answer to:

Inside of the mame binary, how many times does the word mame appear?

(from the mame194 binary)

Code
$ strings mame64 | grep -i mame | wc -l 
37062

#113192 - 04/23/18 01:35 AM Re: Compile stats [Re: Golden Child]  
Joined: Mar 2001
Posts: 15,933
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,933
USA
That seems high. What happens if it's a stripped binary with no debug symbols/symbol paths?

#113193 - 04/23/18 02:42 AM Re: Compile stats [Re: R. Belmont]  
Joined: Feb 2014
Posts: 142
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member

Joined: Feb 2014
Posts: 142
Yes, it's mostly probably symbol paths.

Code
$ strings mame64 | grep -i "src/mame" | wc -l
35717


So at least 35717 are symbol paths.

It's interesting to see all of the mame strings that aren't "src/mame" paths

Most of them are mangled function names.

Code
$ strings mame64 | grep -i "mame" |  grep -i -v "src/mame" | less

D$`mameH
MAME
MAMESAVEI
MAMESAVEUSH
MAMESAVEL
MAMESAVEH9D$ 
MAMESAVEH9D$ 
MAME
and the MAME team
http://mamedev.org
Copyright Nicola Salmoria and the MAME team
18object_finder_baseI19netlist_mame_deviceLb1EE
...

#113402 - 05/12/18 04:00 AM Re: Compile stats [Re: Golden Child]  
Joined: Feb 2014
Posts: 142
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member

Joined: Feb 2014
Posts: 142
For more silly fun I thought I'd try to compile mame with Debian 9.3 on just about every x86 pc that I own.


There was this old Pentium 3 933mhz that wanted to compile mame so badly but it only had 512mb ram.



So I did the NBD network block device thing and used another 16GB system on the network and gave it access to a 4GB ext2 file system and a 4GB swap file.

I forgot how I did it before, so I printed up my previous post and noticed I left out a couple of things:

I forgot to "sudo modprobe nbd" before I did the nbd-client command lines.

So:

Code
sudo modprobe nbd
sudo nbd-client  192.168.0.10 10809 /dev/nbd0 -N nbdfileswap -s
sudo nbd-client  192.168.0.10 10809 /dev/nbd1 -N nbdfileext2



Also I needed to chown the nbd-server export files or I'd get problems when I'd try to format them with mkswap

On the server system:

Code
sudo chown me:me /mnt/a/NBDFILESWAP
sudo chown me:me /mnt/a/NBDFILEEXT2


On the client system:

Code
sudo mkswap /dev/nbd0
sudo swapon /dev/nbd0 -p 1024

sudo mke2fs /dev/nbd1 -t ext4



And if I wanted to make my compiles have the same md5sum, they would have to have the same source directory name.

My compile directory name is : Downloads/mame194_extract/mame

So I took the mame194_extract directory and renamed it old_mame194_extract with

Code
cd Downloads
mv mame194_extract old_mame194_extract
mkdir mame194_extract


Now we can mount the /dev/nbd1 filesystem in the mame194_extract directory.

Code
sudo mount /dev/nbd1 mame194_extract -t ext4


and now we can copy the mame directory into the mounted spot.


I always seem to have problems with permissions so let's mkdir the mame directory and do some permissions fiddling.
(me represents my username)

when you do the sudo mount it will set the permissions of the mame194_extract directory to root, so lets see if we can take ownership back.

Code
sudo chown me:me mame194_extract
cd mame194_extract

sudo mkdir mame
sudo chown me:me mame
cp -r ../old_mame194_extract/mame mame


and to do the compile line:
Code
make clean; /usr/bin/time make -j1 2>&1 | lua5.3 lua_time.lua | tee MY_COMPILE_LOG.txt | nl



Everything ran great until the link phase where it crashed!!!! There was a strange kernel panic.

Code
90698   Building driver list...
90703   22746 driver(s) found
90703   Compiling generated/mame/mame/drivlist.cpp...
90737   Compiling generated/version.cpp...
90737   Linking mame...

*BOOM*


So after a reboot, I reconnected to the swap:
Code
sudo modprobe nbd
sudo nbd-client  192.168.0.10 10809 /dev/nbd0 -N nbdfileswap -s
sudo nbd-client  192.168.0.10 10809 /dev/nbd1 -N nbdfileext2

sudo swapon /dev/nbd0 -p 1024

cd Downloads
cd mame194_extract
cd mame

/usr/bin/time make -j1 2>&1 | tee MY_COMPILE_LOG_RESUME.txt | nl


and the compile looked good, matching my normal md5sum.
Code
0       GCC 6.3.0 detected
14      Linking mame...
2290    170.60user 297.71system 38:09.45elapsed 20%CPU (0avgtext+0avgdata 466176maxresident)k
2290    41853528inputs+604888outputs (3173985major+2168783minor)pagefaults 0swaps
2290    DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:         508552 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Pentium III (Coppermine)
================================================================================
EXECUTING: lscpu
Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 8
Model name:            Pentium III (Coppermine)
Stepping:              6
CPU MHz:               931.023
BogoMIPS:              1862.04
Flags:                 fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pse36 mmx fxsr sse eagerfpu
================================================================================
EXECUTING: md5sum ./mame
3ad480dbe397219dc37c40b82a97029d  ./mame


If we add 2290 to 90737 we get 93027 seconds = 1550 minutes = 25.84 hours

what kind of chip you got in there a Dorito?

Page 3 of 3 1 2 3

Moderated by  R. Belmont 

Who's Online Now
3 registered members (Olivier Galibert, drewcifer, Stick), 15 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,534
Posts111,540
Members4,793
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.067s Queries: 16 (0.025s) Memory: 4.9856 MB (Peak: 5.1800 MB) Zlib enabled. Server Time: 2018-05-22 15:53:27 UTC