Blob Blame History Raw
From: Miroslav Benes <mbenes@suse.cz>
Subject: ftrace: Fix scripts/recordmcount.pl due to new binutils
Patch-mainline: Not yet, will be submitted upstream eventually
References: bsc#1192267

Binutils update containing commit
b10b530a4566888492ac693773e1e35f66c4b7c4 changed how certain
instructions are translated by objdump. It broke ftrace on s390x in a
way that mcount locations are not recorded anymore. brcl insn became
jgnop.

Fix scripts/recordmcount.pl so that it can recognize both options.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
 scripts/recordmcount.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -246,7 +246,7 @@ if ($arch eq "x86_64") {
 
 } elsif ($arch eq "s390" && $bits == 64) {
     if ($cc =~ /-DCC_USING_HOTPATCH/) {
-	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*brcl\\s*0,[0-9a-f]+ <([^\+]*)>\$";
+	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
 	$mcount_adjust = 0;
     } else {
 	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";