ftrace.c (651a88798412e216f337d70181127e847f00a4b7) ftrace.c (e999995c84c3abb6dcae83f8c35942a8d4ee0451)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Dynamic function tracing support.
4 *
5 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
6 *
7 * Thanks goes to Ingo Molnar, for suggesting the idea.
8 * Mathieu Desnoyers, for suggesting postponing the modifications.

--- 565 unchanged lines hidden (view full) ---

574 ops->trampoline = 0;
575}
576
577#endif /* CONFIG_X86_64 */
578#endif /* CONFIG_DYNAMIC_FTRACE */
579
580#ifdef CONFIG_FUNCTION_GRAPH_TRACER
581
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Dynamic function tracing support.
4 *
5 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
6 *
7 * Thanks goes to Ingo Molnar, for suggesting the idea.
8 * Mathieu Desnoyers, for suggesting postponing the modifications.

--- 565 unchanged lines hidden (view full) ---

574 ops->trampoline = 0;
575}
576
577#endif /* CONFIG_X86_64 */
578#endif /* CONFIG_DYNAMIC_FTRACE */
579
580#ifdef CONFIG_FUNCTION_GRAPH_TRACER
581
582#ifdef CONFIG_DYNAMIC_FTRACE
583
584#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
582#if defined(CONFIG_DYNAMIC_FTRACE) && !defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
585extern void ftrace_graph_call(void);
586static const char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
587{
588 return text_gen_insn(JMP32_INSN_OPCODE, (void *)ip, (void *)addr);
589}
590
591static int ftrace_mod_jmp(unsigned long ip, void *func)
592{

--- 12 unchanged lines hidden (view full) ---

605}
606
607int ftrace_disable_ftrace_graph_caller(void)
608{
609 unsigned long ip = (unsigned long)(&ftrace_graph_call);
610
611 return ftrace_mod_jmp(ip, &ftrace_stub);
612}
583extern void ftrace_graph_call(void);
584static const char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
585{
586 return text_gen_insn(JMP32_INSN_OPCODE, (void *)ip, (void *)addr);
587}
588
589static int ftrace_mod_jmp(unsigned long ip, void *func)
590{

--- 12 unchanged lines hidden (view full) ---

603}
604
605int ftrace_disable_ftrace_graph_caller(void)
606{
607 unsigned long ip = (unsigned long)(&ftrace_graph_call);
608
609 return ftrace_mod_jmp(ip, &ftrace_stub);
610}
613#else /* !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS */
614int ftrace_enable_ftrace_graph_caller(void)
615{
616 return 0;
617}
611#endif /* CONFIG_DYNAMIC_FTRACE && !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS */
618
612
619int ftrace_disable_ftrace_graph_caller(void)
620{
621 return 0;
622}
623#endif /* CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS */
624#endif /* !CONFIG_DYNAMIC_FTRACE */
625
626/*
627 * Hook the return address and push it in the stack of return addrs
628 * in current thread info.
629 */
630void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
631 unsigned long frame_pointer)
632{
633 unsigned long return_hooker = (unsigned long)&return_to_handler;

--- 42 unchanged lines hidden ---
613/*
614 * Hook the return address and push it in the stack of return addrs
615 * in current thread info.
616 */
617void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
618 unsigned long frame_pointer)
619{
620 unsigned long return_hooker = (unsigned long)&return_to_handler;

--- 42 unchanged lines hidden ---