• Qing Zhang's avatar
    LoongArch/ftrace: Add basic support · dbe3ba30
    Qing Zhang authored
    This patch contains basic ftrace support for LoongArch. Specifically,
    function tracer (HAVE_FUNCTION_TRACER), function graph tracer (HAVE_
    FUNCTION_GRAPH_TRACER) are implemented following the instructions in
    Documentation/trace/ftrace-design.txt.
    
    Use `-pg` makes stub like a child function `void _mcount(void *ra)`.
    Thus, it can be seen store RA and alloc stack before `call _mcount`.
    Find `alloc stack` at first, and then find `store RA`.
    
    Note that the functions in both inst.c and time.c should not be hooked
    with the compiler's -pg option: to prevent infinite self-referencing for
    the former, and to ignore early setup stuff for the latter.
    Co-developed-by: default avatarJinyang He <hejinyang@loongson.cn>
    Signed-off-by: default avatarJinyang He <hejinyang@loongson.cn>
    Signed-off-by: default avatarQing Zhang <zhangqing@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    dbe3ba30
mcount.S 2.17 KB