102 TMSG(COLD_CODE,
" --fixing up current intervals with the warm interval");
106 if (ra_offset == 0) {
107 TMSG(COLD_CODE,
" --warm code calling routine has offset 0," 108 " so no action taken");
111 TMSG(COLD_CODE,
" --updating sp_ra_pos with offset %d",ra_offset);
117 }
while (intv != current && (intv =
UWI_NEXT(intv)));
124 void *ins = iarg->
ins;
125 char *ins_end =
nextInsn(iarg, xptr);
126 if (ins_end == iarg->
end) {
130 if (branch_target ==
NULL)
return false;
133 if (branch_target < iarg->beg || iarg->
end <= branch_target) {
135 TMSG(COLD_CODE,
"potential cold code jmp detected in routine starting @" 136 " %p (location in routine = %p)",iarg->
beg,ins);
140 EMSG(
"Weird result! jmp @ %p branch_target %p has no function bounds",
146 if (branch_target == beg) {
147 TMSG(COLD_CODE,
" --jump is a regular tail call," 148 " NOT a cold code return");
173 xed_decoded_inst_t
xedd;
174 xed_decoded_inst_t *xptr = &
xedd;
175 xed_error_enum_t xed_error;
177 xed_decoded_inst_zero_keep_mode(xptr);
178 void *possible_call = loc - 6;
179 void *routine = iarg->
beg;
180 xed_error = xed_decode(xptr, (uint8_t *)possible_call, 15);
182 TMSG(COLD_CODE,
" --trying to confirm a cold code 'call' from addr %p",
184 if (xed_error != XED_ERROR_NONE) {
185 TMSG(COLD_CODE,
" --addr %p has xed decode error when attempting confirm",
190 xed_iclass_enum_t xiclass = xed_decoded_inst_get_iclass(xptr);
196 case XED_ICLASS_JNBE:
198 case XED_ICLASS_JNLE:
205 case XED_ICLASS_JRCXZ:
208 TMSG(COLD_CODE,
" --conditional branch confirmed @ %p", possible_call);
210 TMSG(COLD_CODE,
" --comparing 'call' to %p to start of cold path %p",
212 return (the_call == routine);
215 TMSG(COLD_CODE,
" --No conditional branch @ %p, so NOT a cold call",
219 EMSG(
"confirm cold path call shouldn't get here!");
#define UWI_RECIPE(btuwi)
bool uw_recipe_map_lookup(void *addr, unwinder_t uw, unwindr_info_t *unwr_info)
static char * nextInsn(uint32_t *insn)
xed_control_t x86_decoder_settings
static bool confirm_cold_path_call(void *loc, interval_arg_t *iarg)
void * x86_get_branch_target(void *ins, xed_decoded_inst_t *xptr)
static xed_decoded_inst_t xedd
bool hpcrun_is_cold_code(xed_decoded_inst_t *xptr, interval_arg_t *iarg)
bitree_uwi_t unwind_interval
void hpcrun_cold_code_fixup(unwind_interval *first, unwind_interval *current, unwind_interval *warm)