Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Compile stats #111011
10/09/17 09:46 PM
10/09/17 09:46 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
So it's fun to know how long and how many resources a compile takes:

I'm using ubuntu 17.04.

you can use the shell's built in time command

time make -j4

and that will put out something like:

time make -j4
GCC 6.3.0 detected
Compiling src/emu/natkeyboard.cpp...
Archiving libemu.a...
Linking mame64...

real 0m20.428s
user 0m18.012s
sys 0m2.448s

but how much memory does it take?

let's use /usr/bin/time

/usr/bin/time make -j4
GCC 6.3.0 detected
Compiling src/emu/natkeyboard.cpp...
Archiving libemu.a...
Linking mame64...
18.06user 2.48system 0:27.43elapsed 74%CPU (0avgtext+0avgdata 1705048maxresident)k
104176inputs+560208outputs (1146major+1002703minor)pagefaults 0swaps

and if you want a verbose output use

/usr/bin/time --verbose make -j4

and for a full make of mame 0190 on a Intel Core i3-3220 CPU @ 3.30GHz × 4 takes about 55 minutes.

/usr/bin/time --verbose make -j4
GCC 6.3.0 detected
...
Compiling src/mame/mame.cpp...
Compiling generated/version.cpp...
Building driver list...
34618 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
Command being timed: "make -j4"
User time (seconds): 11907.65
System time (seconds): 557.14
Percent of CPU this job got: 376%
Elapsed (wall clock) time (h:mm:ss or m:ss): 55:08.90
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2241060
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1547
Minor (reclaiming a frame) page faults: 221300921
Voluntary context switches: 385912
Involuntary context switches: 1218757
Swaps: 0
File system inputs: 472136
File system outputs: 5079616
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Re: Compile stats [Re: Golden Child] #111012
10/10/17 01:40 AM
10/10/17 01:40 AM
Joined: Feb 2004
Posts: 2,012
Sydney, Australia
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,012
Sydney, Australia
luaengine.cpp is the killer - why not profile that? wink

Re: Compile stats [Re: Vas Crabb] #111021
10/10/17 01:00 PM
10/10/17 01:00 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
How do I profile luaengine.cpp?



full compile latest git pull on an Intel Core i5 CPU 750 @ 2.67GHz x 4 cores takes 43 minutes

make clean
/usr/bin/time --verbose make -j4
GCC 6.3.0 detected
...
Building driver list...
34621 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
Command being timed: "make -j4"
User time (seconds): 8749.88
System time (seconds): 509.38
Percent of CPU this job got: 358%
Elapsed (wall clock) time (h:mm:ss or m:ss): 42:59.68
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2235824
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 7201
Minor (reclaiming a frame) page faults: 221822793
Voluntary context switches: 401964
Involuntary context switches: 1496542
Swaps: 0
File system inputs: 1993784
File system outputs: 5175168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
stepping : 5
microcode : 0x7
cpu MHz : 2799.000
cache size : 8192 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm ida
bugs :
bogomips : 5320.30
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

Re: Compile stats [Re: Golden Child] #111225
11/03/17 12:37 AM
11/03/17 12:37 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
For fun, I dug out my old Toshiba Laptop with a 32 bit processor to see how mame would do a full compile with Ubuntu 16.04 LTS.

Genuine Intel® CPU U2500 @ 1.20GHz × 2
32 bit
2.0 GiB
Ubuntu 16.04 LTS
compiling mame191

I fell asleep waiting and the computer went to sleep due to inactivity, but it said about 5 hours of elapsed time. I would guess somewhere around 3 hours since 21997 cpu seconds/ 2 cores/ 3600 seconds per hour = 3.05 hours.

Code
/usr/bin/time make -j3
GCC 5.4.0 detected
...
Compiling src/mame/mame.cpp...
Compiling generated/version.cpp...
Building driver list...
34653 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame...
21997.50user 1333.74system 5:04:54elapsed 127%CPU (0avgtext+0avgdata 1276864maxresident)k
3508360inputs+4227088outputs (8822major+151301401minor)pagefaults 0swaps



My cool discovery of the day is the -verbose option where it will tell you all about the compiler settings used to build mame.
Code
./mame pacman -rompath ../../mameroms/ -video opengl -verbose
Available videodrivers: x11 mir wayland dummy 
Current Videodriver: x11
	Display #0
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
Available audio drivers: 
	pulseaudio          
	alsa                
	sndio               
	dsp                 
	disk                
	dummy               
Build version:      0.191 (unknown)
Build architecure:  
Build defines 1:    SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 
Build defines 1:    LSB_FIRST=1 
SDL/OpenGL defines: SDL_COMPILEDVERSION=2004 USE_OPENGL=1 
Compiler defines A: __GNUC__=5 __GNUC_MINOR__=4 __GNUC_PATCHLEVEL__=0 __VERSION__="5.4.0 20160609" 
Compiler defines B: __unix__=1 __i386__=1 
Compiler defines C: __USE_FORTIFY_LEVEL=0 
Enter init_monitors
Adding monitor screen0 (1280 x 800)
Leave init_monitors
Enter sdlwindow_init
Using SDL multi-window OpenGL driver (SDL 2.0+)
... <snip>

GL texture: copy 1, shader 0, dynamic 1, 288x224 288x224 [PALETTE16, Equal: 0, Palette: 1,
            scale 1x1, border 0, pitch 384,288/2048], bytes/pix 4
GL texture: copy 1, shader 0, dynamic 1, 288x224 288x224 [PALETTE16, Equal: 0, Palette: 1,
            scale 1x1, border 0, pitch 384,288/2048], bytes/pix 4
Average speed: 100.00% (7 seconds)
sdl_kill: closing audio
Enter sdlwindow_exit
Leave sdlwindow_exit

Re: Compile stats [Re: Vas Crabb] #111344
11/23/17 05:18 PM
11/23/17 05:18 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
Originally Posted by Vas Crabb
luaengine.cpp is the killer - why not profile that? wink


Ok, if I make any change to luaengine.cpp (even just typing a space character) or enabling SOL_CHECK_ARGUMENTS for example:

Code
#define SOL_CHECK_ARGUMENTS
#include "sol2/sol.hpp"

Let's see how long it takes to re-compile and link,
Code
time make -j5
GCC 7 detected
Compiling src/frontend/mame/luaengine.cpp...
Compiling src/frontend/mame/clifront.cpp...
Compiling src/frontend/mame/mame.cpp...
Compiling src/frontend/mame/ui/datmenu.cpp...
Compiling src/frontend/mame/ui/mainmenu.cpp...
Compiling src/frontend/mame/ui/pluginopt.cpp...
Compiling src/frontend/mame/ui/selgame.cpp...
Compiling src/frontend/mame/ui/selmenu.cpp...
Compiling src/frontend/mame/ui/selsoft.cpp...
Compiling src/frontend/mame/ui/ui.cpp...
Archiving libfrontend.a...
Linking mame64...

real	2m2.940s
user	2m21.165s
sys	0m6.695s


Code
cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 3292.334

Re: Compile stats [Re: Golden Child] #112227
01/19/18 02:25 AM
01/19/18 02:25 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
I got an i7-2600 system and thought I'd give it a go compiling mame 193. It only took 29 minutes... whee!

Code
~/Downloads/mame193_extract/mame$ /usr/bin/time make -j8
GCC 7 detected
...
34845 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
11973.80user 662.42system 29:32.70elapsed 712%CPU (0avgtext+0avgdata 2337696maxresident)k
2545752inputs+5575944outputs (12333major+234574396minor)pagefaults 0swaps

~/Downloads/mame193_extract/mame$ lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               42
Model name:          Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Stepping:            7
CPU MHz:             3392.293
CPU max MHz:         3800.0000
CPU min MHz:         1600.0000
BogoMIPS:            6784.58
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            8192K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts

Re: Compile stats [Re: Golden Child] #112233
01/19/18 01:46 PM
01/19/18 01:46 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
Golden Child: I thought you'd find this interesting:

https://www.ebay.com/itm/VDP-1000-board-for-CP-M-Turbo-7-Run-SG-1000-Some-Colecovision-games-on-APPLE-II/282518811724?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D2%26asc%3D47300%26meid%3Db377bd165ced41c2b2404240b204bb3b%26pid%3D100623%26rk%3D3%26rkt%3D6%26sd%3D282645562451&_trksid=p2047675.c100623.m-1

It's an daughtercard for a specific (modern) Apple II Z80 board that adds the TMS9928 VDP and SN76489A sound chip at the right Z80 I/O ports so you can run unmodified SG-1000 and some Colecovision games. Genius idea, I'll emulate it in MAME soon smile

Re: Compile stats [Re: R. Belmont] #112282
01/23/18 01:22 AM
01/23/18 01:22 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
Hey RB,

Oh yeah! That's really cool. Can't wait!



If it helps, I came across a manual for the VDP-1000.

http://quick09.tistory.com/attachment/cfile9.uf@245A6F405957414B121465.pdf

and he's got some posts on his website:


http://quick09.tistory.com/category/%E2%97%86%20My%20Z80%20Card


The fusion of Apple and MSX. I wonder why MS never did an add-in MSX card for the apple II.

Ian Kim's also got an ApMSX card that he's working on.






And check this prototype out: A dual ti9929 video card!

[Linked Image]

http://a2central.com/category/its-a-hack/
http://a2central.com/7211/another-p...ice-monupet-ti-d-vdp9929a-graphics-card/

Re: Compile stats [Re: Golden Child] #112286
01/23/18 10:55 AM
01/23/18 10:55 AM
Joined: Jul 2007
Posts: 215
California
M
Monotremata Offline
Senior Member
Monotremata  Offline
Senior Member
M
Joined: Jul 2007
Posts: 215
California
Hah "Man The Goonies sucks, Im gonna go play Ultima 4." Is the MSX the expansion card thats too big for the case? Whats the Apple doing just power?

Re: Compile stats [Re: Golden Child] #112289
01/23/18 12:58 PM
01/23/18 12:58 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
The Apple also uploads the Z80 code to run and provides the keyboard.

Re: Compile stats [Re: Golden Child] #112303
01/23/18 10:25 PM
01/23/18 10:25 PM
Joined: Jul 2007
Posts: 215
California
M
Monotremata Offline
Senior Member
Monotremata  Offline
Senior Member
M
Joined: Jul 2007
Posts: 215
California
Ahh gotcha! Other than running Ultima its hard to tell whats he's doing on the Apple before firing it up.

Re: Compile stats [Re: Golden Child] #112495
02/05/18 11:59 AM
02/05/18 11:59 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
Some more silly compiling fun...

I am so enamored with lua that I thought, why not install ubuntu's lua so I can write lua scripts outside of mame.

After a "sudo apt-get install lua5.3" I can run a lua interpreter from a regular bash shell.

One of the things I like is to see what the progress is for a compile.

So why don't we pipe the output from a make to a lua script and add the seconds for fun:

This is a really simple one liner. We just get the current time and then read a line, and check the time.

Then we print the time since the compile started and then the line that was read.

Let's call it "lua_time.lua"
Code
l = os.time() while true do j = io.read() k = os.time() if j == nil then break else print(k-l, j) end end


You can try this code in the lua interpreter by launching the interpreter with "lua5.3" and then pasting the line.

Type a few test lines to see what happens.

Code
lua5.3
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> l = os.time() while true do j = io.read() k = os.time() if j == nil then break else print(k-l, j) end end
hey
3	hey
this
5	this
works
9	works
> 


I press CTRL+D to signal the end of input and the while loop drops out since it reads nil.

Another CTRL+D will drop out of the lua interpreter.

Ok, so now we've seen that our one liner works. So let's see it in action:

Our command will be: "make -j4 | lua5.3 lua_time.lua | tee luatimemake.txt"


Code
~/Downloads/mame194_extract/mame$ make clean
GCC 7 detected
Cleaning genie
Cleaning...
make[1]: Entering directory '/home/customer/Downloads/mame194_extract/mame/src/devices/cpu/m68000'
Cleaning...
make[1]: Leaving directory '/home/customer/Downloads/mame194_extract/mame/src/devices/cpu/m68000'


~/Downloads/mame194_extract/mame$ make -j4 | lua5.3 lua_time.lua | tee luatimemake2.txt
0	GCC 7 detected
0	Creating obj/Release
0	Creating obj/Release/src/host
0	Creating obj/Release/src/host/lua-5.3.0/src
0	lapi.c
1	lauxlib.c
1	lbaselib.c
1	Converting src/mame/drivers/ymmu100.ppm...
2	make[1]: Entering directory '/home/customer/Downloads/mame194_extract/mame/src/devices/cpu/m68000'
4	lbitlib.c
4	lcode.c
4	lcorolib.c
4	Linking m68kmake...
5	lctype.c
5	ldblib.c
...etc


So after a run, we've got a file that has a log of the compile run with a time at the beginning of each line.

Let's write a little routine that opens that file, and reads it into a table where the keys are each line of the compiler output and the value is a table with two entries, the line number of the output and the time since the beginning of the compile:

Let's call this file: "lua_checktime_simple.lua".

We just match the line with the pattern (.+)\t(.+) which gets us two items separated by a tab character, and these get returned as a table since we wrap it in braces {}. We read a line into g, then set h = {"g:match("(.+)\t(.+)")}. h[1] will be the time, h[2] will be the compiler output line.

Then we make a new table using the compiler output line as the key with t[h[2]] = {}.

t[h[2]][1] = linenum sets the first entry to the current line number
t[h[2]][2] = h[1] sets the second entry to the time that we got from the match.

Code
function formattime(a) local min,sec = math.modf(a/60) return min..":"..string.format("%02.0f",sec*60) end

f = io.open("luatimemake.txt","rb")

linenum = 0
t = {} f:seek("set") g = f:read() while g ~= nil do h = {g:match("(.+)\t(.+)")} maxval = tonumber(h[1]) linenum = linenum + 1 if h[2] ~= nil then t[h[2]]={} t[h[2]][1]=linenum t[h[2]][2]=tonumber(h[1]) end g = f:read() end

itemcount = 0
for a,b in pairs(t) do itemcount = itemcount + 1 end
print("TOTAL ITEMS:" .. itemcount)

newcount = 0


starttime = os.time()


while true do

newline = io.read()
newcount = newcount + 1
if newline == nil then break end
newlinetime = os.time() - starttime
if t[newline] ~= nil then oldlinetime = t[newline][2] else oldlinetime = nil end

print (newline)

if oldlinetime == nil then print("*** line not found *** NEW >>> "..newline) else print("OLDTIME = " .. formattime(oldlinetime).." "..oldlinetime .. " NEWTIME = " .. formattime(newlinetime).." ".. newlinetime .. " COMPARISON = " .. string.format("%2.1f",(oldlinetime / newlinetime)*100) .."% ".. " ITEMCOUNT = " .. newcount .."/"..itemcount) end
end


And if we invoke this with: "make -j4 | lua5.3 lua_checktime_simple.lua"

Code
~/Downloads/mame194_extract/mame$ make -j4 | lua5.3 lua_checktime_simple.lua 
TOTAL ITEMS:8514
GCC 7 detected
OLDTIME = 0:00 0 NEWTIME = 0:00 0 COMPARISON = -nan%  ITEMCOUNT = 1/8514
Creating obj/Release
OLDTIME = 0:00 0 NEWTIME = 0:00 0 COMPARISON = -nan%  ITEMCOUNT = 2/8514
Creating obj/Release/src/host
OLDTIME = 0:00 0 NEWTIME = 0:00 0 COMPARISON = -nan%  ITEMCOUNT = 3/8514
Creating obj/Release/src/host/lua-5.3.0/src
OLDTIME = 0:00 0 NEWTIME = 0:00 0 COMPARISON = -nan%  ITEMCOUNT = 4/8514
lapi.c
OLDTIME = 0:00 0 NEWTIME = 0:00 0 COMPARISON = -nan%  ITEMCOUNT = 5/8514
lauxlib.c
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 6/8514
lbitlib.c
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 7/8514
lbaselib.c
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 8/8514
Converting src/mame/drivers/ymmu100.ppm...
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 9/8514
lcode.c
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 10/8514
lcorolib.c
OLDTIME = 0:00 0 NEWTIME = 0:01 1 COMPARISON = 0.0%  ITEMCOUNT = 11/8514
lctype.c
OLDTIME = 0:01 1 NEWTIME = 0:01 1 COMPARISON = 100.0%  ITEMCOUNT = 12/8514
ldblib.c
OLDTIME = 0:01 1 NEWTIME = 0:01 1 COMPARISON = 100.0%  ITEMCOUNT = 13/8514
ldebug.c
OLDTIME = 0:01 1 NEWTIME = 0:01 1 COMPARISON = 100.0%  ITEMCOUNT = 14/8514



Now I can load this baseline compiler log on another system and compare the cpu speed.

Just some silly fun...

Re: Compile stats [Re: Golden Child] #112579
02/11/18 05:57 PM
02/11/18 05:57 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
I wanted a progress bar when I compile so I added that, along with a "dog bark" to tell me when it's done:

Once you've made a reference file in "luatimemake.txt" you get a nice progress bar.

make -j4 | lua5.3 compile_progress.lua


Code
-- compile_progress.lua


function dogbark() for i = 1,5 do os.execute("play -q /usr/share/sounds/gnome/default/alerts/bark.ogg") end end
-- for dogbark to work you have to "sudo apt install sox"
dogbark()

function formattime(a) local min,sec = math.modf(a/60) return min..":"..string.format("%02.0f",sec*60) end

f = io.open("luatimemake.txt","rb")
fileout = io.open("luacompareoutput.txt","w")

function progressbar(size,fraction)
local numbars = math.floor((size-2)*(fraction))
local fracpart = ((size-2)*fraction)-numbars
--local onechar = string.sub("01234567890",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
--local onechar = string.sub(".,;:-=+\\|/*#",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
  local onechar = string.sub(".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",math.floor(fracpart*53)+1,math.floor(fracpart*53)+1)
local numremain = (size-2)-numbars
if numbars >= size - 2 then onechar = "" end
  return "["..string.rep("#",numbars)..onechar..string.rep(".",numremain-string.len(onechar)).."]".." "..string.format("%6.2f%%",100*fraction) --..fracpart..numbars
end

-- for i =0,100,0.5 do print (i,progressbar(80,i/100),progressbar(10,i/100)) end

function pprint(a) fileout:write(a .. "\n") print(a) end
function printt(t) for a,b in pairs(t) do print (a,b) end end

function dumpstring(a) for k = 1,string.len(a) do print (k,string.format("%3d",string.byte(a,k)).." "..string.sub(a,k,k)) end end

function add_to_table_and_check_duplicate(linestr,timeval,t,linenum)
local linestr2
if linestr ~= nil then
-- print(linestr) 
  if t[linestr]~= nil then 
    t[linestr]["count"] = t[linestr]["count"]+1  
    linestr2 = linestr .. "<DUPLICATE LINE NUM=" .. t[linestr]["count"]..">" print(linestr) 
  end
  if t[linestr]==nil then t[linestr] ={linenum=linenum,timeval=tonumber(timeval),count=1 }
                     else t[linestr2]={linenum=linenum,timeval=tonumber(timeval),count=1 }
                        pprint ("Original at "..t[linestr]["linenum"].." Duplicate at "..linenum..":\""..linestr2.."\" origtime = "..t[linestr]["timeval"].." newtime = "..timeval) 
  end 
end 
if linestr2 ~= nil then return linestr2 else return linestr end
end

linenum = 0

arun_table = {} f:seek("set") g = f:read() 
while g ~= nil do 
timeval,linestr = g:match("(.-)\t(.*)") 

maxval = tonumber(timeval) 
linenum = linenum + 1 

add_to_table_and_check_duplicate(linestr,timeval,arun_table,linenum)

g = f:read() end

aitemcount = 0
for a,b in pairs(arun_table) do aitemcount = aitemcount + 1 end
print("TOTAL ITEMS:" .. aitemcount)

newcount = 0

brun_table = {}

starttime = os.time()

while true do

newline = io.read()
newcount = newcount + 1
if newline == nil then break end

if newline:match("\t") ~= nil then
  newlinetime,newline = newline:match("(.-)\t(.*)") 
else
  newlinetime = os.time() - starttime
end

newline = add_to_table_and_check_duplicate(newline,newlinetime,brun_table,newcount)

if arun_table[newline] ~= nil then oldlinetime = arun_table[newline]["timeval"] oldlinenum = arun_table[newline]["linenum"] else oldlinetime = nil end

pprint (newline)

if oldlinetime == nil then pprint("*** line not found *** NEW >>> "..newline) print(arun_table[newline]) else pprint("REF TIME A = " .. formattime(oldlinetime).." "..string.format("%4d",oldlinetime) .. " TIME B = " .. formattime(newlinetime).." ".. string.format("%4d",newlinetime) .. " SPEED = " .. string.format("%2.1f",(oldlinetime / newlinetime)*100) .."%".. " BCOUNT = " .. string.format("%4d",newcount) .."/"..string.format("%4d",aitemcount).." ".."ALINE = " .. string.format("%4d",oldlinenum) .."/"..string.format("%4d",aitemcount).." ".. progressbar(52,oldlinenum/aitemcount)) 
   brun_table[newline]["match"]=1
   arun_table[newline]["match"]=1
end
end

print("NOMATCH IN A")
for c,d in pairs(arun_table) do if arun_table[c]["match"]==nil then print ("NOMATCH A:"..c) end end
print("NOMATCH IN B")
for c,d in pairs(brun_table) do if brun_table[c]["match"]==nil then print ("NOMATCH B:"..c) end end

print("DUPLICATES IN A")
for c,d in pairs(arun_table) do if arun_table[c]["count"]>1 then print (arun_table[c]["count"].."x:".."\""..c.."\"") end end
print("DUPLICATES IN B")
for c,d in pairs(brun_table) do if brun_table[c]["count"]>1 then print (brun_table[c]["count"].."x:".."\""..c.."\"") end end

dogbark()


and the output looks like:

Code

GCC 7 detected
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    2/8528 ALINE =    1/8528 [..................................................]   0.01%
Creating obj/Release
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    3/8528 ALINE =    2/8528 [..................................................]   0.02%
Creating obj/Release/src/host
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    4/8528 ALINE =    3/8528 [..................................................]   0.04%
Creating obj/Release/src/host/lua-5.3.0/src
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    5/8528 ALINE =    4/8528 [a.................................................]   0.05%
lapi.c
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    6/8528 ALINE =    5/8528 [a.................................................]   0.06%
lauxlib.c
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    7/8528 ALINE =    6/8528 [a.................................................]   0.07%
lbaselib.c
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    8/8528 ALINE =    7/8528 [b.................................................]   0.08%
lbitlib.c
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =    9/8528 ALINE =    8/8528 [b.................................................]   0.09%
Converting src/mame/drivers/ymmu100.ppm...
REF TIME A = 0:00    0 TIME B = 0:00    0 SPEED = -nan% BCOUNT =   10/8528 ALINE =    9/8528 [b.................................................]   0.11%
lcode.c

...

Compiling src/mame/mame.cpp...
REF TIME A = 69:59 4199 TIME B = 41:05 2465 SPEED = 170.3% BCOUNT = 8524/8528 ALINE = 8525/8528 [#################################################Z]  99.96%
Compiling generated/version.cpp...
REF TIME A = 69:59 4199 TIME B = 41:05 2465 SPEED = 170.3% BCOUNT = 8525/8528 ALINE = 8524/8528 [#################################################Y]  99.95%
Building driver list...
REF TIME A = 69:59 4199 TIME B = 41:05 2465 SPEED = 170.3% BCOUNT = 8526/8528 ALINE = 8526/8528 [#################################################Z]  99.98%
Compiling generated/mame/mame/drivlist.cpp...
REF TIME A = 70:00 4200 TIME B = 41:05 2465 SPEED = 170.4% BCOUNT = 8527/8528 ALINE = 8527/8528 [#################################################Z]  99.99%
Linking mame64...
REF TIME A = 70:04 4204 TIME B = 41:09 2469 SPEED = 170.3% BCOUNT = 8528/8528 ALINE = 8528/8528 [##################################################] 100.00%
NOMATCH IN A
NOMATCH A:Creating ../../../../linux_gcc/bin/x64/Release/mame_mame<DUPLICATE LINE NUM=3>
NOMATCH IN B
DUPLICATES IN A
2x:"Generating m6509 disassembler source file..."
2x:""
2x:"Generating deco16 disassembler source file..."
2x:"Generating m65ce02 disassembler source file..."
2x:"Generating n2a03 disassembler source file..."
2x:"Generating m6510 disassembler source file..."
2x:"Generating r65c02 disassembler source file..."
2x:"Generating m4510 disassembler source file..."
2x:"Generating m65c02 disassembler source file..."
2x:"Generating m6502 disassembler source file..."
3x:"Creating ../../../../linux_gcc/bin/x64/Release/mame_mame"
2x:"Generating m740 disassembler source file..."
DUPLICATES IN B
2x:"Generating m6509 disassembler source file..."
2x:""
2x:"Generating deco16 disassembler source file..."
2x:"Generating m65ce02 disassembler source file..."
2x:"Generating n2a03 disassembler source file..."
2x:"Generating m6510 disassembler source file..."
2x:"Generating m740 disassembler source file..."
2x:"Generating r65c02 disassembler source file..."
2x:"Generating m4510 disassembler source file..."
2x:"Generating m6502 disassembler source file..."
2x:"Creating ../../../../linux_gcc/bin/x64/Release/mame_mame"
2x:"Generating m65c02 disassembler source file..."


I couldn't figure out why the line counts didn't match sometimes I wanted to "diff" the runs to see how the were different.

For instance, the first run A has 3 lines of "Creating ../../../../linux_gcc/bin/x64/Release/mame_mame" where the second run B has only 2 line of "Creating ../../../../linux_gcc/bin/x64/Release/mame_mame".

Re: Compile stats [Re: Golden Child] #112689
02/19/18 12:29 PM
02/19/18 12:29 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
And more silly compiling fun (under Ubuntu 17.10)

I thought I'd add some speech so that it'd say "Compile started" and "Compile Completed". Ubuntu's got this spd-say command which makes it easy, just do an os.execute("spd-say 'Open the pod bay doors, hal'")

And I wanted to see some graphics so why not try to send some values to gnuplot using lua, like this perl script from https://www.thanassis.space/gnuplotStreaming.html

and you get something like this:

[Linked Image]

and if you make a reference timefile you can just cat it to this script (which is fun to watch because it's fast):

cat luatimemake.txt | lua5.3 luaplot_test.lua

If you haven't got gnuplot installed, just do "sudo apt install gnuplot-qt".

Code

numbarks = 1

brun_table = {}
brun_linenumkey_table = {}


function saystring(str) str = "\""..str.."\"" print(str) os.execute("spd-say -w "..str)  end


function dogbark() for i = 1,numbarks do os.execute("play -q /usr/share/sounds/gnome/default/alerts/bark.ogg") end end
-- for dogbark to work you have to "sudo apt install sox"
dogbark()
saystring("Compile started")

f = io.open("luatimemake.txt","rb")
fileout = io.open("luacompareoutput2.txt","w")
linenum = 0

function formattime(a) local min,minfrac = math.modf(a/60) return min..":"..string.format("%02.0f",minfrac*60) end

function progressbar(size,fraction)
local numbars = math.floor((size-2)*(fraction))
local fracpart = ((size-2)*fraction)-numbars
--local onechar = string.sub("01234567890",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
--local onechar = string.sub(".,;:-=+\\|/*#",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
  local onechar = string.sub(".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",math.floor(fracpart*53)+1,math.floor(fracpart*53)+1)
local numremain = (size-2)-numbars
if numbars >= size - 2 then onechar = "" end
  return "["..string.rep("#",numbars)..onechar..string.rep(".",numremain-string.len(onechar)).."]".." "..string.format("%6.2f%%",100*fraction)
end

-- for i =0,100,0.5 do print (i,progressbar(80,i/100),progressbar(10,i/100)) end

function pprint(a) fileout:write(a .. "\n") print(a) end
function printt(t) for a,b in pairs(t) do print (a,b) end end

function dumpstring(a) for k = 1,string.len(a) do print (k,string.format("%3d",string.byte(a,k)).." "..string.sub(a,k,k)) end end

function add_to_table_and_check_duplicate(linestr,linetime,run_table,linenum,linenum_key_table)
local linestr2
if linestr ~= nil then
-- print(linestr) 
  if run_table[linestr]~= nil then 
    run_table[linestr]["count"] = run_table[linestr]["count"]+1  
    linestr2 = linestr .. "<DUPLICATE LINE NUM=" .. run_table[linestr]["count"]..">" print(linestr) 
  end
  if run_table[linestr]==nil then run_table[linestr] ={linenum=linenum,linetime=tonumber(linetime),count=1 }
                     else run_table[linestr2]={linenum=linenum,linetime=tonumber(linetime),count=1 }
                        pprint ("Original at "..run_table[linestr]["linenum"].." Duplicate at "..linenum..":\""..linestr2.."\" origtime = "..run_table[linestr]["linetime"].." newtime = "..linetime) 
  end 
end 
  if linestr2 ~= nil then 
     linenum_key_table[linenum]=linestr2
     run_table[linestr2]["linestr"]=linestr2
     return linestr2 
  else 
     linenum_key_table[linenum]=linestr
     run_table[linestr]["linestr"]=linestr
     return linestr 
  end
end



arun_linenumkey_table = {}
arun_table = {} f:seek("set") g = f:read() 
while g ~= nil do 
linetime,linestr = g:match("(.-)\t(.*)") 

maxval = tonumber(linetime) 
linenum = linenum + 1 

add_to_table_and_check_duplicate(linestr,linetime,arun_table,linenum,arun_linenumkey_table)

g = f:read() end

function setup_plot() 
pip = io.popen("gnuplot ","w")
end

function setup_plot2() 
pip2 = io.popen("gnuplot ","w")
end

function iif(a,b,c) if a then return b else return c end end

function make_plot2()

pip2:write("set xlabel 'time (in seconds)'\n")
pip2:write("set ylabel 'compile items'\n")
pip2:write("set style line 2 linewidth 2\n")

pip2:write("y2(x)=m2*x+b2\n")
pip2:write("set fit quiet\n")

pip2:write("fit y2(x) '-' via m2,b2\n")

for i =1,#brun_linenumkey_table,iif(#brun_linenumkey_table<skipinterval,1,skipinterval*skipfitmultiplier) do 
pip2:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip2:write("e\n")
pip2:flush()

pip2:write("plot '-' title 'brun' with lines,y2(x)\n")

for i =#brun_linenumkey_table-50,#brun_linenumkey_table do 
if i>=1 then
pip2:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
end
pip2:write("e\n")
pip2:flush()

end

skipinterval = 10 -- lets skip to plot less datapoints, make it faster
skipmultiplier = 2
skipfitmultiplier = 5
function make_plot()

pip:write("set xlabel 'time (in seconds)'\n")
pip:write("set ylabel 'compile items'\n")

pip:write("y(x)=m*x+b\n")
pip:write("set fit quiet\n")
pip:write("fit y(x) '-' via m,b\n")

for i =1,#arun_linenumkey_table,skipinterval*skipfitmultiplier do 
pip:write(arun_table[arun_linenumkey_table[i]]["linetime"].." "..arun_table[arun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()


pip:write("y2(x)=m2*x+b2\n")
pip:write("fit y2(x) '-' via m2,b2\n")


for i =1,#brun_linenumkey_table,skipinterval*skipfitmultiplier do 
pip:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()


pip:write("set style line 2 linewidth 2\n")
pip:write("set style line 3 linewidth 6\n")
pip:write("set yrange [*:10000]\n")
--pip:write("plot y(x), '-' with lines, '-' with points\n")
pip:write("plot y(x), '-' title 'arun' with lines, '-' title 'brun' with lines ls 3, y2(x)\n")


for i =1,#arun_linenumkey_table,skipinterval do 
pip:write(arun_table[arun_linenumkey_table[i]]["linetime"].." "..arun_table[arun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()

for i =1,#brun_linenumkey_table,skipinterval do 
--print (i,brun_linenumkey_table[i],brun_table[brun_linenumkey_table[i]]["linetime"],brun_table[brun_linenumkey_table[i]]["linenum"])
pip:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()

end -- makeplot

setup_plot()
make_plot()

setup_plot2()

alinecount = 0
for a,b in pairs(arun_table) do alinecount = alinecount + 1 end
print("TOTAL ITEMS:" .. alinecount)

blinecount = 0

brun_table = {}
brun_linenumkey_table = {}

starttime = os.time()


while true do

if (blinecount % (skipinterval*skipmultiplier)) == 0 then make_plot() end

if (blinecount % 2) == 0 then make_plot2() end

newline = io.read()
blinecount = blinecount + 1



if newline == nil then break end

if string.match(newline,"(Linking mame64)") then saystring(string.match(newline,"(Linking mame64)")) end

if newline:match("\t") ~= nil then
  print("matching TAB character")
  newlinetime,newline = newline:match("(.-)\t(.*)") 
  if newlinetime=="" then print("newlinetime is empty string") newlinetime = os.time() - starttime print(newlinetime) end
  if newlinetime==nil then print("newlinetime is nil") newlinetime = os.time() - starttime print(newlinetime) end
else
  newlinetime = os.time() - starttime
end

newline = add_to_table_and_check_duplicate(newline,newlinetime,brun_table,blinecount,brun_linenumkey_table)

if arun_table[newline] ~= nil then oldlinetime = arun_table[newline]["linetime"] oldlinenum = arun_table[newline]["linenum"] else oldlinetime = nil end

pprint (newline)

if oldlinetime == nil then pprint("*** line not found *** NEW >>> "..newline) print(arun_table[newline]) else pprint("REF TIME A = " .. formattime(oldlinetime).." "..string.format("%4d",oldlinetime) .. " TIME B = " .. formattime(newlinetime).." ".. string.format("%4d",newlinetime) .. " SPEED = " .. string.format("%2.1f",(oldlinetime / newlinetime)*100) .."%".. " BCOUNT = " .. string.format("%4d",blinecount) .."/"..string.format("%4d",alinecount).." ".."ALINE = " .. string.format("%4d",oldlinenum) .."/"..string.format("%4d",alinecount).." ".. progressbar(52,oldlinenum/alinecount)) 
   brun_table[newline]["match"]=1
   arun_table[newline]["match"]=1
end
end

print("NOMATCH IN A")
for c,d in pairs(arun_table) do if arun_table[c]["match"]==nil then print ("NOMATCH A:"..c) end end
print("NOMATCH IN B")
for c,d in pairs(brun_table) do if brun_table[c]["match"]==nil then print ("NOMATCH B:"..c) end end

print("DUPLICATES IN A")
for c,d in pairs(arun_table) do if arun_table[c]["count"]>1 then print (arun_table[c]["count"].."x:".."line "..arun_table[c]["linenum"]..":".."\""..c.."\"") end end

print("DUPLICATES IN A IN ORDER")
for i =1,#arun_linenumkey_table do if arun_table[arun_linenumkey_table[i]]["count"]>1 or string.find(arun_table[arun_linenumkey_table[i]]["linestr"],"<DUPLICATE LINE NUM=") ~= nil then print("A DUP:"..arun_table[arun_linenumkey_table[i]]["count"].."x:".."line "..arun_table[arun_linenumkey_table[i]]["linenum"]..":".."\""..arun_linenumkey_table[i].."\"") end end

print("DUPLICATES IN B")
for c,d in pairs(brun_table) do if brun_table[c]["count"]>1 then print (brun_table[c]["count"].."x:".."line "..arun_table[c]["linenum"]..":".."\""..c.."\"") end end

print("DUPLICATES IN B IN ORDER")
for i =1,#brun_linenumkey_table do if brun_table[brun_linenumkey_table[i]]["count"]>1 or string.find(brun_table[brun_linenumkey_table[i]]["linestr"],"<DUPLICATE LINE NUM=") ~= nil then print("B DUP:"..brun_table[arun_linenumkey_table[i]]["count"].."x:".."line "..brun_table[brun_linenumkey_table[i]]["linenum"]..":".."\""..brun_linenumkey_table[i].."\"") end end

print("NUM ENTRIES IN A: "..#arun_linenumkey_table)
print("NUM ENTRIES IN B: "..#brun_linenumkey_table)

compilemins,compileminsfrac = math.modf((os.time()-starttime)/60)
compilesecs = compileminsfrac * 60
saystring("Compile completed in "..string.format("%.0f",compilemins).." minutes and "..string.format("%.0f",compilesecs).." seconds.")

dogbark()

os.execute("sleep 10")

pip:close()
pip2:close()


Re: Compile stats [Re: Golden Child] #112767
02/28/18 03:24 PM
02/28/18 03:24 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
So I wanted to add some labels to the graphs, but they overlapped so you couldn't read them. Why not rotate the text by a few degrees with gnuplot? It makes a cool radial pattern. More silly fun.

The graphs seem to slow the compile by about 2-3%, it added 1:30 to the original compile time of 70:04.

REF TIME A = 70:04 4204 TIME B = 71:32 4292 SPEED = 97.9% BCOUNT = 8527/8528 ALINE = 8528/8528 [##################################################] 100.00%

[Linked Image]

Code
-- luacompilegraph.lua
--
-- "It's time for your graph, Master Joey"

numbarks = 1

brun_table = {}
brun_linenumkey_table = {}


function saystring(str) str = "\""..str.."\"" print(str) os.execute("spd-say -w "..str)  end


function dogbark() for i = 1,numbarks do os.execute("play -q /usr/share/sounds/gnome/default/alerts/bark.ogg") end end
-- for dogbark to work you have to "sudo apt install sox"
dogbark()
saystring("Compile started")

f = io.open("luatimemake.txt","rb")
fileout = io.open("luacompareoutput2.txt","w")
linenum = 0

function formattime(a) local min,minfrac = math.modf(a/60) return min..":"..string.format("%02.0f",minfrac*60) end

function progressbar(size,fraction)
local numbars = math.floor((size-2)*(fraction))
local fracpart = ((size-2)*fraction)-numbars
--local onechar = string.sub("01234567890",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
--local onechar = string.sub(".,;:-=+\\|/*#",math.floor(fracpart*10)+1,math.floor(fracpart*10)+1)
  local onechar = string.sub(".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",math.floor(fracpart*53)+1,math.floor(fracpart*53)+1)
local numremain = (size-2)-numbars
if numbars >= size - 2 then onechar = "" end
  return "["..string.rep("#",numbars)..onechar..string.rep(".",numremain-string.len(onechar)).."]".." "..string.format("%6.2f%%",100*fraction) --..fracpart..numbars
end

-- for i =0,100,0.5 do print (i,progressbar(80,i/100),progressbar(10,i/100)) end

function pprint(a) fileout:write(a .. "\n") print(a) end
function printt(t) for a,b in pairs(t) do print (a,b) end end

function dumpstring(a) for k = 1,string.len(a) do print (k,string.format("%3d",string.byte(a,k)).." "..string.sub(a,k,k)) end end


--[[

run_table

entries keyed on the text of the line

each entry consists of a table where:

["linestr"] = text of line
["linenum"] = line number
["linetime"] = line time
["count"] = line count of how many times line appears (>1 if duplicates)
["match"] = matched in another table


so for example, accessing the various properties of a given line would be:
run_table["text key of a line"]["linenum"] = 32
run_table["text key of a line"]["linetime"] = 3600
run_table["text key of a line"]["count"] = 5

--]]



function add_to_table_and_check_duplicate(linestr,linetime,run_table,linenum,linenum_key_table)
local linestr2
if linestr ~= nil then
-- print(linestr) 
  if run_table[linestr]~= nil then 
    run_table[linestr]["count"] = run_table[linestr]["count"]+1  
    linestr2 = linestr .. "<DUPLICATE LINE NUM=" .. run_table[linestr]["count"]..">" print(linestr) 
  end
  if run_table[linestr]==nil then run_table[linestr] ={linenum=linenum,linetime=tonumber(linetime),count=1 }
                     else run_table[linestr2]={linenum=linenum,linetime=tonumber(linetime),count=1 }
                        pprint ("Original at "..run_table[linestr]["linenum"].." Duplicate at "..linenum..":\""..linestr2.."\" origtime = "..run_table[linestr]["linetime"].." newtime = "..linetime) 
  end 
end 
  if linestr2 ~= nil then 
     linenum_key_table[linenum]=linestr2
     run_table[linestr2]["linestr"]=linestr2
     return linestr2 
  else 
     linenum_key_table[linenum]=linestr
     run_table[linestr]["linestr"]=linestr
     return linestr 
  end
end



arun_linenumkey_table = {}
arun_table = {} f:seek("set") g = f:read() 
while g ~= nil do 
linetime,linestr = g:match("(.-)\t(.*)") 

maxval = tonumber(linetime) 
linenum = linenum + 1 

add_to_table_and_check_duplicate(linestr,linetime,arun_table,linenum,arun_linenumkey_table)

g = f:read() end


--luaplot_test

function escape_quotes(s) return string.gsub(s,"\"","\\\"") end


function setup_plot() 
-- Open a pipe to gnuplot for writing
pip = io.popen("gnuplot ","w")
end

function setup_plot2() 
-- Open another pipe to gnuplot for writing
pip2 = io.popen("gnuplot ","w")
end

function iif(a,trueresult,falseresult) if a then return trueresult else return falseresult end end

function make_plot2()
pip2:write("set xlabel 'time (in seconds)'\n")
pip2:write("set ylabel 'compile items'\n")
pip2:write("set style line 2 linewidth 2\n")

bottomedge = #brun_linenumkey_table - 50
--pip2:write("set yrange ["..bottomedge-(bottomedge % 50) ..":*]\n")
--io.write("set xrange ["..(#brun_linenumkey_table % 50) ..":*]\n")

pip2:write("y2(x)=m2*x+b2\n")
pip2:write("set fit quiet\n")

pip2:write("fit y2(x) '-' via m2,b2\n")

for i =1,#brun_linenumkey_table,iif(#brun_linenumkey_table<skipinterval,1,skipinterval*skipfitmultiplier) do 
pip2:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip2:write("e\n")
pip2:flush()

-- set offset left, right, top, bottom  
-- we want some white space to the right so let's try a 0.7 margin and 0.1 margin for everything else
pip2:write("set offset graph 0.1, graph 0.7, graph 0.1, graph 0.1\n")

num_labels=10

-- unset label clears all of the labels previously set
pip2:write("unset label\n")
-- now lets get the last few items and create some labels for them, rotating them so we can see them better
for i =#brun_linenumkey_table-num_labels,#brun_linenumkey_table do 
if i>=1 then
pip2:write("set label "..i.." \""..escape_quotes(brun_table[brun_linenumkey_table[i]]["linestr"]).."\" at "..brun_table[brun_linenumkey_table[i]]["linetime"]..","..brun_table[brun_linenumkey_table[i]]["linenum"].." rotate by 90-"..#brun_linenumkey_table-i.."*25\n")
end
end
pip2:flush()

pip2:write("plot '-' title 'brun' with linespoints,y2(x)\n")

for i =#brun_linenumkey_table-50,#brun_linenumkey_table do 
if i>=1 then
pip2:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
end
pip2:write("e\n")
pip2:flush()
end -- make_plot2


skipinterval = 10 -- lets skip to plot less datapoints, make it faster
skipmultiplier = 2
skipfitmultiplier = 5

function make_plot()

pip:write("set xlabel 'time (in seconds)'\n")
pip:write("set ylabel 'compile items'\n")

pip:write("y(x)=m*x+b\n")
pip:write("set fit quiet\n")
pip:write("fit y(x) '-' via m,b\n")

for i =1,#arun_linenumkey_table,skipinterval*skipfitmultiplier do 
pip:write(arun_table[arun_linenumkey_table[i]]["linetime"].." "..arun_table[arun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()


pip:write("y2(x)=m2*x+b2\n")
pip:write("fit y2(x) '-' via m2,b2\n")


for i =1,#brun_linenumkey_table,skipinterval*skipfitmultiplier do 
--print (i,brun_linenumkey_table[i],brun_table[brun_linenumkey_table[i]]["linetime"],brun_table[brun_linenumkey_table[i]]["linenum"])
pip:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()


pip:write("set style line 2 linewidth 2\n")
pip:write("set style line 3 linewidth 6\n")
pip:write("set yrange [*:10000]\n")
--pip:write("plot y(x), '-' with lines, '-' with points\n")
pip:write("plot y(x), '-' title 'arun' with lines, '-' title 'brun' with lines ls 3, y2(x)\n")


for i =1,#arun_linenumkey_table,skipinterval do 
pip:write(arun_table[arun_linenumkey_table[i]]["linetime"].." "..arun_table[arun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
pip:flush()

for i =1,#brun_linenumkey_table,skipinterval do 
--print (i,brun_linenumkey_table[i],brun_table[brun_linenumkey_table[i]]["linetime"],brun_table[brun_linenumkey_table[i]]["linenum"])
pip:write(brun_table[brun_linenumkey_table[i]]["linetime"].." "..brun_table[brun_linenumkey_table[i]]["linenum"].."\n")
end
pip:write("e\n")
-- don't forget to flush
pip:flush()

end -- makeplot

setup_plot()
make_plot()

setup_plot2()

-- os.execute("sleep 10")


alinecount = 0
for a,b in pairs(arun_table) do alinecount = alinecount + 1 end
print("TOTAL ITEMS:" .. alinecount)

blinecount = 0

brun_table = {}
brun_linenumkey_table = {}

starttime = os.time()


while true do


-- do our makeplot every <skipinterval> lines
if (blinecount % (skipinterval*skipmultiplier)) == 0 then make_plot() end

-- lets do a make_plot2 every 2 lines
if (blinecount % 2) == 0 then make_plot2() end

newline = io.read()
blinecount = blinecount + 1



if newline == nil then break end

if string.match(newline,"(Linking mame64)") then saystring(string.match(newline,"(Linking mame64)")) end

if newline:match("\t") ~= nil then
  print("matching TAB character")
  newlinetime,newline = newline:match("(.-)\t(.*)") 
  if newlinetime=="" then print("newlinetime is empty string") newlinetime = os.time() - starttime print(newlinetime) end
  if newlinetime==nil then print("newlinetime is nil") newlinetime = os.time() - starttime print(newlinetime) end
else
  newlinetime = os.time() - starttime
end

newline = add_to_table_and_check_duplicate(newline,newlinetime,brun_table,blinecount,brun_linenumkey_table)

if arun_table[newline] ~= nil then oldlinetime = arun_table[newline]["linetime"] oldlinenum = arun_table[newline]["linenum"] else oldlinetime = nil end

pprint (newline)

if oldlinetime == nil then pprint("*** line not found *** NEW >>> "..newline) print(arun_table[newline]) else pprint("REF TIME A = " .. formattime(oldlinetime).." "..string.format("%4d",oldlinetime) .. " TIME B = " .. formattime(newlinetime).." ".. string.format("%4d",newlinetime) .. " SPEED = " .. string.format("%2.1f",(oldlinetime / newlinetime)*100) .."%".. " BCOUNT = " .. string.format("%4d",blinecount) .."/"..string.format("%4d",alinecount).." ".."ALINE = " .. string.format("%4d",oldlinenum) .."/"..string.format("%4d",alinecount).." ".. progressbar(52,oldlinenum/alinecount)) 
   brun_table[newline]["match"]=1
   arun_table[newline]["match"]=1
end
end

print("NOMATCH IN A")
for c,d in pairs(arun_table) do if arun_table[c]["match"]==nil then print ("NOMATCH A:"..c) end end
print("NOMATCH IN B")
for c,d in pairs(brun_table) do if brun_table[c]["match"]==nil then print ("NOMATCH B:"..c) end end

print("DUPLICATES IN A")
for c,d in pairs(arun_table) do if arun_table[c]["count"]>1 then print (arun_table[c]["count"].."x:".."line "..arun_table[c]["linenum"]..":".."\""..c.."\"") end end

print("DUPLICATES IN A IN ORDER")
for i =1,#arun_linenumkey_table do if arun_table[arun_linenumkey_table[i]]["count"]>1 or string.find(arun_table[arun_linenumkey_table[i]]["linestr"],"<DUPLICATE LINE NUM=") ~= nil then print("A DUP:"..arun_table[arun_linenumkey_table[i]]["count"].."x:".."line "..arun_table[arun_linenumkey_table[i]]["linenum"]..":".."\""..arun_linenumkey_table[i].."\"") end end

print("DUPLICATES IN B")
for c,d in pairs(brun_table) do if brun_table[c]["count"]>1 then print (brun_table[c]["count"].."x:".."line "..arun_table[c]["linenum"]..":".."\""..c.."\"") end end

print("DUPLICATES IN B IN ORDER")
for i =1,#brun_linenumkey_table do if brun_table[brun_linenumkey_table[i]]["count"]>1 or string.find(brun_table[brun_linenumkey_table[i]]["linestr"],"<DUPLICATE LINE NUM=") ~= nil then print("B DUP:"..brun_table[arun_linenumkey_table[i]]["count"].."x:".."line "..brun_table[brun_linenumkey_table[i]]["linenum"]..":".."\""..brun_linenumkey_table[i].."\"") end end

print("NUM ENTRIES IN A: "..#arun_linenumkey_table)
print("NUM ENTRIES IN B: "..#brun_linenumkey_table)


compilemins,compileminsfrac = math.modf((os.time()-starttime)/60)
compilesecs = compileminsfrac * 60
saystring("Compile completed in "..string.format("%.0f",compilemins).." minutes and "..string.format("%.0f",compilesecs).." seconds.")

dogbark()

-- Pause so we can look at the graphs for 10 seconds because they disappear when gnuplot closes
os.execute("sleep 10")

pip:close()
pip2:close()


Re: Compile stats [Re: Golden Child] #112889
03/16/18 12:21 PM
03/16/18 12:21 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
So how much memory do you really need to compile mame efficiently?

/usr/bin/time make -j2 tells you things like:

10473.27user 1103.76system 1:43:29elapsed 186%CPU (0avgtext+0avgdata 2165100maxresident)k
3767160inputs+5861408outputs (10198major+253164785minor)pagefaults 0swaps

And it looks like you can compile with 2GB memory since it says 2165100maxresident, but it seems to need at least 3GB memory to do it well.

I thought I'd run a little experiment with different amounts of memory since I had a Dell Optiplex 745 Core2Duo system and some spare DIMMS, but you can simulate having less memory with a mem=2G or mem=3G kernel parameter at boot time (it's a lot easier than pulling dimms out).

I installed Ubuntu to an external USB drive and directed the Dell Optiplex "F12 boot menu" to boot up with it. It's a neat way to try the same Ubuntu system on a bunch of different hardware, you just move the external USB from system to system and run the same exact setup.

My lua script that gives timing into will emit a "DONE - COMPILE COMPLETE" line when it receives nil along with some other info which is useful when comparing systems:

Code

-- luatime2.lua
-- This will take the input and print the time in seconds before the line.
-- Once complete it will print info about your system and run mame for a few seconds.

donestr = "DONE - COMPILE COMPLETE"

function iif(b,t,f) if b then return t else return f end end 
start = os.time() 

while true do 
  linestr = io.read() 
  linetime = os.time() 
  print (linetime-start,iif(linestr==nil,donestr,linestr)) 
  if linestr==nil then break end 
end 

function print_and_execute(str) print(string.rep("=",80).."\n".."EXECUTING: "..str) os.execute(str) end

print_and_execute("lscpu | grep \"Model name:\"")
print_and_execute("lscpu")
print_and_execute("lspci -nn | grep -E -i \"Display|VGA\"")
print_and_execute("lspci -nn")
print_and_execute("ls -l ./mame64")
print_and_execute("md5sum ./mame64")
print_and_execute("gcc --version | head -n 1")
print_and_execute("lsb_release -a")
print_and_execute("uname -a")
print_and_execute("date")
print_and_execute("lsmod | grep \"video\\|drm\\|radeon\\|nouveau\"")
print_and_execute("cat /proc/meminfo | grep \"MemTotal\"")

mamebasestr = "/usr/bin/time ./mame64 -seconds_to_run 7 -sdlvideofps"

mamegamestr = "pacman"

print_and_execute(mamebasestr.." "..mamegamestr.." -video opengl -verbose")



And you can invoke it with:

Code
make clean; /usr/bin/time make -j2 2>&1 | lua5.3 lua_time2.lua | tee  optiplex745_core2_6700_7gb_4mbl2_j2compile.txt | nl

So the 2>&1 part just redirects standard error to stdout, so we get the output of /usr/bin/time
tee just writes the output to a file
nl just adds a line number to the beginning of the line

And what did I discover:

Code
grep "DONE\|%CPU\|swap\|Model name\|MemTotal:"  optiplex*.txt


On a 2GB system: We run make -j2 to use both cores and it get 77% CPU and takes 4:17)

optiplex745_core2_6700_2gb_4mbl2_compile.txt:15438	10721.09user 1264.19system 4:17:17elapsed 77%CPU (0avgtext+0avgdata 1574196maxresident)k
optiplex745_core2_6700_2gb_4mbl2_compile.txt:15438	41428312inputs+5904776outputs (874171major+253765634minor)pagefaults 0swaps
optiplex745_core2_6700_2gb_4mbl2_compile.txt:15438	DONE - COMPILE COMPLETE
optiplex745_core2_6700_2gb_4mbl2_compile.txt:EXECUTING: lscpu | grep "Model name:"
optiplex745_core2_6700_2gb_4mbl2_compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_2gb_4mbl2_compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_2gb_4mbl2_compile.txt:MemTotal:        2037108 kB

But here's a surprise, make -j1 runs FASTER with 82% cpu in 3:34 on a 2GB system.

optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:12846	9535.24user 1019.71system 3:34:06elapsed 82%CPU (0avgtext+0avgdata 1610620maxresident)k
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:12846	23379376inputs+5905032outputs (267625major+253551458minor)pagefaults 0swaps
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:12846	DONE - COMPILE COMPLETE
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:EXECUTING: lscpu | grep "Model name:"
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_2gb_4mbl2_mem2g_j1compile.txt:MemTotal:        2047352 kB

A 3GB system, make -j2 will complete in 1:43 with 186% cpu .  Major faults require disk access, and we only get 10198 major here.

optiplex745_core2_6700_3gb_4mbl2_compile.txt:6210	10473.27user 1103.76system 1:43:29elapsed 186%CPU (0avgtext+0avgdata 2165100maxresident)k
optiplex745_core2_6700_3gb_4mbl2_compile.txt:6210	3767160inputs+5861408outputs (10198major+253164785minor)pagefaults 0swaps
optiplex745_core2_6700_3gb_4mbl2_compile.txt:6210	DONE - COMPILE COMPLETE
optiplex745_core2_6700_3gb_4mbl2_compile.txt:EXECUTING: lscpu | grep "Model name:"
optiplex745_core2_6700_3gb_4mbl2_compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_3gb_4mbl2_compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_3gb_4mbl2_compile.txt:MemTotal:        3069300 kB

A 7GB system, make -j2 will complete in 1:39 with 192% cpu .  Only 348 major faults and 192% CPU usage.

optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:5971	10467.70user 1053.96system 1:39:30elapsed 192%CPU (0avgtext+0avgdata 2239380maxresident)k
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:5971	925896inputs+5781240outputs (348major+253878672minor)pagefaults 0swaps
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:5971	DONE - COMPILE COMPLETE
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:EXECUTING: lscpu | grep "Model name:"
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:Model name:            Intel(R) Core(TM)2 CPU          6700  @ 2.66GHz
optiplex745_core2_6700_7gb_4mbl2_j2compile.txt:MemTotal:        7066468 kB



So I'd probably say that 3GB is probably the minimum amount of memory to do it without a bunch of thrashing.

This is compiling mame 194 on Ubuntu 16.04 LTS 64bit on a Core2Duo 6700.

Re: Compile stats [Re: Golden Child] #112939
03/22/18 03:49 AM
03/22/18 03:49 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
So I thought I'd see what would happen if I compiled mame 194 under 32 bit i386 Debian 9.3. I was actually surprised how much trouble I had compiling it. I was able to do it perfectly fine with a 2GB machine under ubuntu 16.04 with GCC 5.4. My laptop was slow, but it worked fine.

Code
13517	Compiling src/mame/mame.cpp...
13517	Building driver list...
13519	34922 driver(s) found
13519	Compiling generated/version.cpp...
13519	Compiling generated/mame/mame/drivlist.cpp...
13529	Linking mame...
13809	24266.71user 1461.97system 3:50:09elapsed 186%CPU (0avgtext+0avgdata 1319532maxresident)k
13809	3621416inputs+4597848outputs (5762major+166197861minor)pagefaults 0swaps
13809	DONE - COMPILE COMPLETE
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Genuine Intel(R) CPU           U2500  @ 1.20GHz
================================================================================
EXECUTING: lscpu
Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 14
Model name:            Genuine Intel(R) CPU           U2500  @ 1.20GHz
Stepping:              8
CPU MHz:               800.000
CPU max MHz:           1200.0000
CPU min MHz:           800.0000
BogoMIPS:              2394.09
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              2048K
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor vmx est tm2 xtpr pdcm retpoline dtherm

================================================================================
EXECUTING: ls -l ./mame
-rwxrwxr-x 1 golden golden 226113840 Mar 18 14:54 ./mame
================================================================================
EXECUTING: md5sum ./mame
9f8a7cc185264d5da6df2fcc9a3d5d8d  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
================================================================================
EXECUTING: lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	16.04
Codename:	xenial
================================================================================
EXECUTING: uname -a
Linux  4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:22:43 UTC 2018 i686 i686 i686 GNU/Linux
================================================================================
EXECUTING: date
Sun Mar 18 10:29:30 PDT 2018
================================================================================




But I had lots of problems compiling under Debian 9.4, specifically the barcrest and the bfm subtargets seemed to cause virtual memory exhaustion. On this system with 4GB, under Debian i686 it only has 3GB and I have a 10GB swapfile. However it only seems to have a 3GB maximum address space.

I finally got it to compile by commenting out the barcrest and bfm subtargets in arcade.lua (scripts/target/mame/arcade.lua)


Code
function linkProjects_mame_arcade(_target, _subtarget)
	links {
		"acorn",
		"adp",
		"alba",
		"alliedl",
		"alpha",
		"amiga",
		"aristocr",
		"ascii",
		"atari",
		"atlus",
	--	"barcrest",       COMMENTED OUT  TWO DASHES
	--	"bfm",        COMMENTED OUT
		"bmc",
		"capcom",
		"ces",
	

--[[     COMMENTED OUT TWO DASHES AND TWO BRACKETS
createMAMEProjects(_target, _subtarget, "barcrest")
files {
	MAME_DIR .. "src/mame/drivers/mpu2.cpp",
	MAME_DIR .. "src/mame/drivers/mpu3.cpp",
	MAME_DIR .. "src/mame/machine/mpu4.cpp",
	MAME_DIR .. "src/mame/includes/mpu4.h",
	MAME_DIR .. "src/mame/drivers/mpu4.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4avan.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4bwb.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4concept.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4crystal.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4dealem.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4empire.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4mdm.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4misc.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4mod2sw.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4mod4yam.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4plasma.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4sw.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4union.cpp",
	MAME_DIR .. "src/mame/drivers/mpu4vid.cpp",
	MAME_DIR .. "src/mame/drivers/mpu5.cpp",
	MAME_DIR .. "src/mame/drivers/mpu5.hxx",
}

--]]
--[[
createMAMEProjects(_target, _subtarget, "bfm")
files {
	MAME_DIR .. "src/mame/drivers/bfcobra.cpp",
	MAME_DIR .. "src/mame/machine/bfm_comn.cpp",
	MAME_DIR .. "src/mame/machine/bfm_comn.h",
	MAME_DIR .. "src/mame/drivers/bfm_sc1.cpp",
	MAME_DIR .. "src/mame/drivers/bfm_sc2.cpp",
	MAME_DIR .. "src/mame/video/bfm_adr2.cpp",
	MAME_DIR .. "src/mame/video/bfm_adr2.h",
	MAME_DIR .. "src/mame/drivers/bfm_sc4.cpp",
	MAME_DIR .. "src/mame/drivers/bfm_sc5.cpp",
	MAME_DIR .. "src/mame/includes/bfm_sc5.h",
	MAME_DIR .. "src/mame/drivers/bfm_sc5sw.hxx",
	MAME_DIR .. "src/mame/drivers/bfm_ad5.cpp",
	MAME_DIR .. "src/mame/includes/bfm_ad5.h",
	MAME_DIR .. "src/mame/drivers/bfm_ad5sw.hxx",
	MAME_DIR .. "src/mame/machine/bfm_sc45_helper.cpp",
	MAME_DIR .. "src/mame/machine/bfm_sc45_helper.h",
	MAME_DIR .. "src/mame/includes/bfm_sc4.h",
	MAME_DIR .. "src/mame/drivers/bfm_swp.cpp",
	MAME_DIR .. "src/mame/drivers/bfmsys83.cpp",
	MAME_DIR .. "src/mame/drivers/bfmsys85.cpp",
	MAME_DIR .. "src/mame/machine/sec.cpp",
	MAME_DIR .. "src/mame/machine/sec.h",
	MAME_DIR .. "src/mame/machine/bfm_bd1.cpp",
	MAME_DIR .. "src/mame/machine/bfm_bd1.h",
	MAME_DIR .. "src/mame/machine/bfm_bda.cpp",
	MAME_DIR .. "src/mame/machine/bfm_bda.h",
	MAME_DIR .. "src/mame/video/bfm_dm01.cpp",
	MAME_DIR .. "src/mame/video/bfm_dm01.h",
	MAME_DIR .. "src/mame/drivers/rastersp.cpp",
}
--]]


Then I had to remove the items from mame.lst as well (src/mame/mame.lst) so they wouldn't get added to drvlist.cpp

Code

/*  
@source:bfcobra.cpp
beeline                         // 1991 BFM
escounts                        // 1990 BFM
inquiztr                        // 1989 BFM
qos                             // 1992 BFM
qosa                            // 1992 BFM
qosb                            // 1992 BFM
quizvadr                        // 1991 BFM
trebltop                        // 1991 BFM

...

@source:bfmsys85.cpp
b85bdclb                        //
b85bdclba                       //
...                 
b85ritzd                        //
b85royal                        //
b85scard                        // (c) 198? BFM
b85sngam                        //
*/


/
@source:mpu2.cpp
m2hilite                        // Hi-Lights (Barcrest) (MPU2)
m2svlite                        // Silver Lights (Barcrest) (MPU2)

...

@source:mpu5.cpp
m55050                          // Fifty Fifty (Bwb)
m5aceclb                        // Ace Of Clubs (Empire)
m5aceclba                       //
m5aceclbb                       //
m5addams                        // Addams Family (Barcrest)
m5addamsa                       //
m5addamsb                       //
...
m5xchn                          // Exchanges Unlimited (Barcrest)
m5xena                          // Xena Warrior Princess (Bwb)
m5xfact                         // X Factor (Empire)
m5xfact02                       //
m5xfact04                       //
m5xfact11                       //
m5zigzag                        // Zig Zag
*/



/*
@source:rastersp.cpp
fbcrazy                         // 1997
rotr                            // 1994
*/




Before I kept getting errors:

/usr/bin/time make -j2 | nl
1 GCC 6.3.0 detected
2 Compiling src/mame/drivers/mpu4sw.cpp...
3 Compiling src/mame/drivers/bfm_sc4.cpp...
virtual memory exhausted: Cannot allocate memory


/usr/bin/time make -j2 | nl
1 GCC 6.3.0 detected
2 Compiling src/mame/drivers/bfm_sc4.cpp...
3 Compiling src/mame/drivers/mpu4sw.cpp...

cc1plus: out of memory allocating 64 bytes after a total of 97579008 bytes
make[2]: *** [../../../../linux_gcc/obj/x32/Release/src/mame/drivers/bfm_sc4.o] Error 1
make[1]: *** [bfm] Error 2
4 bfm.make:421: recipe for target '../../../../linux_gcc/obj/x32/Release/src/mame/drivers/bfm_sc4.o' failed
5 Makefile:133: recipe for target 'bfm' failed
make[1]: *** Waiting for unfinished jobs....

Command terminated by signal 13
469.03user 13.58system 12:19.34elapsed 65%CPU (0avgtext+0avgdata 2310700maxresident)k
158600inputs+3104outputs (4343major+3459030minor)pagefaults 0swaps


/usr/bin/time make -j1 | nl
1 GCC 6.3.0 detected
2 Compiling src/mame/drivers/mpu4sw.cpp...
virtual memory exhausted: Cannot allocate memory
make[2]: *** [../../../../linux_gcc/obj/x32/Release/src/mame/drivers/mpu4sw.o] Error 1
3 barcrest.make:472: recipe for target '../../../../linux_gcc/obj/x32/Release/src/mame/drivers/mpu4sw.o' failed
make[1]: *** [barcrest] Error 2
4 Makefile:130: recipe for target 'barcrest' failed
make: *** [linux_x86] Error 2
5 makefile:1252: recipe for target 'linux_x86' failed
Command exited with non-zero status 2
437.82user 11.76system 7:49.94elapsed 95%CPU (0avgtext+0avgdata 2801344maxresident)k
272928inputs+1920outputs (2137major+3818599minor)pagefaults 0swaps


and after I remove barcrest and bfm, no problems running to the finish.
Code
8206	Compiling src/devices/machine/ie15.cpp...
8213	Archiving liboptional.a...
8248	Compiling src/mame/mame.cpp...
8248	Building driver list...
22746 driver(s) found
8250	Compiling generated/version.cpp...
8250	Compiling generated/mame/mame/drivlist.cpp...
8256	Linking mame...
14833.21user 782.10system 2:18:23elapsed 188%CPU (0avgtext+0avgdata 2556296maxresident)k
1416840inputs+4395320outputs (2887major+157584857minor)pagefaults 0swaps
8304	DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:        3097188 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz
================================================================================
EXECUTING: lscpu
Architecture:          i686
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 15
Model name:            Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz
Stepping:              2
CPU MHz:               2127.973
BogoMIPS:              4255.94
Virtualization:        VT-x
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow dtherm

================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877720 Mar 21 16:26 ./mame
================================================================================
EXECUTING: md5sum ./mame
3ad480dbe397219dc37c40b82a97029d  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
================================================================================
EXECUTING: lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch
================================================================================
EXECUTING: uname -a
Linux debian93i686 4.9.0-4-686 #1 SMP Debian 4.9.65-3 (2017-12-03) i686 GNU/Linux
================================================================================
EXECUTING: date
Wed Mar 21 16:26:46 PDT 2018
================================================================================



Since gcc 5.4 can compile using around 1.3 GB of max resident memory on ubuntu 16.04 32 bit, and gcc 6.3 takes over 2 GB of memory under debian 9.4, it looks like I should use gcc 5.4 for a 32 bit build.

Re: Compile stats [Re: Golden Child] #112940
03/22/18 03:56 AM
03/22/18 03:56 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
I also had to modify my lua script to account for the different file name for the mame executable under 32 and 64 bit (i686 = mame, x86_64 = mame64)

Code
-- luatime3.lua
-- This will take the input and print the time in seconds before the line.
-- Once complete it will print info about your system and run mame for a few seconds.
--
-- a nice compile command is something like:
-- make clean; /usr/bin/time make -j2 2>&1 | lua5.3 lua_time3.lua | tee COMPILE_LOG.txt | nl




function popenstr(str) local mypipe=io.popen(str,"r") local mystr=mypipe:read("*all") mypipe:close() return mystr end

arch_table={ x86_64 = "mame64", i686 = "mame" }

for archstr,arch_mamestr in pairs(arch_table) do
  if string.find(popenstr("uname -a"),archstr) then 
      mamebinarystr = arch_mamestr 
--    print(archstr,arch_mamestr) 
  end
end

assert(mamebinarystr,"arch not detected")

donestr = "DONE - COMPILE COMPLETE"

function iif(b,t,f) if b then return t  else return f end end 

l = os.time() while true do j = io.read() k = os.time() print (k-l,iif(j==nil,donestr,j)) if j==nil then break end end 

function print_and_execute(str) print(string.rep("=",80).."\n".."EXECUTING: "..str) os.execute(str) end

print_and_execute("cat /proc/meminfo | grep \"MemTotal\"")
print_and_execute("lscpu | grep \"Model name:\"")
print_and_execute("lscpu")
print_and_execute("lspci -nn | grep -E -i \"Display|VGA\"")
print_and_execute("lspci -nn")
print_and_execute("ls -l ./"..mamebinarystr.."")
print_and_execute("md5sum ./"..mamebinarystr.."")
print_and_execute("gcc --version | head -n 1")
print_and_execute("lsb_release -a")
print_and_execute("uname -a")
print_and_execute("date")
print_and_execute("lsmod | grep \"video\\|drm\"")

mamebase = "/usr/bin/time ./"..mamebinarystr.." -seconds_to_run 7 -sdlvideofps -rompath ../../mameroms 2>&1"

mamegame = "pacman"

print_and_execute(mamebase.." "..mamegame.." -video opengl -verbose")

Re: Compile stats [Re: Golden Child] #113145
04/17/18 09:35 AM
04/17/18 09:35 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
More silly compiling fun: I thought I'd see how well some of my older systems compile mame. Unfortunately, they don't all have a lot of memory. So why not try mounting the network block device nbd.

I've got an old Athlon 64 3500+ (@ 2.2ghz) system with 512mb which just isn't enough to compile mame without massive swapping. I'm compiling mame 194 under 32 bit debian 9.3 without the barcrest or bfm machines (since they're too big to compile with gcc 6.3)

Using the hard drive swap partition it takes almost 16 hours to compile at 37% cpu.

hard drive swap

46231 Compiling src/mame/mame.cpp...
46238 Building driver list...
46240 22746 driver(s) found
46240 Compiling generated/mame/mame/drivlist.cpp...
46249 Compiling generated/version.cpp...
46249 Linking mame...
57573 19374.11user 2021.97system 15:59:33elapsed 37%CPU (0avgtext+0avgdata 454908maxresident)k
57573 183876608inputs+4450072outputs (8856343major+157465795minor)pagefaults 0swaps
57573 DONE - COMPILE COMPLETE

But if I configure the nbd network block device, I can get that down to 10.5 hours minutes with 55% cpu.

nbd network swap

33103 Building driver list...
33106 22746 driver(s) found
33106 Compiling generated/mame/mame/drivlist.cpp...
33115 Compiling generated/version.cpp...
33116 Linking mame...
37641 19389.47user 1339.42system 10:27:20elapsed 55%CPU (0avgtext+0avgdata 448188maxresident)k
37641 162288192inputs+4445856outputs (9418061major+158097144minor)pagefaults 0swaps
37641 DONE - COMPILE COMPLETE

====================

comparing the link phase

hard drive swap = 57573-46249 = 188 minutes to link
nbd swap = 37641-33116 = 75 minutes to link

======================

comparing luaengine compile:

hard drive swap = 25178-6422 = 312 minutes
nbd swap = 11191-6839 = 72 minutes

=========================

It was a little tricky to get the nbd-client and nbd-server working under ubuntu 17.10.

First I installed nbd-client and nbd-server with
Code
sudo apt install nbd-client nbd-server

then I set up an nbd-server configuration file at /etc/nbd-server/config

Code
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
#       user = nbd
#       group = nbd
        includedir = /etc/nbd-server/conf.d
        allowlist = 1

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
[nbdfile]
  exportname = /mnt/a/NBDFILE
  port = 9000
# this doesn't show up on port 9000 like it should


I needed to comment out user=nbd and group=nbd for whatever reason. Also the port number seems to be ignored.
Code
sudo mkdir /mnt/a
sudo mount -t tmpfs tmpfs /mnt/a  -o size=$((1024*350/100))M


This creates a 3.5GB tmpfs ramdisk and mounts on /mnt/a. I would create a 4GB ramdisk but I'm a little ram constrained on this 8GB machine.

Code
dd if=/dev/zero of=/mnt/a/NBDFILE count=$((1024*1024*1024*350/100/512)) status=progress

7340032+0 records in
7340032+0 records out
3758096384 bytes (3.8 GB, 3.5 GiB) copied, 8.87334 s, 424 MB/s



This will create a 3.5GB file for your nbd-client to connect to.

Ok, now launch nbd-server and check to see that it's listening (the default port is 10809)

Code
$ nbd-server
$ netstat -tlpen
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp6       0      0 :::10809                :::*                    LISTEN      1000       10764011   29036/nbd-server

You should be able to connect on the local machine with nbd-client using address 127.0.0.1 and port 10809.

If you've got allowlist = 1 in your /etc/nbd-server/config file you can do this to get a listing:

Code
$ sudo nbd-client 127.0.0.1 10809 -l

Negotiation: ..
nbdfile


Make sure that the nbd module is loaded or the nbd-client won't work.

Code
sudo modprobe nbd


Code
$ sudo nbd-client 127.0.0.1 10809 -N nbdfile /dev/nbd0 -s

Negotiation: ..size = 3584MB
bs=1024, sz=3758096384 bytes


So this means connect to 127.0.0.1 port 10809 looking for the name nbdfile and mounting it on /dev/nbd0 and using it as swap.



and to disconnect /dev/nbd0 just use the -d option

Code
$ sudo nbd-client -d /dev/nbd0

disconnect, sock, done



and if you want to see more about the nbd-server config file options try "man 5 nbd-server"

Code
$ man 5 nbd-server

NBD-SERVER(5)                                                                                                       NBD-SERVER(5)

NAME
       /etc/nbd-server/config - configuration file for nbd-server


Once we've got the nbd-client connected, let's format that nbd file with a swap.

Code
$ sudo mkswap /dev/nbd0
Setting up swapspace version 1, size = 3.5 GiB (3758092288 bytes)
no label, UUID=xxxx

and let's add it to our swap devices with a higher priority of 1024.
Code
$ sudo swapon /dev/nbd0 -p 1024


and let's check the status

Code
$ sudo swapon -s

Filename				Type		Size	Used	Priority
/dev/sda5                              	partition	39132156	3984	-1
/dev/nbd0                              	partition	3670012	0	1024


and when you want to disconnect your nbd swap

Code
$ sudo swapoff /dev/nbd0
$ sudo nbd-client -d /dev/nbd0



And a few caveats with Ubuntu 17.10:

Supposedly one should be able to ignore the config file with:

Code
$ nbd-server -C /dev/null 9000 /mnt/a/NBDFILE 


and then connect with:

Code
$ sudo nbd-client 127.0.0.1 9000  /dev/nbd0 -s
Warning: the oldstyle protocol is no longer supported.
This method now uses the newstyle protocol with a default export
Negotiation: ..Error: Read failed: End of file
Exiting.


but this causes a segfault
Code
[22091.691859] nbd-server[4096]: segfault at 0 ip 00007f8d99c64cbe sp 00007fff3bb6d638 error 4 in libc-2.26.so[7f8d99bc4000+1d6000]


One other note, I tried running debian 9.3 off of an external usb hard drive along with a gigabit usb adapter doing nbd-client swap and it crashed my machine. I tried it twice and it crashed twice. It probably overwhelmed the usb bus and after switching to the onboard ethernet it ran fine. I didn't get much more performance with a gigabit adapter, probably due to the slowness of the old Athlon 64 3500+ cpu. I would see peaks of 16MB/sec instead of 12MB/sec, but that didn't make it much faster.

Also when I did my compiles, I was running ubuntu 17.10 64-bit on the nbd-server and debian 9.3 32-bit on the nbd-client.


Last edited by Golden Child; 04/17/18 09:52 AM.
Re: Compile stats [Re: Golden Child] #113169
04/20/18 04:48 PM
04/20/18 04:48 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
More silly nbd compiling fun - why not put the mame source files on an nbd block device ext2 file system as well.

And also I learned something about reproducible builds, the directory path changes the compiler output.



cat mynbdconfig

Code
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
#	user = nbd
#	group = nbd
	includedir = /etc/nbd-server/conf.d
allowlist = 1

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
[nbdfileswap]
  exportname = /mnt/a/NBDFILESWAP

[nbdfileext2]
  exportname = /mnt/a/NBDFILEEXT2


and create a 7GB tmpfs with 3.5 GB each for the swap and the ext2.

Code
$ sudo mount -t tmpfs tmpfs /mnt/a -o size=$((1024*700/100))M
$ dd if=/dev/zero of=/mnt/a/NBDFILESWAP count=$((1024**3*350/100/512)) status=progress
$ dd if=/dev/zero of=/mnt/a/NBDFILEEXT2  count=$((1024**3*350/100/512)) status=progress




I run my nbdserver with
Code
$ nbd-server -C mynbdconfig


and on my other system:


Let's get a listing of the nbd devices provided by the server at 192.168.0.1 port 10809.
Code
$ sudo nbd-client 192.168.0.1 10809 -l


Let's connect to the nbd devices provided in the configuration file:

Code
$ sudo nbd-client 192.168.0.1 10809 /dev/nbd0 -N nbdfileswap -s
$ sudo nbd-client 192.168.0.1 10809 /dev/nbd1 -N nbdfileext2


Now get the swap file setup:

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


And get the ext2 file system setup (you can make it ext4 if you like with -t ext4)

Code
$ sudo mke2fs /dev/nbd1 -t ext4
$ sudo mount /dev/nbd1 /mnt/c -o loop


Mount the ext2 file system on /mnt/c

Code
$ sudo mkdir /mnt/c/mydir
$ sudo chown myuseraccount /mnt/c/mydir
$ sudo chgrp myuseraccount /mnt/c/mydir


I copy a my directory of files to be compiled to my fresh ext2,.

$ cp -r ~/Downloads/mame194_extract /mnt/c/mydir
$ diff -rq /mnt/c/mydir/mame194_extract ~/Downloads/mame194_extract

and everything should be identical.

and when you're done, it's good to dismount and disconnect everything.

Disconnect the ext2 filesystem:

Code
$ sudo umount /mnt/c
$ sudo nbd-client -d /dev/nbd1


Disconnect the nbd swap

Code
$ sudo swapoff /dev/nbd0
$ sudo nbd-client -d /dev/nbd0


And when you want to close the nbd-server run netstat -tlpen and look for the program name nbd-server and kill that PID number, in this case 30947.

Code
$ netstat -tlpen
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp6       0      0 :::10809                :::*                    LISTEN      1000       2854400    30947/nbd-server    
$ kill 30947



I ran my usual compile script, but for some reason, the output mame file wasn't matching what I was expecting. Same compiler, same OS, but using the nbd as the filesystem caused different md5sums.

I ran it multiple times with redoing all the setup, fresh ext2 filesystems, and it seemed like I was getting different results every time.

I asked a question over at https://github.com/NetworkBlockDevice/nbd/issues and I was told that the compile path gets embedded into the binary.

https://reproducible-builds.org/docs/build-path/


my "normal compile directory" would be "cd /mnt/c/Downloads/mame194_extract/mame/"


Code
try 1 : directory named just mame194_extract (no Downloads/ at the head and it's 12 bytes less)

===============================================================================
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
================================================================================
EXECUTING: lsb_release -a
Distributor ID: Debian
Description:    Debian GNU/Linux 9.3 (stretch)
Release:        9.3
Codename:       stretch
================================================================================
EXECUTING: uname -a
Linux debian93silver 4.9.0-4-686 #1 SMP Debian 4.9.65-3 (2017-12-03) i686 GNU/Linux
================================================================================
EXECUTING: date
Wed Apr 18 12:55:10 PDT 2018
================================================================================

try 2  path is Downloads/mame194_extract/mame

================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877716 Apr 19 01:36 ./mame
================================================================================
EXECUTING: md5sum ./mame
1525a7a4cc4d2773031ca2627a66581c  ./mame
================================================================================

try 3  path is just Downloads/mame194_extract  (no mame at the end) note that the filesize is 4 characters less

================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877712 Apr 19 08:36 ./mame
================================================================================
EXECUTING: md5sum ./mame
f47ea376cd6fe09af8845e9fdf82e9ee  ./mame
================================================================================


try 4 path is Downloads/mame194_extract/mame  IDENTICAL MD5SUM to try 2!!!

================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877716 Apr 19 12:41 ./mame
================================================================================
EXECUTING: md5sum ./mame
1525a7a4cc4d2773031ca2627a66581c  ./mame
===============================================================================



My little lua script to add some compiling stats and write a log (now with the all important print working directory pwd!)

Code
-- compiletime.lua
-- This will take the input and print the time in seconds before the line.
-- Once complete it will print info about your system and run mame for a few seconds.
--
-- a nice compile command is something like:
-- make clean; /usr/bin/time make -j2 2>&1 | lua5.3 compiletime.lua | tee COMPILE_LOG.txt | nl




function popenstr(str) local mypipe=io.popen(str,"r") local mystr=mypipe:read("*all") mypipe:close() return mystr end

arch_table={ x86_64 = "mame64", i686 = "mame" }

for archstr,arch_mamestr in pairs(arch_table) do
  if string.find(popenstr("uname -a"),archstr) then 
      mamebinarystr = arch_mamestr 
--    print(archstr,arch_mamestr) 
  end
end

assert(mamebinarystr,"arch not detected")

donestr = "DONE - COMPILE COMPLETE"

function iif(b,t,f) if b then return t  else return f end end 

l = os.time() while true do j = io.read() k = os.time() print (k-l,iif(j==nil,donestr,j)) if j==nil then break end end 

function print_and_execute(str) print(string.rep("=",80).."\n".."EXECUTING: "..str) os.execute(str) end

print_and_execute("cat /proc/meminfo | grep \"MemTotal\"")
print_and_execute("lscpu | grep \"Model name:\"")
print_and_execute("lscpu")
print_and_execute("lspci -nn | grep -E -i \"Display|VGA\"")
print_and_execute("lspci -nn")
print_and_execute("pwd")
print_and_execute("ls -l ./"..mamebinarystr.."")
print_and_execute("md5sum ./"..mamebinarystr.."")
print_and_execute("gcc --version | head -n 1")
print_and_execute("lsb_release -a")
print_and_execute("uname -a")
print_and_execute("date")
print_and_execute("lsmod | grep \"video\\|drm\"")

mamebase = "/usr/bin/time ./"..mamebinarystr.." -seconds_to_run 7 -sdlvideofps -rompath ../../mameroms 2>&1"

mamegame = "pacman"

print_and_execute(mamebase.." "..mamegame.." -video opengl -verbose")






Re: Compile stats [Re: Golden Child] #113170
04/20/18 05:31 PM
04/20/18 05:31 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
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
================================================================================

Re: Compile stats [Re: Golden Child] #113185
04/21/18 11:02 PM
04/21/18 11:02 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
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
...

Re: Compile stats [Re: Golden Child] #113191
04/23/18 12:58 AM
04/23/18 12:58 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
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

Re: Compile stats [Re: Golden Child] #113192
04/23/18 01:35 AM
04/23/18 01:35 AM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
That seems high. What happens if it's a stripped binary with no debug symbols/symbol paths?

Re: Compile stats [Re: R. Belmont] #113193
04/23/18 02:42 AM
04/23/18 02:42 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
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
...

Re: Compile stats [Re: Golden Child] #113402
05/12/18 04:00 AM
05/12/18 04:00 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
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?

Re: Compile stats [Re: Golden Child] #113462
05/23/18 01:08 AM
05/23/18 01:08 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
And for my latest pointless compile, I wanted to see if an old Pentium II 400mhz could compile mame. It's only got 512mb ram so we'll use NBD to help out. The Dell Inspiron 7500 laptop wouldn't boot from USB since the bios doesn't support it so I installed Debian 9.4 from cd directly to the internal 10GB hard drive. It didn't have ethernet but it did have PCMCIA so I chucked a USB 2.0 PCMCIA card and used a USB ethernet card so I could get debian packages from the internet.

I had problems getting X working so I just switched to a text terminal and worked from there.



It's an order of magnitude slower and it takes 60 hours to compile. A watched pot never boils!

Code
198378	Linking mame...
217521	153726.70user 10739.85system 60:25:20elapsed 16%CPU (0avgtext+0avgdata 474592maxresident)k
217521	283493600inputs+4532320outputs (8194091major+157393150minor)pagefaults 0swaps
217521	DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:         509256 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Mobile Pentium II
================================================================================
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:                 6
Model name:            Mobile Pentium II
Stepping:              10
CPU MHz:               400.026
BogoMIPS:              800.05
Flags:                 fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pse36 mmx fxsr eagerfpu
================================================================================
EXECUTING: lspci -nn | grep -E -i "Display|VGA"
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rage Mobility AGP 2x Series [1002:4c4d] (rev 64)
================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877720 May 21 18:53 ./mame
================================================================================
EXECUTING: md5sum ./mame
7693392c7f258978b95da32a876370f0  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
================================================================================



but wait! the md5sum doesn't match the compile on my other system!

The file size is the same but the md5sum is different.

This time I decided to use git to clone the mame repository with "git clone https://github.com/mamedev/mame.git" and "git checkout mame0194".

Then I commented out the barcrest and bfm machines since I had problems compiling them on 32 bit.

So why does it differ?

It has to do with build/generated/git_desc.

In the makefile it makes git_desc, calling "git describe --dirty" and that description gets compiled into your binary.

Code
grep "git describe" makefile
NEW_GIT_VERSION := $(shell git describe --dirty)



If you uncomment the line IGNORE_GIT=1 then it will set git_desc to (unknown).


All of my other compiles had come from extracting the mame0194 zip without using git. If you do it that way, you get an (unknown) git_desc I believe.

So uncommenting IGNORE_GIT=1 in the makefile and running make again takes 6 hours 15 minutes and it reads the identical md5sum.

Code
922	Compiling generated/version.cpp...
926	Linking mame...
22549	991.58user 906.03system 6:15:49elapsed 8%CPU (0avgtext+0avgdata 468072maxresident)k
22549	42756488inputs+694864outputs (2955975major+2339412minor)pagefaults 0swaps
22549	DONE - COMPILE COMPLETE
================================================================================
EXECUTING: cat /proc/meminfo | grep "MemTotal"
MemTotal:         509256 kB
================================================================================
EXECUTING: lscpu | grep "Model name:"
Model name:            Mobile Pentium II
================================================================================
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:                 6
Model name:            Mobile Pentium II
Stepping:              10
CPU MHz:               400.026
BogoMIPS:              800.05
Flags:                 fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pse36 mmx fxsr eagerfpu
================================================================================
EXECUTING: lspci -nn | grep -E -i "Display|VGA"
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rage Mobility AGP 2x Series [1002:4c4d] (rev 64)
================================================================================
EXECUTING: ls -l ./mame
-rwxr-xr-x 1 golden golden 226877720 May 22 11:45 ./mame
================================================================================
EXECUTING: md5sum ./mame
3ad480dbe397219dc37c40b82a97029d  ./mame
================================================================================
EXECUTING: gcc --version | head -n 1
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
================================================================================
EXECUTING: lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch
================================================================================
EXECUTING: uname -a
Linux debian94golden 4.9.0-6-686-pae #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) i686 GNU/Linux
================================================================================



You're using a pentium 2 400 don't make me laugh!

Your mame compiles in 2 days and a half!

Re: Compile stats [Re: Golden Child] #113475
05/26/18 01:03 AM
05/26/18 01:03 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
Here's a list with all of the different cpus and memory sizes that I've compiled mame194 with on debian 9.3 32 bit.



Code
COREI7_2600_AT_3.40GHZ_J4.txt:2039	7329.76user 281.14system 33:58.50elapsed 373%CPU (0avgtext+0avgdata 2556336maxresident)k
COREI7_2600_AT_3.40GHZ_J4.txt:MemTotal:        3357688 kB
COREI7_2600_AT_3.40GHZ_J4.txt-================================================================================
COREI7_2600_AT_3.40GHZ_J4.txt:EXECUTING: lscpu | grep "Model name:"
COREI7_2600_AT_3.40GHZ_J4.txt:Model name:            Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
COREI7_2600_AT_3.40GHZ_J4.txt-================================================================================


CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:2479	8944.51user 340.61system 41:18.66elapsed 374%CPU (0avgtext+0avgdata 
CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:MemTotal:        3278144 kB
CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:================================================================================
CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:EXECUTING: lscpu | grep "Model name:"
CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:Model name:            Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
CORE_I5_2500_AT_2.70GHZ_8GBRAM_J4.txt:================================================================================

COREI3_2120_AT_3.3GHZ_J4.txt:3835	13185.30user 441.31system 1:03:55elapsed 355%CPU (0avgtext+0avgdata 2219012maxresident)k
COREI3_2120_AT_3.3GHZ_J4.txt:MemTotal:        3356012 kB
COREI3_2120_AT_3.3GHZ_J4.txt-================================================================================
COREI3_2120_AT_3.3GHZ_J4.txt:EXECUTING: lscpu | grep "Model name:"
COREI3_2120_AT_3.3GHZ_J4.txt:Model name:            Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
COREI3_2120_AT_3.3GHZ_J4.txt-================================================================================

CORE2_E8400_3GHZ_J2.txt:5243	9545.29user 507.76system 1:27:23elapsed 191%CPU (0avgtext+0avgdata 2556616maxresident)k
CORE2_E8400_3GHZ_J2.txt:MemTotal:        3366192 kB
CORE2_E8400_3GHZ_J2.txt-================================================================================
CORE2_E8400_3GHZ_J2.txt:EXECUTING: lscpu | grep "Model name:"
CORE2_E8400_3GHZ_J2.txt:Model name:            Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
CORE2_E8400_3GHZ_J2.txt-================================================================================


CORE2_2.13GHZ_J2_3GB.txt:14833.21user 782.10system 2:18:23elapsed 188%CPU (0avgtext+0avgdata 2556296maxresident)k
CORE2_2.13GHZ_J2_3GB.txt:MemTotal:        3097188 kB
CORE2_2.13GHZ_J2_3GB.txt-================================================================================
CORE2_2.13GHZ_J2_3GB.txt:EXECUTING: lscpu | grep "Model name:"
CORE2_2.13GHZ_J2_3GB.txt:Model name:            Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz
CORE2_2.13GHZ_J2_3GB.txt-================================================================================

ATHLON_X2_4200_J2.txt:9082	16754.18user 835.16system 2:31:23elapsed 193%CPU (0avgtext+0avgdata 2556780maxresident)k
ATHLON_X2_4200_J2.txt:MemTotal:        3108024 kB
ATHLON_X2_4200_J2.txt-================================================================================
ATHLON_X2_4200_J2.txt:EXECUTING: lscpu | grep "Model name:"
ATHLON_X2_4200_J2.txt:Model name:            AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
ATHLON_X2_4200_J2.txt-================================================================================

CORE_2GHZ_J2_3GB.txt:9398	17299.31user 894.90system 2:36:37elapsed 193%CPU (0avgtext+0avgdata 2556696maxresident)k
CORE_2GHZ_J2_3GB.txt:EXECUTING: cat /proc/meminfo | grep "MemTotal"
CORE_2GHZ_J2_3GB.txt:MemTotal:        3106644 kB
CORE_2GHZ_J2_3GB.txt-================================================================================
CORE_2GHZ_J2_3GB.txt:EXECUTING: lscpu | grep "Model name:"
CORE_2GHZ_J2_3GB.txt:Model name:            Genuine Intel(R) CPU           T2500  @ 2.00GHz
CORE_2GHZ_J2_3GB.txt-================================================================================


CORE_1.2GHZ_J2.txt:15626	27304.35user 1339.82system 4:20:25elapsed 183%CPU (0avgtext+0avgdata 1874264maxresident)k
CORE_1.2GHZ_J2.txt:MemTotal:        2059984 kB
CORE_1.2GHZ_J2.txt-================================================================================
CORE_1.2GHZ_J2.txt:EXECUTING: lscpu | grep "Model name:"
CORE_1.2GHZ_J2.txt:Model name:            Genuine Intel(R) CPU           U2500  @ 1.20GHz
CORE_1.2GHZ_J2.txt-================================================================================


XEON_2.4_2GB_J2.txt:18614	32568.25user 2098.30system 5:10:14elapsed 186%CPU (0avgtext+0avgdata 1849876maxresident)k
XEON_2.4_2GB_J2.txt:MemTotal:        2068336 kB
XEON_2.4_2GB_J2.txt-================================================================================
XEON_2.4_2GB_J2.txt:EXECUTING: lscpu | grep "Model name:"
XEON_2.4_2GB_J2.txt:Model name:            Intel(R) Xeon(TM) CPU 2.40GHz
XEON_2.4_2GB_J2.txt-================================================================================


VIA_VE900_J2_2GB.txt:18727	29077.54user 1737.50system 5:12:06elapsed 164%CPU (0avgtext+0avgdata 1639420maxresident)k
VIA_VE900_J2_2GB.txt:MemTotal:        1808424 kB
VIA_VE900_J2_2GB.txt-================================================================================
VIA_VE900_J2_2GB.txt:EXECUTING: lscpu | grep "Model name:"
VIA_VE900_J2_2GB.txt:Model name:            VIA Nano X2 L4050 @ 1.4 GHz
VIA_VE900_J2_2GB.txt-================================================================================


AMD_3500_J1_2GB_NEW_MEMORY.txt:19156	17261.50user 924.68system 5:19:15elapsed 94%CPU (0avgtext+0avgdata 1852420maxresident)k
AMD_3500_J1_2GB_NEW_MEMORY.txt:MemTotal:        2034832 kB
AMD_3500_J1_2GB_NEW_MEMORY.txt-================================================================================
AMD_3500_J1_2GB_NEW_MEMORY.txt:EXECUTING: lscpu | grep "Model name:"
AMD_3500_J1_2GB_NEW_MEMORY.txt:Model name:            AMD Athlon(tm) 64 Processor 3500+
AMD_3500_J1_2GB_NEW_MEMORY.txt-================================================================================


P4_2.4_2GB.txt:30882	28150.62user 1475.41system 8:34:41elapsed 95%CPU (0avgtext+0avgdata 1896448maxresident)k
P4_2.4_2GB.txt:MemTotal:        2066756 kB
P4_2.4_2GB.txt-================================================================================
P4_2.4_2GB.txt:EXECUTING: lscpu | grep "Model name:"
P4_2.4_2GB.txt:Model name:            Intel(R) Pentium(R) 4 CPU 2.40GHz
P4_2.4_2GB.txt-================================================================================

AMD_3500_J1_nbdswap_4G.txt:37641	19389.47user 1339.42system 10:27:20elapsed 55%CPU (0avgtext+0avgdata 448188maxresident)k
AMD_3500_J1_nbdswap_4G.txt:MemTotal:         508556 kB
AMD_3500_J1_nbdswap_4G.txt-================================================================================
AMD_3500_J1_nbdswap_4G.txt:EXECUTING: lscpu | grep "Model name:"
AMD_3500_J1_nbdswap_4G.txt:Model name:            AMD Athlon(tm) 64 Processor 3500+
AMD_3500_J1_nbdswap_4G.txt-================================================================================


EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt:44116	75574.29user 3516.67system 12:15:15elapsed 81%CPU (0avgtext+0avgdata 928748maxresident)k
EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt:MemTotal:        1020044 kB
EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt-================================================================================
EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt:EXECUTING: lscpu | grep "Model name:"
EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt:Model name:            Intel(R) Atom(TM) CPU N270   @ 1.60GHz
EEEPC900A_ATOMN270_1.60ghz_J2_1GB_NBDSWAP.txt-================================================================================



ATHLON1000_J1_2GB.txt:57018	52550.30user 2530.17system 15:50:18elapsed 21%CPU (0avgtext+0avgdata 1904392maxresident)k
ATHLON1000_J1_2GB.txt:MemTotal:        2068692 kB
ATHLON1000_J1_2GB.txt-================================================================================
ATHLON1000_J1_2GB.txt:EXECUTING: lscpu 
ATHLON1000_J1_2GB.txt:Model name:            AMD Athlon(tm) processor
ATHLON1000_J1_2GB.txt-CPU MHz:               1000.000
ATHLON1000_J1_2GB.txt-================================================================================


EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt:89591	64814.87user 3980.20system 24:53:11elapsed 28%CPU (0avgtext+0avgdata 431512maxresident)k
EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt:MemTotal:         501528 kB
EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt-================================================================================
EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt:EXECUTING: lscpu | grep "Model name:"
EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt:Model name:            Intel(R) Celeron(R) M processor          900MHz
EEEPC701_CELERON_M_900MHZ_J1_512M_NBDSWAP.txt-================================================================================





P3_933_J1_512K_NBD.txt:90737	Linking mame... (crashed during the link, so had to reboot and resume)
P3_933_J1_512K_NBD_resume.txt:14	Linking mame...
P3_933_J1_512K_NBD_resume.txt:2290	170.60user 297.71system 38:09.45elapsed 20%CPU (0avgtext+0avgdata 466176maxresident)k

90737 + 2290 = 93027 seconds = 25.84 hours

P3_933_J1_512K_NBD_resume.txt:EXECUTING: cat /proc/meminfo | grep "MemTotal"
P3_933_J1_512K_NBD_resume.txt:MemTotal:         508552 kB
P3_933_J1_512K_NBD_resume.txt-================================================================================
P3_933_J1_512K_NBD_resume.txt-EXECUTING: lscpu
P3_933_J1_512K_NBD_resume.txt:Model name:            Pentium III (Coppermine)
P3_933_J1_512K_NBD_resume.txt-CPU MHz:               931.023
P3_933_J1_512K_NBD_resume.txt-================================================================================



P2_400_NBD_COMPILE.txt:217521	153726.70user 10739.85system 60:25:20elapsed 16%CPU (0avgtext+0avgdata 474592maxresident)k
P2_400_NBD_COMPILE.txt:MemTotal:         509256 kB
P2_400_NBD_COMPILE.txt-================================================================================
P2_400_NBD_COMPILE.txt:EXECUTING: lscpu | grep "Model name:"
P2_400_NBD_COMPILE.txt:Model name:            Mobile Pentium II
P2_400_NBD_COMPILE.txt-================================================================================
P2_400_NBD_COMPILE.txt-EXECUTING: lscpu
P2_400_NBD_COMPILE.txt:Model name:            Mobile Pentium II
P2_400_NBD_COMPILE.txt-CPU MHz:               400.026



Page 1 of 3 1 2 3

Moderated by  R. Belmont 

Who's Online Now
3 registered members (robcfg, ted, Cpt. Pugwash), 125 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,606
Posts112,517
Members4,828
Most Online296
Dec 5th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.064s Queries: 14 (0.038s) Memory: 6.0104 MB (Peak: 6.4385 MB) Zlib enabled. Server Time: 2018-12-16 14:47:28 UTC