ftrace.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) ftrace.h (d983c89cc96a87db0c00821e81aa3d8296c12225)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_S390_FTRACE_H
3#define _ASM_S390_FTRACE_H
4
5#define ARCH_SUPPORTS_FTRACE_OPS 1
6
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_S390_FTRACE_H
3#define _ASM_S390_FTRACE_H
4
5#define ARCH_SUPPORTS_FTRACE_OPS 1
6
7#ifdef CC_USING_HOTPATCH
7#if defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT)
8#define MCOUNT_INSN_SIZE 6
9#else
10#define MCOUNT_INSN_SIZE 24
11#define MCOUNT_RETURN_FIXUP 18
12#endif
13
14#ifndef __ASSEMBLY__
15

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

37struct ftrace_insn {
38 u16 opc;
39 s32 disp;
40} __packed;
41
42static inline void ftrace_generate_nop_insn(struct ftrace_insn *insn)
43{
44#ifdef CONFIG_FUNCTION_TRACER
8#define MCOUNT_INSN_SIZE 6
9#else
10#define MCOUNT_INSN_SIZE 24
11#define MCOUNT_RETURN_FIXUP 18
12#endif
13
14#ifndef __ASSEMBLY__
15

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

37struct ftrace_insn {
38 u16 opc;
39 s32 disp;
40} __packed;
41
42static inline void ftrace_generate_nop_insn(struct ftrace_insn *insn)
43{
44#ifdef CONFIG_FUNCTION_TRACER
45#ifdef CC_USING_HOTPATCH
45#if defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT)
46 /* brcl 0,0 */
47 insn->opc = 0xc004;
48 insn->disp = 0;
49#else
50 /* jg .+24 */
51 insn->opc = 0xc0f4;
52 insn->disp = MCOUNT_INSN_SIZE / 2;
53#endif
54#endif
55}
56
57static inline int is_ftrace_nop(struct ftrace_insn *insn)
58{
59#ifdef CONFIG_FUNCTION_TRACER
46 /* brcl 0,0 */
47 insn->opc = 0xc004;
48 insn->disp = 0;
49#else
50 /* jg .+24 */
51 insn->opc = 0xc0f4;
52 insn->disp = MCOUNT_INSN_SIZE / 2;
53#endif
54#endif
55}
56
57static inline int is_ftrace_nop(struct ftrace_insn *insn)
58{
59#ifdef CONFIG_FUNCTION_TRACER
60#ifdef CC_USING_HOTPATCH
60#if defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT)
61 if (insn->disp == 0)
62 return 1;
63#else
64 if (insn->disp == MCOUNT_INSN_SIZE / 2)
65 return 1;
66#endif
67#endif
68 return 0;

--- 17 unchanged lines hidden ---
61 if (insn->disp == 0)
62 return 1;
63#else
64 if (insn->disp == MCOUNT_INSN_SIZE / 2)
65 return 1;
66#endif
67#endif
68 return 0;

--- 17 unchanged lines hidden ---