summaryrefslogtreecommitdiffstats
path: root/samples/ftrace/ftrace-direct-modify.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2020-04-24 22:40:43 +0200
committerJosh Poimboeuf <jpoimboe@redhat.com>2020-05-20 15:30:43 +0200
commit9d907f1ae80b8a67d5397e26912b9d56d0b70a02 (patch)
tree41f4d1ad71da46105e5eb5de02fbb60416ee5979 /samples/ftrace/ftrace-direct-modify.c
parentMerge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic... (diff)
downloadlinux-9d907f1ae80b8a67d5397e26912b9d56d0b70a02.tar.xz
linux-9d907f1ae80b8a67d5397e26912b9d56d0b70a02.zip
samples/ftrace: Fix asm function ELF annotations
Enable objtool coverage for the sample ftrace modules by adding ELF annotations to the asm trampoline functions. samples/ftrace/ftrace-direct.o: warning: objtool: .text+0x0: unreachable instruction samples/ftrace/ftrace-direct-modify.o: warning: objtool: .text+0x0: unreachable instruction samples/ftrace/ftrace-direct-too.o: warning: objtool: .text+0x0: unreachable instruction Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'samples/ftrace/ftrace-direct-modify.c')
-rw-r--r--samples/ftrace/ftrace-direct-modify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c
index e04229d21475..c13a5bc5095b 100644
--- a/samples/ftrace/ftrace-direct-modify.c
+++ b/samples/ftrace/ftrace-direct-modify.c
@@ -20,18 +20,22 @@ static unsigned long my_ip = (unsigned long)schedule;
asm (
" .pushsection .text, \"ax\", @progbits\n"
+" .type my_tramp1, @function\n"
" my_tramp1:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
" call my_direct_func1\n"
" leave\n"
+" .size my_tramp1, .-my_tramp1\n"
" ret\n"
+" .type my_tramp2, @function\n"
" my_tramp2:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
" call my_direct_func2\n"
" leave\n"
" ret\n"
+" .size my_tramp2, .-my_tramp2\n"
" .popsection\n"
);