2.4.4 example
Using AMPolice's APIs is very simple
1. Make code changes
2. Adjust compile time settings
3. Compile and run with default options
code changes
Code Changes
/* start */
int returnedid = mpapistart(apiid);   //int apiid =  use case id
if (retrunedid!=apiid)
           // do some error processing and Return
//Do some processing on the use case
//e.g. a transaction
/* stop */
const struct mpapi *papi;    // Prepare for the stopping
void *const *pbt;                // Prepare for the stopping
papi = mpapistop(apiid);   // Do a actual stop
if (papi==NULL)
      // do error processing and return
// ampolice have returned the array of ampai structs and now you can do processing over them
     for (; papi->addr; ++papi)
               fprintf(stderr, "%08X %6d -->", papi->addr, papi->size);
               for (pbt = papi->pbtrace; *pbt; ++pbt)
               fprintf(stderr, " %08X", *pbt);
               fprintf(stderr, "\n");
Compile time changes
Compile settings
Run time changes
There are no run time changes u still will have to use the default settings for starting up the application .. i.e.
/home/avasup/ampolice/ampoliceV1.5/ampolice -L /home/avasup/ampolice/ampoliceV1.2  -f /tmp/amplog -n 7  -t -y ex  /ama/obe/PPT/etk/cdb/pack/MDW/bin/otf_be $@
only thing that you do is to omit the library path under the "-L" option , as the reason that your code is already linked with the amplib