#ifdef CONFIG_DYNAMIC_FTRACE /* save value to addr - it is save to do it in asm */ staticint ftrace_modify_code(unsignedlong addr, unsignedint value)
{ int faulted = 0;
int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, unsignedlong addr)
{ /* we have this part of code which we are working with *b000c000imm-16384 *b9fc8e30bralidr15,-29136// c0008e30 <_mcount> *80000000orr0,r0,r0 * *Thefirstsolution(!USE_FTRACE_NOP-couldbecalledbranchsolution) *b000c000bri12(0xC-jumptoanyotherinstruction) *b9fc8e30bralidr15,-29136// c0008e30 <_mcount> *80000000orr0,r0,r0 *anyotherinstruction * *Thesecondsolution(USE_FTRACE_NOP)-nojumpjustnops *80000000orr0,r0,r0 *80000000orr0,r0,r0 *80000000orr0,r0,r0
*/ int ret = 0;
#ifdef USE_FTRACE_NOP
ret = ftrace_modify_code(rec->ip, MICROBLAZE_NOP);
ret += ftrace_modify_code(rec->ip + 4, MICROBLAZE_NOP); #else/* USE_FTRACE_NOP */
ret = ftrace_modify_code(rec->ip, MICROBLAZE_BRI); #endif/* USE_FTRACE_NOP */ return ret;
}
/* I believe that first is called ftrace_make_nop before this function */ int ftrace_make_call(struct dyn_ftrace *rec, unsignedlong addr)
{ int ret;
pr_debug("%s: addr:0x%x, rec->ip: 0x%x, imm:0x%x\n",
__func__, (unsignedint)addr, (unsignedint)rec->ip, imm);
ret = ftrace_modify_code(rec->ip, imm); #ifdef USE_FTRACE_NOP
pr_debug("%s: bralid:0x%x\n", __func__, bralid);
ret += ftrace_modify_code(rec->ip + 4, bralid); #endif/* USE_FTRACE_NOP */ return ret;
}
int ftrace_update_ftrace_func(ftrace_func_t func)
{ unsignedlong ip = (unsignedlong)(&ftrace_call); unsignedint upper = (unsignedint)func; unsignedint lower = (unsignedint)func; int ret = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.