# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/samples/ahafs/samplePrograms/kextEvProd/README.howToTest 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2009 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
 THE SOURCE CODE EXAMPLES PROVIDED ARE ONLY INTENDED TO ASSIST IN THE
 DEVELOPMENT OF A WORKING SOFTWARE PROGRAM.  IN ADDITION, THE SOURCE
 CODE EXAMPLES MAY NOT COMPILE AND/OR BIND SUCCESSFULLY AS WRITTEN.

 INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOURCE CODE
 EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT
 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
 LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
 OF THE SOURCE CODE EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS,
 IS WITH YOU.  SHOULD ANY PART OF THE SOURCE CODE EXAMPLES PROVE
 DEFECTIVE, YOU (AND NOT IBM OR AN AUTHORIZED DEALER) ASSUME THE ENTIRE
 COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

 No warranty is given that the contents of the source code examples, whether
 individually or as one or more groups, will meet your requirements or that
 the source code examples are error-free.

This README file is provided for customers to build the sample kernel-extension
event-producer provided (testKext) and test it.
------------------------------------------------------------------------
Steps:
0) Use the "Makefile" to build the testKext if it is not built.

1) As a root user, load the kernel extension by typing:
    ./kexload -l testKext

2) Check the availability of the event producer "sampleKextEvProd" by typing:
    cat /aha/evProds.list
   
   Sample output is:
        sampleKextEvProd   <<<<< Note this
        vmo
        waitTmPgInOut
        waitersFreePg
        schedo
        waitTmCPU
        modFile
        utilFs

3) Start monitoring the event as a consumer from another window, by typing:
    /usr/samples/ahafs/bin/aha -m /aha/sampleKextEvProd.monFactory/sampleKextEvent.mon

4) Trigger the event by typing:
     ./triggerEvent

5) The consumer should see an output like this:

   The event corresponding to the AHA node \
     /aha/sampleKextEvProd.monFactory/sampleKextEvent.mon has occurred.

        BEGIN_EVENT_INFO
        RC_FROM_EVPROD = 0

        User Info     : userName=root, loginName=root, groupName=system
        Process ID    : 438410
        Program Name  : triggerEvent
        Time          : Wed Jul 29 11:30:37 2009

        Stack Trace   :
        aha_cbfn_wrapper+30
        ahafs_evprods+4D8
        _trigger_event+A8
        trigger_event+14
        .svc_instr
        main+30
        __start+70
        END_EVENT_INFO

6) Unload the kernel extension by typing:
     ./kexload -u testKext

7) To verify that the event producer "sampleKextEvProd" is no more available, type:
     cat /aha/evProds.list

