home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
fpdemo.zip
/
README
< prev
Wrap
Text File
|
1994-02-23
|
7KB
|
150 lines
********************
** Introduction **
********************
Footprints 1.0 has been in use since early 1992 at petrochemical
refineries in France, Italy, Canada, and here in Houston. It was
conceived by a group of HSS developers who wanted to avoid the
excessive overhead associated with the frequent file I/O of
conventional tracing techniques. We were developing an I/O Driver
that was a crucial link between an OS/2 1.3 gateway (to a
mainframe) and a process plant instrumentation system. The IOD
had to handle thousands of transactions per second for 24 hours
a day, so any delays would significantly hinder performance. In
addition to the demands imposed by a realtime system, all the I/O
Driver code was developed in the lab using only simulators in place
of the instrumentation system; once installed, the IOD would be
difficult to support without expensive plant visits.
So Footprints was developed to enable HSS developers to trace
and debug different sections of code dynamically, without
recompiling to go from debug code to production code and back
again. We couldn't use a debugger during the development phase
of projects, because other timing dependent code would crash if
we slowed a thread down to a crawl. And, after we installed the
code, and a user in Europe called us, we were able to tell him to
turn on a specific trace ids from the external Footprints interface
while his process was running, duplicate his problem, and send us
the trace file. All without slowing, stopping, or restarting his
process. This made the customer happy, because his productivity
wasn't affected while we were trying to solve a problem, and it
made us happy, because we were able to get an accurate picture
of exactly what code was executed at the plant when the reported
problem occurred.
Footprints 2.0 is the commercial release of this product. While the
internals are the same as those in the original utility, the code has
been migrated to 32-bit and the interface has been upgraded to
Presentation Manager.
How It Works
------------
Footprints consists of a DLL and a PM executable. The DLL
contains four API calls that developers use to implement tracing.
The calls are simple: there is an Initialize and a Terminate, there
is a Trace, and a Check Trace id routine. The executable simply
sets any of 64 trace ids, monitors trace activity, and creates
archive files of traced data.
Your program will use the DLL to implement tracing. You first call
our initialization routine, HfpInit; this will set up a 64K buffer in
named shared memory and an output file for your traces, and it will
return a handle to you. You can then call HfpTrace using the
handle, passing a pointer, a length argument, and eight character
label, and a trace id number. HfpTrace will check the trace id (a
single bit in shared memory) and return immediately if it is not set.
If it is set, the data to be traced is written to the 64K trace buffer.
This is fast, because during runtime, you can leave the HfpTrace
calls in your code, and it costs you only a few machine instructions
to check the bit and return. Once you want to actually trace, you
bring up the executable and set the trace bits in which you're
interested.
There are 64 optional trace bits that you can use. Which ones you
use is up to you. If you have a very large complex program, you
may want to use a different trace bit for each task in the program;
bit 1 can trace file I/O and bit 2 your RS-232 connection, for
example. If you wish to use the trace facility for an error log, you
can pass zero as the trace id, and the data passed to HfpTrace will
always be captured. Or, if you do not want to rely simply on the
hex and ASCII character dump that HfpTrace generates, you can
use the HfpIsItOn function. This can be used anywhere you
normally use the #ifdef DEBUG or #ifdef SIMULATOR
preprocessor directives. So, instead of defining debug or simulator
situations and recompiling to test code, you can use HfpIsItOn to
check a trace bit that you can set externally while your program is
running. If the bit is on, you can write out information to a file in
debugging situations, or call simulation stubs if you are in
simulation mode. When you get to production mode, you do not
have to change your code or recompile; you simply leave the trace
bit turned off.
Operating Environment
---------------------
Footprints currently works with OS/2 version 2.0 and up. It
supports both 16-bit and 32-bit compilers.
This Demo Package
-----------------
This demo does not contain the DLL that the above documentation
mentions (otherwise, you would have nearly the whole product!).
the two demonstration programs, mtfp.exe and fpdemo.exe illustrate
how one would use Footprints to trace different sections of code
dynamically. MTFP.EXE (see MTFP.C) illustrates using different
trace bits to trace and identify different threads that are
executing simultaneously. FPDEMO.C shows Footprints in a PM
environment, while taking a user through the steps involved with
setting and monitoring traces.
Instructions
------------
All you have to do is designate a directory as your FOOTPATH. This
is where all Footprints trace files and trace bit options files
reside. In your CONFIG.SYS, add the line
SET FOOTPATH=c:\traces
where you put the directory path in place of c:\traces above.
You must then reboot. Now, try running FP.EXE, and going through
FPDEMO.EXE. Look at the code (FPDEMO.C). If you think you have
a grasp of it, check our MTFP.EXE and MTFP.C. Run MTFP, and turn on
and off different trace bits, and look at the monitor window. When
you are done, create a history file. Or, create a history file
while MTFP.EXE is running.
========================
=== Happy debugging! ===
========================
Ordering
--------
If you would like to order Footprints, give us a call at (713)
871-1448 during regular business hours, or fax an order to us
at (713) 871-1449. Be sure to have MC/Visa/Discover credit
card number and expiration date ready. The price is $59 +
$5.95 for shipping anywhere in the United States. Add $1
for shipping to Canada, and $2 for shipping overseas.
You may also Email us at 76636,662 on Compuserve, or
usib5srq@ibmmail.com via Internet. We would love to answer
any questions you may have.
By the Way
----------
By the way, Footprints is a trademark of Hardy Software
Systems, Inc.
License Agreement
-----------------
This program product is the property of Hardy Software
Systems, Inc., and is licensed for your use as a demonstration.
You may distribute this demo all you want in its zipped format.
Just don't try to disassemble it or recreate the DLL.
You may not distribute FP.EXE to users who have the Footprints
DLL, which is distributed by licensed users of Footprints.
If you have FP.EXE and the Footprint DLL, you owe us
fifty nine bucks.
If you disagree with this license agreement, or are unable
to abide by it, destroy all copies of Footprints code in your
possession.