I thought it would be interesting to get these running on Mac OS X/ PPC since there's no Darwin makefile included in the release. I had to hack the scripts to get it working though and the tests ran, not without their own problems. Firstly, the changes made to get them *working* in OS X:

$ diff Makefile.Darwin Makefile.Linux
42,44c42
<       atomic          \
<       getcontext      \
<       setcontext
---
>       atomic
47c45
< include ../Makefile.com.Darwin
---
> include ../Makefile.com

I used the Linux makefile as a basis since it contained the least amount of compiler flags and gcc is the c compiler most will use on both systems. Notice the added getcontext and setcontext tests to the elided benchmarks list.

$ diff Makefile.com Makefile.com.Darwin
112c112
<       $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm
---
> $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a - lSystem -lm

It seems like rt isn't available on Darwin (at least not on Mac OS X 10.4.1), so I used System as per the suggestion found here http:// www.eca.cx/ecasound-list/2004/10/0056.html. It compiled fine, but I'd like suggestions on this.

$ diff Makefile ../libMicro-0.3.0.orig/Makefile
72c72
< @mkdir -p bin-`arch`; cd bin-`arch`; MACH=`arch` $(MAKE) - f ../Makefile.`uname -s` $@
---
> @mkdir -p bin-`uname -m`; cd bin-`uname -m`; MACH=`uname -m` $(MAKE) -f ../Makefile.`uname -s` $@

$ diff wrapper ../libMicro-0.3.0.orig/wrapper
37c37
< ARCH=`arch`
---
> ARCH=`uname -m`

$ diff bench ../libMicro-0.3.0.orig/bench
70c70
< ARCH=`arch`
---
> ARCH=`arch -k`
94c94
< printf "!Processor:    %30s\n" `arch`
---
> printf "!Processor:    %30s\n" `uname -m`

This was a big annoyance. uname -m on OS X/PPC returns "Power Macintosh", and the scripts couldn't cope with the space (especially with copy commands in there!). arch seems to be a decent substitute, but it doesn't take any arguments on OS X so I also had to replace the arch -k in bench.

So the tests compiled and ran, but as soon as I got to the fork I got resource temporarily unavailable messages (as in the snippet below). Now I would've expected this to be because of the low(ish) maxproc and maxprocperuid limit in OS X, so I bumped them up to

kern.maxproc=2048
kern.maxprocperuid=512

with still no luck. Can someone tell me what this setting is in Solaris? I should post this on the Darwin mailing lists but I thought I'd share my experience with you guys first.

stderr output from bench script:

$ ./bench > output
./bench: line 1: getent: command not found
Running:              getpid for      0.27820 seconds
Running:              getenv for      0.44817 seconds
Running:            getenvT2 for      0.80234 seconds
Running:        gettimeofday for      1.15904 seconds
Running:                 log for      0.03127 seconds
Running:                 exp for      0.03085 seconds
Running:             lrand48 for      0.30696 seconds
...
Running:          c_lockf_10 for      0.50919 seconds
Running:         c_lockf_200fork: Resource temporarily unavailable
Running:             c_flockfork: Resource temporarily unavailable
Running:          c_flock_10fork: Resource temporarily unavailable
Running:         c_flock_200fork: Resource temporarily unavailable
Running:           c_fcntl_1fork: Resource temporarily unavailable
Running:          c_fcntl_10fork: Resource temporarily unavailable
Running:         c_fcntl_200fork: Resource temporarily unavailable
...


Darwin kernel revision:

$ uname -a
Darwin Ben-Cooper.local 8.2.0 Darwin Kernel Version 8.2.0: Fri Jun 24 17:46:54 PDT 2005; root:xnu-792.2.4.obj~3/RELEASE_PPC Power Macintosh powerpc

Cheers,
Ben

On 06/08/2005, at 4:36 AM, Bart Smaalders wrote:

I've finally got libMicro (the portable OS microbenchmarks
Phil Harman and I put together during Solaris 10 development)
into good enough shape for others to play with.... and all
the files appropriately CDDL'd and otherwise made to feel
comfortable :-).

There's now a rough libMicro page in the perf community
w/ a tarball.

Do remember, of course, that current OpenSolaris bits
are debug, so performance measurements are problematic
except with respect to comparisons against another build
of OpenSolaris.

Have fun -

- Bart

--
Bart Smaalders            Solaris Kernel Performance
[EMAIL PROTECTED]        http://blogs.sun.com/barts
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org


Ben Cooper
Quality Control Analyst
Whitesmiths Pty Ltd
Tel: +61 2 8912 1774
Fax: +61 2 8912 1701
Email: [EMAIL PROTECTED]

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Whitesmiths. Finally, the recipient should check this email and any attachments for the presence of viruses. Whitesmiths accepts no liability for any damage caused by any virus transmitted by this email.



_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to