core/kernel_linux/clients/umbra/instrument.c
/* This function decide if the instrumentation should be performed
 * There are several cases that the instrumentation should be performed
 * 1. if there is memory reference (could be optimized to merge together)
 *    context switch, update, lookup
 * 2. if aflags is restored later, it might be saved 
 * 3. if reg_addr is updated
 */
This function decide if the instrumentation should be performed
There are several cases that the instrumentation should be performed
1. if there is memory reference (could be optimized to merge together)
context switch, update, lookup
2. if aflags is restored later, it might be saved
3. if reg_addr is updated
This function decide if the instrumentation should be performed There are several cases that the instrumentation should be performed 1 . if there is memory reference ( could be optimized to merge together ) context switch update lookup 2 . if aflags is restored later it might be saved 3 . if reg_addr is updated
static bool
should_start_instrumentation(ilist_info_t  *ilist_info,
                             instr_t       *prev, 
                             instr_t       *where,
                             umbra_client_t *client)
{
    bool   instrument = false;
    app_pc pc;
    pc = instr_get_app_pc(where);
    if (should_instrument_update(ilist_info, where, client))
        instrument = true;
    if (should_instrument_context_switch(ilist_info, prev, where, client))
        instrument = true;
    return instrument;
}
static bool should_start_instrumentation ( ilist_info_t * ilist_info , instr_t * prev , instr_t * where , umbra_client_t * client ) { bool instrument = false ; app_pc pc ; pc = instr_get_app_pc ( where ) ; if ( should_instrument_update ( ilist_info , where , client ) ) instrument = true ; if ( should_instrument_context_switch ( ilist_info , prev , where , client ) ) instrument = true ; return instrument ; }
This function decide if the instrumentation should be performed
 There are several cases that the instrumentation should be performed
 1. if there is memory reference (could be optimized to merge together)
    context switch, update, lookup
 2. if aflags is restored later, it might be saved
 3. if reg_addr is updated
This function decide if the instrumentation should be performed There are several cases that the instrumentation should be performed 1 . if there is memory reference ( could be optimized to merge together ) context switch update lookup 2 . if aflags is restored later it might be saved 3 . if reg_addr is updated
/* if there is an interested memory reference,
     * insert context switch, lookup, and update code 
     */