source: trunk/doc/Logging.txt@ 10367

Last change on this file since 10367 was 7425, checked in by phaller, 24 years ago

.

File size: 3.1 KB
RevLine 
[7425]1/* $Id: Logging.txt,v 1.2 2001-11-22 11:48:55 phaller Exp $ */
[3811]2
[7425]3 Odin Logging and Profiling
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~
[3811]5
61.0 Standard logging feature
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
9The alpha 5 binaries and daily build zipfiles can generate logfiles to show
10what a win32 application is doing. This can be very useful to determine
11why certain applications don't run correctly.
12
13The major disadvantage of loggging is the overhead. Therefor it has been
14disabled by default in the alpha 5 release and daily builds.
15To enable logging set the environment variable WIN32LOG_ENABLED:
16 SET WIN32LOG_ENABLED=1
17
18To disable logging again, you must clear this variable:
19 SET WIN32LOG_ENABLED=
20
21
222.0 Extended logging features (new as of February 16th)
23~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24
25Disabling or enabling logging for all the Odin dlls isn't always useful.
26To make logging more flexible, you can now disable or enable separate
27source files for each dll (NOTE: Only implemented in kernel32, user32 & gdi32
28for now)
29
30Each dll that supports this feature has a file called dbglocal.cpp in it's
31source directory. It contains a listing of all the sources files for that dll
32(DbgFileNames) and an array with boolean values for each of those files.
33To add this feature to a dll, you must do the following:
34 - Write a custom dbglocal.cpp & dbglocal.h.
35 - Every source file must include dbglocal.h with the correct debug constant:
36 #define DBG_LOCALLOG DBG_directory
37 #include "dbglocal.h"
38 - Initterm.cpp must call ParseLogStatus when the dll is loaded
39
40Each dprintf now first checks if logging is enabled for this sourefile before
41calling WriteLog. (NOTE: dbglocal must be included *after* misc.h)
42
43When building a debug version of a dll, logging is enabled for all source files
44by default.
45
462.1 Examples of custom logging
47~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
49Disable logging for kernel32, but enable it for profile.cpp & wprocess.cpp
50 set dbg_kernel32=-dll +profile +wprocess
51
52
53Enable logging for kernel32, but disable it for profile.cpp & wprocess.cpp
54 set dbg_kernel32=+dll -profile -wprocess
55
[7425]56
573.0 ODIN Profiler
58~~~~~~~~~~~~~~~~~
59
60If the ODIN executables are compiled with IBM VisualAge C++ 3.08 and
61the generation of profile hooks is enabled (/Gh+), the runtime library
62ODINCRTP will reroute the _ProfileHook32 calls to the ODINPROF library.
63This is done by some sophisticated stack trickery.
64ODINPROF will be called upon each entry and exit of compiled C functions and
65C++ member functions. The profiler will then try to load the symbolic debug
66information file according to the module name (i. e. KERNEL32.sym) and
67lookup the symbol name according to the function's entry address. C++ name
68demangling is done automatically.
69If this fails, the profiler will auto-generate symbolic names.
70If a symbol table could be loaded, but the address looked for could not be
71found exactly in the debug information, the profiler will revert to the
72closest symbol found and add the address difference as an offset suffix.
73(i. e. _MyAPI@4+1234h)
74
75Upon process termination the profiler will yield a file named '<pid>.prof'.
76It will contain a number of sorted tables about the collected performance
77data.
78
79
Note: See TracBrowser for help on using the repository browser.