• Heiko Carstens's avatar
    s390/ftrace: fix mcount adjustment · aca91209
    Heiko Carstens authored
    Tony Jones reported that the ftrace self tests on s390 do not work:
    
    <6>Testing dynamic ftrace ops #1: (0 0 0 0 0) FAILED!
    <6>Testing tracer irqsoff:
    <3>failed to start irqsoff tracer
    <4>.. no entries found ..FAILED!
    <6>Testing tracer wakeup:
    <3>failed to start wakeup tracer
    <4>.. no entries found ..FAILED!
    <6>Testing tracer function_graph:
    <4>Failed to init function_graph tracer, init returned -19
    <4>FAILED!
    
    This happens because we forgot to adjust the instruction pointer that gets
    passed to the ftrace trace function by MCOUNT_INSN_SIZE.
    
    In addition change MCOUNT_INSN_SIZE to the correct value on 31 bit.
    It only worked so far because the to be patched instruction was identical.
    Reported-by: default avatarTony Jones <tonyj@suse.com>
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    aca91209
ftrace.c 5.11 KB