diff options
Diffstat (limited to 'scripts/recordmcount.pl')
| -rwxr-xr-x | scripts/recordmcount.pl | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 1d7963f4ee7..397b6b84e8c 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -130,9 +130,11 @@ if ($inputfile =~ m,kernel/trace/ftrace\.o$,) {  # Acceptable sections to record.  my %text_sections = (       ".text" => 1, +     ".ref.text" => 1,       ".sched.text" => 1,       ".spinlock.text" => 1,       ".irqentry.text" => 1, +     ".kprobes.text" => 1,       ".text.unlikely" => 1,  ); @@ -212,15 +214,16 @@ $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";  $weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)";  $section_regex = "Disassembly of section\\s+(\\S+):";  $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; -$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; +$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)\$";  $section_type = '@progbits';  $mcount_adjust = 0;  $type = ".long";  if ($arch eq "x86_64") { -    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)([+-]0x[0-9a-zA-Z]+)?\$";      $type = ".quad";      $alignment = 8; +    $mcount_adjust = -1;      # force flags for this arch      $ld .= " -m elf_x86_64"; @@ -230,6 +233,7 @@ if ($arch eq "x86_64") {  } elsif ($arch eq "i386") {      $alignment = 4; +    $mcount_adjust = -1;      # force flags for this arch      $ld .= " -m elf_i386"; @@ -239,12 +243,14 @@ if ($arch eq "x86_64") {  } elsif ($arch eq "s390" && $bits == 32) {      $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$"; +    $mcount_adjust = -4;      $alignment = 4;      $ld .= " -m elf_s390";      $cc .= " -m31";  } elsif ($arch eq "s390" && $bits == 64) {      $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; +    $mcount_adjust = -8;      $alignment = 8;      $type = ".quad";      $ld .= " -m elf64_s390"; @@ -273,6 +279,11 @@ if ($arch eq "x86_64") {      $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" .  			"\\s+(__gnu_mcount_nc|mcount)\$"; +} elsif ($arch eq "arm64") { +    $alignment = 3; +    $section_type = '%progbits'; +    $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_AARCH64_CALL26\\s+_mcount\$"; +    $type = ".quad";  } elsif ($arch eq "ia64") {      $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";      $type = "data8"; @@ -358,6 +369,11 @@ if ($arch eq "x86_64") {  } elsif ($arch eq "blackfin") {      $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$";      $mcount_adjust = -4; +} elsif ($arch eq "tilegx" || $arch eq "tile") { +    # Default to the newer TILE-Gx architecture if only "tile" is given. +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; +    $type = ".quad"; +    $alignment = 8;  } else {      die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";  }  | 
