aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@mellanox.com>2016-10-07 20:02:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:30 -0400
commit6727ad9e206cc08b80d8000a4d67f8417e53539d (patch)
tree3f9ca202417b08918547d5db776d041fa4ee61e3
parent511f8389454e55ece5115dc3bc84a0947788ff4f (diff)
nmi_backtrace: generate one-line reports for idle cpus
When doing an nmi backtrace of many cores, most of which are idle, the output is a little overwhelming and very uninformative. Suppress messages for cpus that are idling when they are interrupted and just emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN". We do this by grouping all the cpuidle code together into a new .cpuidle.text section, and then checking the address of the interrupted PC to see if it lies within that section. This commit suitably tags x86 and tile idle routines, and only adds in the minimal framework for other architectures. Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Daniel Thompson <daniel.thompson@linaro.org> [arm] Tested-by: Petr Mladek <pmladek@suse.com> Cc: Aaron Tomlin <atomlin@redhat.com> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Russell King <linux@arm.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S1
-rw-r--r--arch/arc/kernel/vmlinux.lds.S1
-rw-r--r--arch/arm/kernel/vmlinux-xip.lds.S1
-rw-r--r--arch/arm/kernel/vmlinux.lds.S1
-rw-r--r--arch/arm64/kernel/vmlinux.lds.S1
-rw-r--r--arch/avr32/kernel/vmlinux.lds.S1
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S1
-rw-r--r--arch/c6x/kernel/vmlinux.lds.S1
-rw-r--r--arch/cris/kernel/vmlinux.lds.S1
-rw-r--r--arch/frv/kernel/vmlinux.lds.S1
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S1
-rw-r--r--arch/hexagon/kernel/vmlinux.lds.S1
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S1
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S1
-rw-r--r--arch/m68k/kernel/vmlinux-nommu.lds1
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds1
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds1
-rw-r--r--arch/metag/kernel/vmlinux.lds.S1
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S1
-rw-r--r--arch/mips/kernel/vmlinux.lds.S1
-rw-r--r--arch/mn10300/kernel/vmlinux.lds.S1
-rw-r--r--arch/nios2/kernel/vmlinux.lds.S1
-rw-r--r--arch/openrisc/kernel/vmlinux.lds.S1
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S1
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S1
-rw-r--r--arch/s390/kernel/vmlinux.lds.S1
-rw-r--r--arch/score/kernel/vmlinux.lds.S1
-rw-r--r--arch/sh/kernel/vmlinux.lds.S1
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S1
-rw-r--r--arch/tile/kernel/entry.S2
-rw-r--r--arch/tile/kernel/vmlinux.lds.S1
-rw-r--r--arch/um/kernel/dyn.lds.S1
-rw-r--r--arch/um/kernel/uml.lds.S1
-rw-r--r--arch/unicore32/kernel/vmlinux.lds.S1
-rw-r--r--arch/x86/include/asm/irqflags.h12
-rw-r--r--arch/x86/kernel/acpi/cstate.c2
-rw-r--r--arch/x86/kernel/process.c4
-rw-r--r--arch/x86/kernel/vmlinux.lds.S1
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S3
-rw-r--r--drivers/acpi/processor_idle.c5
-rw-r--r--drivers/cpuidle/driver.c5
-rw-r--r--drivers/idle/intel_idle.c4
-rw-r--r--include/asm-generic/vmlinux.lds.h6
-rw-r--r--include/linux/cpu.h5
-rw-r--r--kernel/sched/idle.c13
-rw-r--r--lib/nmi_backtrace.c16
-rw-r--r--scripts/mod/modpost.c2
-rw-r--r--scripts/recordmcount.c1
-rwxr-xr-xscripts/recordmcount.pl1
49 files changed, 93 insertions, 22 deletions
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 647b84c15382..cebecfb76fbf 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -22,6 +22,7 @@ SECTIONS
22 HEAD_TEXT 22 HEAD_TEXT
23 TEXT_TEXT 23 TEXT_TEXT
24 SCHED_TEXT 24 SCHED_TEXT
25 CPUIDLE_TEXT
25 LOCK_TEXT 26 LOCK_TEXT
26 *(.fixup) 27 *(.fixup)
27 *(.gnu.warning) 28 *(.gnu.warning)
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index 36611072305f..f35ed578e007 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -89,6 +89,7 @@ SECTIONS
89 _text = .; 89 _text = .;
90 TEXT_TEXT 90 TEXT_TEXT
91 SCHED_TEXT 91 SCHED_TEXT
92 CPUIDLE_TEXT
92 LOCK_TEXT 93 LOCK_TEXT
93 KPROBES_TEXT 94 KPROBES_TEXT
94 *(.fixup) 95 *(.fixup)
diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S
index cba1ec899a69..7fa487ef7e2f 100644
--- a/arch/arm/kernel/vmlinux-xip.lds.S
+++ b/arch/arm/kernel/vmlinux-xip.lds.S
@@ -98,6 +98,7 @@ SECTIONS
98 IRQENTRY_TEXT 98 IRQENTRY_TEXT
99 TEXT_TEXT 99 TEXT_TEXT
100 SCHED_TEXT 100 SCHED_TEXT
101 CPUIDLE_TEXT
101 LOCK_TEXT 102 LOCK_TEXT
102 KPROBES_TEXT 103 KPROBES_TEXT
103 *(.gnu.warning) 104 *(.gnu.warning)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index d24e5dd2aa7a..f7f55df0bf7b 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -111,6 +111,7 @@ SECTIONS
111 SOFTIRQENTRY_TEXT 111 SOFTIRQENTRY_TEXT
112 TEXT_TEXT 112 TEXT_TEXT
113 SCHED_TEXT 113 SCHED_TEXT
114 CPUIDLE_TEXT
114 LOCK_TEXT 115 LOCK_TEXT
115 HYPERVISOR_TEXT 116 HYPERVISOR_TEXT
116 KPROBES_TEXT 117 KPROBES_TEXT
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 5ce9b2929e0d..1105aab1e6d6 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -122,6 +122,7 @@ SECTIONS
122 ENTRY_TEXT 122 ENTRY_TEXT
123 TEXT_TEXT 123 TEXT_TEXT
124 SCHED_TEXT 124 SCHED_TEXT
125 CPUIDLE_TEXT
125 LOCK_TEXT 126 LOCK_TEXT
126 KPROBES_TEXT 127 KPROBES_TEXT
127 HYPERVISOR_TEXT 128 HYPERVISOR_TEXT
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index a4589176bed5..17f2730eb497 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -52,6 +52,7 @@ SECTIONS
52 KPROBES_TEXT 52 KPROBES_TEXT
53 TEXT_TEXT 53 TEXT_TEXT
54 SCHED_TEXT 54 SCHED_TEXT
55 CPUIDLE_TEXT
55 LOCK_TEXT 56 LOCK_TEXT
56 *(.fixup) 57 *(.fixup)
57 *(.gnu.warning) 58 *(.gnu.warning)
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index d920b959ff3a..68069a120055 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -33,6 +33,7 @@ SECTIONS
33#ifndef CONFIG_SCHEDULE_L1 33#ifndef CONFIG_SCHEDULE_L1
34 SCHED_TEXT 34 SCHED_TEXT
35#endif 35#endif
36 CPUIDLE_TEXT
36 LOCK_TEXT 37 LOCK_TEXT
37 IRQENTRY_TEXT 38 IRQENTRY_TEXT
38 SOFTIRQENTRY_TEXT 39 SOFTIRQENTRY_TEXT
diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S
index 50bc10f97bcb..a1a5c166bc9b 100644
--- a/arch/c6x/kernel/vmlinux.lds.S
+++ b/arch/c6x/kernel/vmlinux.lds.S
@@ -70,6 +70,7 @@ SECTIONS
70 _stext = .; 70 _stext = .;
71 TEXT_TEXT 71 TEXT_TEXT
72 SCHED_TEXT 72 SCHED_TEXT
73 CPUIDLE_TEXT
73 LOCK_TEXT 74 LOCK_TEXT
74 IRQENTRY_TEXT 75 IRQENTRY_TEXT
75 SOFTIRQENTRY_TEXT 76 SOFTIRQENTRY_TEXT
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index 7552c2557506..979586261520 100644
--- a/arch/cris/kernel/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -43,6 +43,7 @@ SECTIONS
43 HEAD_TEXT 43 HEAD_TEXT
44 TEXT_TEXT 44 TEXT_TEXT
45 SCHED_TEXT 45 SCHED_TEXT
46 CPUIDLE_TEXT
46 LOCK_TEXT 47 LOCK_TEXT
47 *(.fixup) 48 *(.fixup)
48 *(.text.__*) 49 *(.text.__*)
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 7e958d829ec9..aa6e573d57da 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -63,6 +63,7 @@ SECTIONS
63 *(.text..tlbmiss) 63 *(.text..tlbmiss)
64 TEXT_TEXT 64 TEXT_TEXT
65 SCHED_TEXT 65 SCHED_TEXT
66 CPUIDLE_TEXT
66 LOCK_TEXT 67 LOCK_TEXT
67#ifdef CONFIG_DEBUG_INFO 68#ifdef CONFIG_DEBUG_INFO
68 INIT_TEXT 69 INIT_TEXT
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index cb5dfb02c88d..7f11da1b895e 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -29,6 +29,7 @@ SECTIONS
29 _stext = . ; 29 _stext = . ;
30 TEXT_TEXT 30 TEXT_TEXT
31 SCHED_TEXT 31 SCHED_TEXT
32 CPUIDLE_TEXT
32 LOCK_TEXT 33 LOCK_TEXT
33#if defined(CONFIG_ROMKERNEL) 34#if defined(CONFIG_ROMKERNEL)
34 *(.int_redirect) 35 *(.int_redirect)
diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
index 5f268c1071b3..ec87e67feb19 100644
--- a/arch/hexagon/kernel/vmlinux.lds.S
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -50,6 +50,7 @@ SECTIONS
50 _text = .; 50 _text = .;
51 TEXT_TEXT 51 TEXT_TEXT
52 SCHED_TEXT 52 SCHED_TEXT
53 CPUIDLE_TEXT
53 LOCK_TEXT 54 LOCK_TEXT
54 KPROBES_TEXT 55 KPROBES_TEXT
55 *(.fixup) 56 *(.fixup)
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index dc506b05ffbd..f89d20c97412 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -46,6 +46,7 @@ SECTIONS {
46 __end_ivt_text = .; 46 __end_ivt_text = .;
47 TEXT_TEXT 47 TEXT_TEXT
48 SCHED_TEXT 48 SCHED_TEXT
49 CPUIDLE_TEXT
49 LOCK_TEXT 50 LOCK_TEXT
50 KPROBES_TEXT 51 KPROBES_TEXT
51 *(.gnu.linkonce.t*) 52 *(.gnu.linkonce.t*)
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 018e4a711d79..ad1fe56455aa 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -31,6 +31,7 @@ SECTIONS
31 HEAD_TEXT 31 HEAD_TEXT
32 TEXT_TEXT 32 TEXT_TEXT
33 SCHED_TEXT 33 SCHED_TEXT
34 CPUIDLE_TEXT
34 LOCK_TEXT 35 LOCK_TEXT
35 *(.fixup) 36 *(.fixup)
36 *(.gnu.warning) 37 *(.gnu.warning)
diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds
index 06a763f49fd3..d2c8abf1c8c4 100644
--- a/arch/m68k/kernel/vmlinux-nommu.lds
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -45,6 +45,7 @@ SECTIONS {
45 HEAD_TEXT 45 HEAD_TEXT
46 TEXT_TEXT 46 TEXT_TEXT
47 SCHED_TEXT 47 SCHED_TEXT
48 CPUIDLE_TEXT
48 LOCK_TEXT 49 LOCK_TEXT
49 *(.fixup) 50 *(.fixup)
50 . = ALIGN(16); 51 . = ALIGN(16);
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index d0993594f558..5b5ce1e4d1ed 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -16,6 +16,7 @@ SECTIONS
16 HEAD_TEXT 16 HEAD_TEXT
17 TEXT_TEXT 17 TEXT_TEXT
18 SCHED_TEXT 18 SCHED_TEXT
19 CPUIDLE_TEXT
19 LOCK_TEXT 20 LOCK_TEXT
20 *(.fixup) 21 *(.fixup)
21 *(.gnu.warning) 22 *(.gnu.warning)
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 8080469ee6c1..fe5ea1974b16 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -16,6 +16,7 @@ SECTIONS
16 HEAD_TEXT 16 HEAD_TEXT
17 TEXT_TEXT 17 TEXT_TEXT
18 SCHED_TEXT 18 SCHED_TEXT
19 CPUIDLE_TEXT
19 LOCK_TEXT 20 LOCK_TEXT
20 *(.fixup) 21 *(.fixup)
21 *(.gnu.warning) 22 *(.gnu.warning)
diff --git a/arch/metag/kernel/vmlinux.lds.S b/arch/metag/kernel/vmlinux.lds.S
index 150ace92c7ad..e6c700eaf207 100644
--- a/arch/metag/kernel/vmlinux.lds.S
+++ b/arch/metag/kernel/vmlinux.lds.S
@@ -21,6 +21,7 @@ SECTIONS
21 .text : { 21 .text : {
22 TEXT_TEXT 22 TEXT_TEXT
23 SCHED_TEXT 23 SCHED_TEXT
24 CPUIDLE_TEXT
24 LOCK_TEXT 25 LOCK_TEXT
25 KPROBES_TEXT 26 KPROBES_TEXT
26 IRQENTRY_TEXT 27 IRQENTRY_TEXT
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index 0a47f0410554..289d0e7f3e3a 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -33,6 +33,7 @@ SECTIONS {
33 EXIT_TEXT 33 EXIT_TEXT
34 EXIT_CALL 34 EXIT_CALL
35 SCHED_TEXT 35 SCHED_TEXT
36 CPUIDLE_TEXT
36 LOCK_TEXT 37 LOCK_TEXT
37 KPROBES_TEXT 38 KPROBES_TEXT
38 IRQENTRY_TEXT 39 IRQENTRY_TEXT
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index a82c178d0bb9..d5de67591735 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -55,6 +55,7 @@ SECTIONS
55 .text : { 55 .text : {
56 TEXT_TEXT 56 TEXT_TEXT
57 SCHED_TEXT 57 SCHED_TEXT
58 CPUIDLE_TEXT
58 LOCK_TEXT 59 LOCK_TEXT
59 KPROBES_TEXT 60 KPROBES_TEXT
60 IRQENTRY_TEXT 61 IRQENTRY_TEXT
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 13c4814c29f8..2d5f1c3f1afb 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -30,6 +30,7 @@ SECTIONS
30 HEAD_TEXT 30 HEAD_TEXT
31 TEXT_TEXT 31 TEXT_TEXT
32 SCHED_TEXT 32 SCHED_TEXT
33 CPUIDLE_TEXT
33 LOCK_TEXT 34 LOCK_TEXT
34 KPROBES_TEXT 35 KPROBES_TEXT
35 *(.fixup) 36 *(.fixup)
diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S
index e23e89539967..6a8045bb1a77 100644
--- a/arch/nios2/kernel/vmlinux.lds.S
+++ b/arch/nios2/kernel/vmlinux.lds.S
@@ -37,6 +37,7 @@ SECTIONS
37 .text : { 37 .text : {
38 TEXT_TEXT 38 TEXT_TEXT
39 SCHED_TEXT 39 SCHED_TEXT
40 CPUIDLE_TEXT
40 LOCK_TEXT 41 LOCK_TEXT
41 IRQENTRY_TEXT 42 IRQENTRY_TEXT
42 SOFTIRQENTRY_TEXT 43 SOFTIRQENTRY_TEXT
diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S
index d936de4c07ca..d68b9ede8423 100644
--- a/arch/openrisc/kernel/vmlinux.lds.S
+++ b/arch/openrisc/kernel/vmlinux.lds.S
@@ -47,6 +47,7 @@ SECTIONS
47 _stext = .; 47 _stext = .;
48 TEXT_TEXT 48 TEXT_TEXT
49 SCHED_TEXT 49 SCHED_TEXT
50 CPUIDLE_TEXT
50 LOCK_TEXT 51 LOCK_TEXT
51 KPROBES_TEXT 52 KPROBES_TEXT
52 IRQENTRY_TEXT 53 IRQENTRY_TEXT
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index f3ead0b6ce46..9ec8ec075dae 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -69,6 +69,7 @@ SECTIONS
69 .text ALIGN(PAGE_SIZE) : { 69 .text ALIGN(PAGE_SIZE) : {
70 TEXT_TEXT 70 TEXT_TEXT
71 SCHED_TEXT 71 SCHED_TEXT
72 CPUIDLE_TEXT
72 LOCK_TEXT 73 LOCK_TEXT
73 KPROBES_TEXT 74 KPROBES_TEXT
74 IRQENTRY_TEXT 75 IRQENTRY_TEXT
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b5fba689fca6..7ed59f0d947f 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -52,6 +52,7 @@ SECTIONS
52 /* careful! __ftr_alt_* sections need to be close to .text */ 52 /* careful! __ftr_alt_* sections need to be close to .text */
53 *(.text .fixup __ftr_alt_* .ref.text) 53 *(.text .fixup __ftr_alt_* .ref.text)
54 SCHED_TEXT 54 SCHED_TEXT
55 CPUIDLE_TEXT
55 LOCK_TEXT 56 LOCK_TEXT
56 KPROBES_TEXT 57 KPROBES_TEXT
57 IRQENTRY_TEXT 58 IRQENTRY_TEXT
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 429bfd111961..000e6e91f6a0 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -35,6 +35,7 @@ SECTIONS
35 HEAD_TEXT 35 HEAD_TEXT
36 TEXT_TEXT 36 TEXT_TEXT
37 SCHED_TEXT 37 SCHED_TEXT
38 CPUIDLE_TEXT
38 LOCK_TEXT 39 LOCK_TEXT
39 KPROBES_TEXT 40 KPROBES_TEXT
40 IRQENTRY_TEXT 41 IRQENTRY_TEXT
diff --git a/arch/score/kernel/vmlinux.lds.S b/arch/score/kernel/vmlinux.lds.S
index 7274b5c4287e..4117890b1db1 100644
--- a/arch/score/kernel/vmlinux.lds.S
+++ b/arch/score/kernel/vmlinux.lds.S
@@ -40,6 +40,7 @@ SECTIONS
40 _text = .; /* Text and read-only data */ 40 _text = .; /* Text and read-only data */
41 TEXT_TEXT 41 TEXT_TEXT
42 SCHED_TEXT 42 SCHED_TEXT
43 CPUIDLE_TEXT
43 LOCK_TEXT 44 LOCK_TEXT
44 KPROBES_TEXT 45 KPROBES_TEXT
45 *(.text.*) 46 *(.text.*)
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index 235a4101999f..5b9a3cc90c58 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -36,6 +36,7 @@ SECTIONS
36 TEXT_TEXT 36 TEXT_TEXT
37 EXTRA_TEXT 37 EXTRA_TEXT
38 SCHED_TEXT 38 SCHED_TEXT
39 CPUIDLE_TEXT
39 LOCK_TEXT 40 LOCK_TEXT
40 KPROBES_TEXT 41 KPROBES_TEXT
41 IRQENTRY_TEXT 42 IRQENTRY_TEXT
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index d79b3b734245..572db686f845 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -49,6 +49,7 @@ SECTIONS
49 HEAD_TEXT 49 HEAD_TEXT
50 TEXT_TEXT 50 TEXT_TEXT
51 SCHED_TEXT 51 SCHED_TEXT
52 CPUIDLE_TEXT
52 LOCK_TEXT 53 LOCK_TEXT
53 KPROBES_TEXT 54 KPROBES_TEXT
54 IRQENTRY_TEXT 55 IRQENTRY_TEXT
diff --git a/arch/tile/kernel/entry.S b/arch/tile/kernel/entry.S
index 670a3569450f..101de132e363 100644
--- a/arch/tile/kernel/entry.S
+++ b/arch/tile/kernel/entry.S
@@ -50,7 +50,7 @@ STD_ENTRY(smp_nap)
50 * When interrupted at _cpu_idle_nap, we bump the PC forward 8, and 50 * When interrupted at _cpu_idle_nap, we bump the PC forward 8, and
51 * as a result return to the function that called _cpu_idle(). 51 * as a result return to the function that called _cpu_idle().
52 */ 52 */
53STD_ENTRY(_cpu_idle) 53STD_ENTRY_SECTION(_cpu_idle, .cpuidle.text)
54 movei r1, 1 54 movei r1, 1
55 IRQ_ENABLE_LOAD(r2, r3) 55 IRQ_ENABLE_LOAD(r2, r3)
56 mtspr INTERRUPT_CRITICAL_SECTION, r1 56 mtspr INTERRUPT_CRITICAL_SECTION, r1
diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S
index 9d449caf8910..e1baf094fba4 100644
--- a/arch/tile/kernel/vmlinux.lds.S
+++ b/arch/tile/kernel/vmlinux.lds.S
@@ -42,6 +42,7 @@ SECTIONS
42 .text : AT (ADDR(.text) - LOAD_OFFSET) { 42 .text : AT (ADDR(.text) - LOAD_OFFSET) {
43 HEAD_TEXT 43 HEAD_TEXT
44 SCHED_TEXT 44 SCHED_TEXT
45 CPUIDLE_TEXT
45 LOCK_TEXT 46 LOCK_TEXT
46 KPROBES_TEXT 47 KPROBES_TEXT
47 IRQENTRY_TEXT 48 IRQENTRY_TEXT
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index adde088aeeff..4fdbcf958cd5 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -68,6 +68,7 @@ SECTIONS
68 _stext = .; 68 _stext = .;
69 TEXT_TEXT 69 TEXT_TEXT
70 SCHED_TEXT 70 SCHED_TEXT
71 CPUIDLE_TEXT
71 LOCK_TEXT 72 LOCK_TEXT
72 *(.fixup) 73 *(.fixup)
73 *(.stub .text.* .gnu.linkonce.t.*) 74 *(.stub .text.* .gnu.linkonce.t.*)
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 6899195602b7..1840f55ed042 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -28,6 +28,7 @@ SECTIONS
28 _stext = .; 28 _stext = .;
29 TEXT_TEXT 29 TEXT_TEXT
30 SCHED_TEXT 30 SCHED_TEXT
31 CPUIDLE_TEXT
31 LOCK_TEXT 32 LOCK_TEXT
32 *(.fixup) 33 *(.fixup)
33 /* .gnu.warning sections are handled specially by elf32.em. */ 34 /* .gnu.warning sections are handled specially by elf32.em. */
diff --git a/arch/unicore32/kernel/vmlinux.lds.S b/arch/unicore32/kernel/vmlinux.lds.S
index 77e407e49a63..56e788e8ee83 100644
--- a/arch/unicore32/kernel/vmlinux.lds.S
+++ b/arch/unicore32/kernel/vmlinux.lds.S
@@ -37,6 +37,7 @@ SECTIONS
37 .text : { /* Real text segment */ 37 .text : { /* Real text segment */
38 TEXT_TEXT 38 TEXT_TEXT
39 SCHED_TEXT 39 SCHED_TEXT
40 CPUIDLE_TEXT
40 LOCK_TEXT 41 LOCK_TEXT
41 42
42 *(.fixup) 43 *(.fixup)
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index b77f5edb03b0..ac7692dcfa2e 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -4,6 +4,10 @@
4#include <asm/processor-flags.h> 4#include <asm/processor-flags.h>
5 5
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7
8/* Provide __cpuidle; we can't safely include <linux/cpu.h> */
9#define __cpuidle __attribute__((__section__(".cpuidle.text")))
10
7/* 11/*
8 * Interrupt control: 12 * Interrupt control:
9 */ 13 */
@@ -44,12 +48,12 @@ static inline void native_irq_enable(void)
44 asm volatile("sti": : :"memory"); 48 asm volatile("sti": : :"memory");
45} 49}
46 50
47static inline void native_safe_halt(void) 51static inline __cpuidle void native_safe_halt(void)
48{ 52{
49 asm volatile("sti; hlt": : :"memory"); 53 asm volatile("sti; hlt": : :"memory");
50} 54}
51 55
52static inline void native_halt(void) 56static inline __cpuidle void native_halt(void)
53{ 57{
54 asm volatile("hlt": : :"memory"); 58 asm volatile("hlt": : :"memory");
55} 59}
@@ -86,7 +90,7 @@ static inline notrace void arch_local_irq_enable(void)
86 * Used in the idle loop; sti takes one instruction cycle 90 * Used in the idle loop; sti takes one instruction cycle
87 * to complete: 91 * to complete:
88 */ 92 */
89static inline void arch_safe_halt(void) 93static inline __cpuidle void arch_safe_halt(void)
90{ 94{
91 native_safe_halt(); 95 native_safe_halt();
92} 96}
@@ -95,7 +99,7 @@ static inline void arch_safe_halt(void)
95 * Used when interrupts are already enabled or to 99 * Used when interrupts are already enabled or to
96 * shutdown the processor: 100 * shutdown the processor:
97 */ 101 */
98static inline void halt(void) 102static inline __cpuidle void halt(void)
99{ 103{
100 native_halt(); 104 native_halt();
101} 105}
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index bdfad642123f..af15f4444330 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -152,7 +152,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
152} 152}
153EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); 153EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
154 154
155void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx) 155void __cpuidle acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx)
156{ 156{
157 unsigned int cpu = smp_processor_id(); 157 unsigned int cpu = smp_processor_id();
158 struct cstate_entry *percpu_entry; 158 struct cstate_entry *percpu_entry;
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 4002b475171c..28cea7802ecb 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -302,7 +302,7 @@ void arch_cpu_idle(void)
302/* 302/*
303 * We use this if we don't have any better idle routine.. 303 * We use this if we don't have any better idle routine..
304 */ 304 */
305void default_idle(void) 305void __cpuidle default_idle(void)
306{ 306{
307 trace_cpu_idle_rcuidle(1, smp_processor_id()); 307 trace_cpu_idle_rcuidle(1, smp_processor_id());
308 safe_halt(); 308 safe_halt();
@@ -417,7 +417,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)
417 * with interrupts enabled and no flags, which is backwards compatible with the 417 * with interrupts enabled and no flags, which is backwards compatible with the
418 * original MWAIT implementation. 418 * original MWAIT implementation.
419 */ 419 */
420static void mwait_idle(void) 420static __cpuidle void mwait_idle(void)
421{ 421{
422 if (!current_set_polling_and_test()) { 422 if (!current_set_polling_and_test()) {
423 trace_cpu_idle_rcuidle(1, smp_processor_id()); 423 trace_cpu_idle_rcuidle(1, smp_processor_id());
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 9297a002d8e5..dbf67f64d5ec 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -97,6 +97,7 @@ SECTIONS
97 _stext = .; 97 _stext = .;
98 TEXT_TEXT 98 TEXT_TEXT
99 SCHED_TEXT 99 SCHED_TEXT
100 CPUIDLE_TEXT
100 LOCK_TEXT 101 LOCK_TEXT
101 KPROBES_TEXT 102 KPROBES_TEXT
102 ENTRY_TEXT 103 ENTRY_TEXT
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 72cfe3587dd8..31411fc82662 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -89,6 +89,9 @@ SECTIONS
89 VMLINUX_SYMBOL(__sched_text_start) = .; 89 VMLINUX_SYMBOL(__sched_text_start) = .;
90 *(.sched.literal .sched.text) 90 *(.sched.literal .sched.text)
91 VMLINUX_SYMBOL(__sched_text_end) = .; 91 VMLINUX_SYMBOL(__sched_text_end) = .;
92 VMLINUX_SYMBOL(__cpuidle_text_start) = .;
93 *(.cpuidle.literal .cpuidle.text)
94 VMLINUX_SYMBOL(__cpuidle_text_end) = .;
92 VMLINUX_SYMBOL(__lock_text_start) = .; 95 VMLINUX_SYMBOL(__lock_text_start) = .;
93 *(.spinlock.literal .spinlock.text) 96 *(.spinlock.literal .spinlock.text)
94 VMLINUX_SYMBOL(__lock_text_end) = .; 97 VMLINUX_SYMBOL(__lock_text_end) = .;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index cea52528aa18..2237d3f24f0e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -31,6 +31,7 @@
31#include <linux/sched.h> /* need_resched() */ 31#include <linux/sched.h> /* need_resched() */
32#include <linux/tick.h> 32#include <linux/tick.h>
33#include <linux/cpuidle.h> 33#include <linux/cpuidle.h>
34#include <linux/cpu.h>
34#include <acpi/processor.h> 35#include <acpi/processor.h>
35 36
36/* 37/*
@@ -115,7 +116,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = {
115 * Callers should disable interrupts before the call and enable 116 * Callers should disable interrupts before the call and enable
116 * interrupts after return. 117 * interrupts after return.
117 */ 118 */
118static void acpi_safe_halt(void) 119static void __cpuidle acpi_safe_halt(void)
119{ 120{
120 if (!tif_need_resched()) { 121 if (!tif_need_resched()) {
121 safe_halt(); 122 safe_halt();
@@ -645,7 +646,7 @@ static int acpi_idle_bm_check(void)
645 * 646 *
646 * Caller disables interrupt before call and enables interrupt after return. 647 * Caller disables interrupt before call and enables interrupt after return.
647 */ 648 */
648static void acpi_idle_do_entry(struct acpi_processor_cx *cx) 649static void __cpuidle acpi_idle_do_entry(struct acpi_processor_cx *cx)
649{ 650{
650 if (cx->entry_method == ACPI_CSTATE_FFH) { 651 if (cx->entry_method == ACPI_CSTATE_FFH) {
651 /* Call into architectural FFH based C-state */ 652 /* Call into architectural FFH based C-state */
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 389ade4572be..ab264d393233 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -14,6 +14,7 @@
14#include <linux/cpuidle.h> 14#include <linux/cpuidle.h>
15#include <linux/cpumask.h> 15#include <linux/cpumask.h>
16#include <linux/tick.h> 16#include <linux/tick.h>
17#include <linux/cpu.h>
17 18
18#include "cpuidle.h" 19#include "cpuidle.h"
19 20
@@ -178,8 +179,8 @@ static void __cpuidle_driver_init(struct cpuidle_driver *drv)
178} 179}
179 180
180#ifdef CONFIG_ARCH_HAS_CPU_RELAX 181#ifdef CONFIG_ARCH_HAS_CPU_RELAX
181static int poll_idle(struct cpuidle_device *dev, 182static int __cpuidle poll_idle(struct cpuidle_device *dev,
182 struct cpuidle_driver *drv, int index) 183 struct cpuidle_driver *drv, int index)
183{ 184{
184 local_irq_enable(); 185 local_irq_enable();
185 if (!current_set_polling_and_test()) { 186 if (!current_set_polling_and_test()) {
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 67ec58f9ef99..4466a2f969d7 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -863,8 +863,8 @@ static struct cpuidle_state dnv_cstates[] = {
863 * 863 *
864 * Must be called under local_irq_disable(). 864 * Must be called under local_irq_disable().
865 */ 865 */
866static int intel_idle(struct cpuidle_device *dev, 866static __cpuidle int intel_idle(struct cpuidle_device *dev,
867 struct cpuidle_driver *drv, int index) 867 struct cpuidle_driver *drv, int index)
868{ 868{
869 unsigned long ecx = 1; /* break on interrupt flag */ 869 unsigned long ecx = 1; /* break on interrupt flag */
870 struct cpuidle_state *state = &drv->states[index]; 870 struct cpuidle_state *state = &drv->states[index];
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 24563970ff7b..3e42bcdd014b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -454,6 +454,12 @@
454 *(.spinlock.text) \ 454 *(.spinlock.text) \
455 VMLINUX_SYMBOL(__lock_text_end) = .; 455 VMLINUX_SYMBOL(__lock_text_end) = .;
456 456
457#define CPUIDLE_TEXT \
458 ALIGN_FUNCTION(); \
459 VMLINUX_SYMBOL(__cpuidle_text_start) = .; \
460 *(.cpuidle.text) \
461 VMLINUX_SYMBOL(__cpuidle_text_end) = .;
462
457#define KPROBES_TEXT \ 463#define KPROBES_TEXT \
458 ALIGN_FUNCTION(); \ 464 ALIGN_FUNCTION(); \
459 VMLINUX_SYMBOL(__kprobes_text_start) = .; \ 465 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 7572d9e9dced..b886dc17f2f3 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -231,6 +231,11 @@ void cpu_startup_entry(enum cpuhp_state state);
231 231
232void cpu_idle_poll_ctrl(bool enable); 232void cpu_idle_poll_ctrl(bool enable);
233 233
234/* Attach to any functions which should be considered cpuidle. */
235#define __cpuidle __attribute__((__section__(".cpuidle.text")))
236
237bool cpu_in_idle(unsigned long pc);
238
234void arch_cpu_idle(void); 239void arch_cpu_idle(void);
235void arch_cpu_idle_prepare(void); 240void arch_cpu_idle_prepare(void);
236void arch_cpu_idle_enter(void); 241void arch_cpu_idle_enter(void);
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 9fb873cfc75c..1d8718d5300d 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -16,6 +16,9 @@
16 16
17#include "sched.h" 17#include "sched.h"
18 18
19/* Linker adds these: start and end of __cpuidle functions */
20extern char __cpuidle_text_start[], __cpuidle_text_end[];
21
19/** 22/**
20 * sched_idle_set_state - Record idle state for the current CPU. 23 * sched_idle_set_state - Record idle state for the current CPU.
21 * @idle_state: State to record. 24 * @idle_state: State to record.
@@ -53,7 +56,7 @@ static int __init cpu_idle_nopoll_setup(char *__unused)
53__setup("hlt", cpu_idle_nopoll_setup); 56__setup("hlt", cpu_idle_nopoll_setup);
54#endif 57#endif
55 58
56static inline int cpu_idle_poll(void) 59static noinline int __cpuidle cpu_idle_poll(void)
57{ 60{
58 rcu_idle_enter(); 61 rcu_idle_enter();
59 trace_cpu_idle_rcuidle(0, smp_processor_id()); 62 trace_cpu_idle_rcuidle(0, smp_processor_id());
@@ -84,7 +87,7 @@ void __weak arch_cpu_idle(void)
84 * 87 *
85 * To use when the cpuidle framework cannot be used. 88 * To use when the cpuidle framework cannot be used.
86 */ 89 */
87void default_idle_call(void) 90void __cpuidle default_idle_call(void)
88{ 91{
89 if (current_clr_polling_and_test()) { 92 if (current_clr_polling_and_test()) {
90 local_irq_enable(); 93 local_irq_enable();
@@ -271,6 +274,12 @@ static void cpu_idle_loop(void)
271 } 274 }
272} 275}
273 276
277bool cpu_in_idle(unsigned long pc)
278{
279 return pc >= (unsigned long)__cpuidle_text_start &&
280 pc < (unsigned long)__cpuidle_text_end;
281}
282
274void cpu_startup_entry(enum cpuhp_state state) 283void cpu_startup_entry(enum cpuhp_state state)
275{ 284{
276 /* 285 /*
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 393a3cca1f47..75554754eadf 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -16,6 +16,7 @@
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/nmi.h> 18#include <linux/nmi.h>
19#include <linux/cpu.h>
19 20
20#ifdef arch_trigger_cpumask_backtrace 21#ifdef arch_trigger_cpumask_backtrace
21/* For reliability, we're prepared to waste bits here. */ 22/* For reliability, we're prepared to waste bits here. */
@@ -87,11 +88,16 @@ bool nmi_cpu_backtrace(struct pt_regs *regs)
87 int cpu = smp_processor_id(); 88 int cpu = smp_processor_id();
88 89
89 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) { 90 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
90 pr_warn("NMI backtrace for cpu %d\n", cpu); 91 if (regs && cpu_in_idle(instruction_pointer(regs))) {
91 if (regs) 92 pr_warn("NMI backtrace for cpu %d skipped: idling at pc %#lx\n",
92 show_regs(regs); 93 cpu, instruction_pointer(regs));
93 else 94 } else {
94 dump_stack(); 95 pr_warn("NMI backtrace for cpu %d\n", cpu);
96 if (regs)
97 show_regs(regs);
98 else
99 dump_stack();
100 }
95 cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask)); 101 cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));
96 return true; 102 return true;
97 } 103 }
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 48958d3cec9e..bd8349759095 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -888,7 +888,7 @@ static void check_section(const char *modname, struct elf_info *elf,
888 888
889#define DATA_SECTIONS ".data", ".data.rel" 889#define DATA_SECTIONS ".data", ".data.rel"
890#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \ 890#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \
891 ".kprobes.text" 891 ".kprobes.text", ".cpuidle.text"
892#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ 892#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
893 ".fixup", ".entry.text", ".exception.text", ".text.*", \ 893 ".fixup", ".entry.text", ".exception.text", ".text.*", \
894 ".coldtext" 894 ".coldtext"
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index a68f03133df9..5423a58d1b06 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -365,6 +365,7 @@ is_mcounted_section_name(char const *const txtname)
365 strcmp(".irqentry.text", txtname) == 0 || 365 strcmp(".irqentry.text", txtname) == 0 ||
366 strcmp(".softirqentry.text", txtname) == 0 || 366 strcmp(".softirqentry.text", txtname) == 0 ||
367 strcmp(".kprobes.text", txtname) == 0 || 367 strcmp(".kprobes.text", txtname) == 0 ||
368 strcmp(".cpuidle.text", txtname) == 0 ||
368 strcmp(".text.unlikely", txtname) == 0; 369 strcmp(".text.unlikely", txtname) == 0;
369} 370}
370 371
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 2d48011bc362..faac4b10d8ea 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -136,6 +136,7 @@ my %text_sections = (
136 ".irqentry.text" => 1, 136 ".irqentry.text" => 1,
137 ".softirqentry.text" => 1, 137 ".softirqentry.text" => 1,
138 ".kprobes.text" => 1, 138 ".kprobes.text" => 1,
139 ".cpuidle.text" => 1,
139 ".text.unlikely" => 1, 140 ".text.unlikely" => 1,
140); 141);
141 142