Xref: news2.mv.net comp.os.msdos.djgpp:8438 From: mlkessle AT cip DOT physik DOT uni-wuerzburg DOT de (Manuel Kessler) Newsgroups: comp.os.msdos.djgpp Subject: Re: P5 Profiling Date: 9 Sep 1996 12:32:20 GMT Organization: CipPool der Physikalischen Institute, Uni Wuerzburg Lines: 41 Message-ID: <5112ok$fsi@winx03.informatik.uni-wuerzburg.de> References: <199609061759 DOT KAA07125 AT bluesky DOT com> NNTP-Posting-Host: wpax02.physik.uni-wuerzburg.de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Kevin Baca (kbaca AT skygames DOT com) wrote: : Yesterday I asked if anyone was interested in seeing the code I use : to profile programs on Pentium machines. I got a few replies, so : here it is. : : Note: The opcodes used in the macros below (RDMSR and WRMSR) will : generate a General Protection Fault (GPF) unless they are executed at : ring 0. They run fine under Win95 DOS shells, but under plain DOS : you need to use a DPMI provider that allows your program to run in : ring 0. CWSDPMI does NOT allow your program to run in ring 0, but : CWSDPR0 does. Look at my batch file below to see how to tell your : program to use CWSDPR0. Be aware that CWSDPR0 does not support : virtual memory. I haven't tried this stuff under any other DPMIs : except Win95 and CWSDPR0. I'd be interested to know if it works : under others (i.e. QEMM and Windows NT). [SNIP] I made some patches for CWSDPMI (the ring 3 DPMI provider) to support the RDMSR/WRMSR/RDTSC instructions. So you get the best of both: virtual memory support AND profiling capabilities. The downside is, you have to run CWSDPMI in a HIMEM-only environment, no V86-managers like EMM386 etc. But its fine for me, because i'm currently working on pentium optimized BLAS, so i need virtual memory and profiling. If anyone is interested, feel free to email me, so i can mail you the sources OR visit my homepage, but not before tomorrow, as i don't have the patches at hand. Special hint to Charles W. Sandman: is it possible or worth to get this into the next release of CWSDPMI, at least as a compile-time option? And, of course, many thanks for this great piece of code! Ciao, Manuel -- Manuel Kessler Graduate Student at University of Wuerzburg, Germany, Physics Department SNAIL: Zeppelinstrasse 5, 97074 Wuerzburg, Germany EMAIL: mlkessle AT cip DOT physik DOT uni-wuerzburg DOT de WWW: http://www.cip.physik.uni-wuerzburg.de/~mlkessle