Date: Sun, 29 Mar 1998 21:47:40 -0600 (CST) From: Joi Ellis To: mushhacks@caisr2.caisr.cwru.edu Cc: "Tina E. Verras" Subject: Profiling Mushcode V2 After the sudden interest in the Profiler project I've been toying with, I got out my old K&R books and started messing around with the hardcode. I now have a patch for stock TinyMUSH 2.2.3 that adds the following: @admin log=profile (enables profiler data in the log) @set =profile (enables profiling of a specific object) @set =profile (enables profiling of all a player's code) The patch file can be found at: http://www.visi.com/~gyles19/patches/sprof.patch Only the god may use these commands, for obvious reasons. Here's a sample, truncated for brevity: 980329.191126 TestMush CMD/PROF : Ship(#108)[Joi(#21)] ticks 1 (enactor #21): @switch/first... This is tested on Linux, using a common library call "times". The Linux clock tick appears to be 10ms, which is still pretty coarse, but it's better than 1 second! Only commands that are run from the queue are logged, and only for objects/players flagged PROFILE(o), so privacy concerns should be minimal, and the log files won't instantly fill your disk partition. I still need to rewrite my perl script to read this output format, and make use of the ticks values in some reasonable way. The benefit of this patch over the original idea is that the god can enable profiling logging only for specific objects. Using CMD/ALL output logs a lot more junk that has to be sorted through, and there are those who are concerned about privacy invasions with CMD/ALL. (For what it's worth, on my system configure doesn't get the dbm support quite right. What it suggests will compile and link, but it dies at the first ndbm call. If I leave the "HAVE_NDBM 1" in autoconf.h alone, but change the Makefile to read "-lgdbm" instead of "-lndbm" then it works fine. Apparently the Linux libraries in RedHat have NDBM compatibility calls within the gdbm library that configure doesn't account for?) -- Joi Ellis joi.ellis@cdc.com gyles19@nospam.visi.com, http://www.visi.com/~gyles19/ --