The second commit in this batch is most significant one ... the commit
message is the closest this will get to a "man" page for some time (like
forever).
Asbestos suit on, expecting incoming flame-throwers.
Changes committed to git://oss.sgi.com/kenj/pcp.git pcp4
(note this is the pcp4 branch)
src/include/GNUmakefile | 2 GNUlocaldefs.coverage
src/include/fault.h | 53 ++++++
src/include/impl.h | 1
src/include/pmapi.h | 1
src/libpcp/src/AF.c | 8
src/libpcp/src/GNUlocaldefs.coverage | 11 +
src/libpcp/src/GNUmakefile | 5
src/libpcp/src/derive.c | 2
src/libpcp/src/err.c | 10 -
src/libpcp/src/events.c | 35 +++-
src/libpcp/src/fault.c | 283 +++++++++++++++++++++++++++++++++++
src/pmdbg/pmdbg.c | 2
12 files changed, 394 insertions(+), 19 deletions(-)
commit 7c3c49ba04f5f366d076eeb3b7a5f5d60efa5d28
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Fri Sep 2 17:50:24 2011 +1000
libpcp/src/GNUlocaldefs.coverage - QA builds
Shows how to build libpcp for coverage analysis and fault injection.
commit 3b31b66bfd80af6fcef270d3f119c08af32cd005
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Fri Sep 2 17:38:48 2011 +1000
Error Injection Infrastracture for QA
As part of the coverage-driven changes to QA in PCP 4.0, it has become
apparent that we're going to need someway to exercise the "uncommon"
code paths associated with error detection and recovery.
These changes introduce an error injection infrastructure (for libpcp
only at this stage, alhough the mechanism is far more general and could
easily be extended).
If (and only if) libpcp is built with -DPM_FAULT_INJECTION then
the following become available via a new header "fault.h" that
is included in the source tree, but not installed
+ __pmFaultInject(char *ident, int class)
Defines a fault point at which a fault of type class may be injected.
- ident is a string to uniquely identify the fault point ... something
like "libpcp/" __FILE__ ":<number>" works fine
- class is a class of failure ... the following are currently
defined:
. PM_FAULT_ALLOC will cause the next call to malloc() or strcpy()
(as proof of concept, other alloc routines could be added) to return
NULL and set errno to ENOMEM.
. PM_FAULT_PMAPI will cause the next call to a PMAPI routine (at the
moment just __pmRegisterAnon() is supported as a proof of concept)
to return PM_ERR_FAULT
- Fault injection cannot be nested. Each call to __pmFaultInject()
clears any previous fault injection that has not yet been done.
+ PM_FAULT_POINT(ident, class)
A macro, with PM_FAULT_INJECTION defined this becomes a call to
__pmFaultInject(), otherwise PM_FAULT_POINT() emits no code.
Throughout libpcp we use PM_FAULT_POINT() and NOT __pmFaultInject().
+ PM_FAULT_CHECK(class)
A macro that emits no code unless PM_FAULT_INJECTION is defined, in
which case if a fault of type class has been injected, the enclosing
routine will return immediately with the value PM_ERR_FAULT ...
assuGNUlocaldefs.coveragemes
the enclosing routine is of type int foo(...) like all of the PMAPI
routines.
+ __pmFaultSummary(void)
Report a summary of fault points seen and faults injected.
Faults are ENABLED using a control file, identified by the environment
variable $PM_FAULT_CONTROL which contains lines of the form:
<ident> <op> <number>
that define injection guards.
This file (if it exists) is read the first time __pmFaultInject()
is called. Within the control file, blank lines are ignored and lines
beginning with # are treated as comments.
<ident> is fault point string (as defined by a call to __pmFaultInject(),
or more usually the PM_FAULT_POINT() macro).
<op> is one of the C-style operators >=, >, ==, <, <=, !=, %
<number> is an unsigned integer
<op> <number> is optional, the default is >0
The semantics of the injection guards are: each time __pmFaultInject() is
called for a particular <ident>, a trip count is incremented (the first
trip is 1); if the C-style expression <tripcount> <op> <number> has the
value 1 (so true for most <op>s, remainder == 1 for the % <op>), then
a fault of the class defined for the fault point associated with <ident>
will be injected.
Additional tracing (via -Dfault and DBG_TRACE_FAULT) and a special
additional PMAPI error code (PM_ERR_FAULT) are also added, although
these will only ever be seen or used if libpcp has been built with
-DPM_FAULT_INJECTION. If DBG_TRACE_FAULT is set the first time
__pmFaultInject() is called, then __pmFaultSummary() will be called
when the application exits (via atexit()).
Examples:
libpcp/src/derive.c: PM_FAULT_CHECK()
libpcp/src/err.c: PM_FAULT_POINT()
libpcp/src/events.c: PM_FAULT_POINT()
libpcp/src/fault.c: the underlying implementation
QA/477 and QA/478: control file use
commit 31fb4c6b956c4ee10951037a6ee810d5c00c3a42
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Tue Aug 30 12:10:14 2011 +1000
libpcp/GNUmakefile - better integration with GNUlocaldefs
When using GNUlocaldefs, want "clean" to remove fluff from GNUlocaldefs
as well as the regular fluff.
commit e3a327b45e49a5a89ce13f299108af9babebfae1
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Tue Aug 30 12:08:54 2011 +1000
libpcp/AF.c - minor changes
Found in coverage analysis ... consistent use of minimum timeout
setting and small printf formatting change.
|