Difference between revisions of "AIX Instrumentation - Special Considerations"

From OC Systems Wiki!
Jump to: navigation, search
(Created page with "== Overview == The process of "Sacrificing" functions during the instrumentation phase of Aprobe startup refers to the relocation of function CSects on AIX in order that code...")
 
(No difference)

Revision as of 15:38, 13 June 2019

Overview

The process of "Sacrificing" functions during the instrumentation phase of Aprobe startup refers to the relocation of function CSects on AIX in order that code patches are reachable in a single branch instruction. The function is still available to be called either from the application or probes. This operation is not performed on x86 Linux executables.

Messages about sacrificing functions are an indication aprobe is having difficulty allocating patch areas.

Investigating and Addressing Patch Allocation Issues

You can get some information about patching -v. Adding the debug flag (-!) will give info about patchareas.

You can tell Aprobe which function symbols to sacrifice ahead of time using this kind of probe:

extern void ap_SacrificeFunctionForPatchArea(ap_FunctionIdT FunctionId);

static Sacrifice(ap_NameT FunName)
{
   ap_SymbolIdT sym =
      ap_SymbolNameToId(ap_ApplicationModuleId(),
                        FunName,
                        ap_NoName,
                        ap_FunctionSymbol);
   ap_SacrificeFunctionForPatchArea(ap_SymbolToFunction(sym));
}


probe program
{
   on_entry
   {
      Sacrifice("proc58");
      Sacrifice("proc68");
      Sacrifice("proc78");
      Sacrifice("proc88");
      Sacrifice("proc98");
   }
}

Sacrificing really depends on how the modules are laid out. You can disable patchareas with APROBE_DISABLE_PATCHAREA=TRUE.