How do I find Linux config options in menuconfig?
Asked Answered
B

4

10

Various web pages tell me that to get full truthful stack backtraces in the Linux kernel, I need to set CONFIG_FRAME_POINTER=y in my .config file. So I run make menuconfig and try to find it in there, but it's hardly intuitive where to navigate to do so. I search the web and find lots of pages that say to enable it, but no pages that tell me what menu options to drill down into in order to do so. So I think maybe I could run make config and just hit [Enter] a million times to select the current configuration choice for everything, then copy-paste the whole command window buffer contents into a text file & search (case insensitive) for "frame_pointer" or "frame pointer", but still no luck; apparently I'd have to select 'y' for some submenu to even drill down to wherever it is.

How can I find such options in config or menuconfig? Is there an option configuration hierarchy listed somewhere?


I'm using Linux Kernel v2.6.30.4-uc0; that's what I'm given with the Lantronix XPort Pro SDK.

Based on answers I got, I use the / search option (not sure how I missed that before), but I'm not really able to get much farther. When I search for "FRAME_POINTER" this is what I see:

Symbol: ARCH_WANT_FRAME_POINTERS [=n]

Symbol: FRAME_POINTER [=n]
 Prompt: Compile the kernel with frame pointers
   Defined at lib/Kconfig.debug:620
   Depends on: DEBUG_KERNEL && (CRIS || M68K || M68KNOMMU || FRV || UML || AVR32 || SUPERH || BLACKFIN || MN10300) || ARCH_WANT_FRAME_POINTERS
   Location:
     -> Kernel hacking
   Selected by: LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT && !MIPS && !PPC && !ARM_UNWIND && !S390 || FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_

Note that the "Selected by:" line is longer than what I can see, even when I stretch the make menuconfig window as wide as the whole screen, and there's no option I can find to scroll the text to see it all. Very frustrating, as most of this ordeal has been.

So I try to navigate to this option using the "search" information above, but it's still nowhere to be found!

When I go to the Kernel hacking ---> menu, there is no choice to enable stack frames. There is also no menu choice "Compile-time checks and compiler options" as indicated in @ShantanuAde's answer. I see these choices:

------- Kernel hacking -------------------------
[ ] Show timing information on printks
[ ] Enable __deprecated logic
[ ] Enable __must_check logic
(1024) Warn for stack frames larger than (needs gcc 4.4)
[ ] Magic SysRq key
[ ] Enable unused/obsolete exported symbols
[ ] Debug Filesystem
[ ] Run 'make headers_check' when building vmlinux
[ ] Kernel debugging
[ ] Debug memory initialisation
[ ] Check for stalled CPUs delaying RCU grace periods
[ ] Sysctl checks
[ ] Sample kernel code  --->
[ ] Full Symbolic/Source Debugging support
[ ] Use fast second timer for profiling
[ ] Compiled-in Kernel Boot Parameter
[ ] Suppress Kernel BUG Messages

The only thing I can think of that might get me closer to CONFIG_FRAME_POINTER is "Kernel debugging" but when I turn that on, the only extra options I get are:

[*] Kernel debugging
[ ]   Debug shared IRQ handlers (NEW)
[*]   Detect Soft Lockups (NEW)
[ ]     Panic (Reboot) On Soft Lockups (NEW)
[*]   Detect Hung Tasks (NEW)
[ ]     Panic (Reboot) On Hung Tasks (NEW)
[*]   Collect scheduler debugging info (NEW)
[ ]   Collect scheduler statistics (NEW)
[ ]   Collect kernel timers statistics (NEW)
[ ]   Debug object operations (NEW)
[ ]   Debug slab memory allocations (NEW)
[ ] Spinlock and rw-lock debugging: basic checks (NEW)
[ ] Mutex debugging: basic checks (NEW)
[ ] Spinlock debugging: sleep-inside-spinlock checking (NEW)
[ ] Locking API boot-time self-tests (NEW)
[ ] kobject debugging (NEW)
[ ] Verbose BUG() reporting (adds 70K) (NEW)
[ ] Compile the kernel with debug info (NEW)
[ ] Debug VM (NEW)
[ ] Debug the global anon/private NOMMU mapping region tree (NEW)
[ ] Debug filesystem writers count (NEW)
Barnsley answered 4/10, 2017 at 21:24 Comment(2)
Did you finally find out how to enable CONFIG_FRAME_POINTER option?Hearsay
@Hearsay - Yes, see my comment under the selected answer where I say "I'm using a Coldfire (M68KNOMMU)...". But that was then, and things may have changed. I'm not often going back into menuconfig to change things, in fact that was the last time I've done so.Barnsley
E
21

In make menuconfig tool key / opens a search dialog. Input required option into it, and information about this option will be displayed. This information includes "path" in options tree.

Note, that an option appears in the options tree only when its Depends on expression is satisfied; you may check these options with additional / searches.

Some options are never shown in the tree (for such options "Location" section is absent), so they cannot be selected by a user. Usually, these options are defined by the architecture against which the kernel is compiled.

Estabrook answered 4/10, 2017 at 21:29 Comment(4)
Please see my updates. Not sure how I missed the / search option before, but as my updates indicate, that hasn't gotten me any closer to finding CONFIG_FRAME_POINTER in the menus; I had already browsed through the same menus indicated in the search results, and still can't find it.Barnsley
An option is visible for a user only when its Depends on expression is true. Check that for your option. (You may check values of options using additional / search). I have updated my answer for that case.Estabrook
Update: From your output you may see, that ARCH_WANT_FRAME_POINTERS option is false for your arch. So, unless your arch is one of the listed: (CRIS || M68K || M68KNOMMU || FRV || UML || AVR32 || SUPERH || BLACKFIN || MN10300), you cannot make FRAME_POINTER option visible and cannot enable it. (In other words, you cannot enable frame pointers for arch which doesn't support them).Estabrook
I'm using a Coldfire (M68KNOMMU) processor. BTW, I just found the configuration option. It showed up way down on the Kernel hacking page, far far down below the Kernel debugging options, so far down that I didn't realize it was appearing when I turned on Kernel debugging. I thought the options that appeared immediately below Kernel debugging were the only ones that appear/disappear when I turned kernel debugging on/off.Barnsley
O
5

As pointed of above; search for "FRAME_POINTER" after make menuconfig by pressing '/' key. It'll display all the config option having this string. Press the number against the desired option. It'll take you to that specific configuration. Change configuration with a "space" key. Don't forget to save before exiting.

On my system, I got below output listed first

Symbol: FRAME_POINTER [=y]
Type : boolean
Prompt: Compile the kernel with frame pointers
Location:
-> Kernel hacking (1) -> Compile-time checks and compiler options

Oxpecker answered 5/10, 2017 at 4:44 Comment(2)
I'm apparently using Linux Kernel v2.6.30.4-uc0; that's what I'm given with the Lantronix XPort Pro SDK. When I search for FRAME_POINTER, it shows me two symbols: ARCH_WANT_FRAME_POINTERS and FRAME_POINTER. The description for the latter is similar to what you've shown, but for "Location:" mine just says -> Kernel hacking. There is definitely no choice for anything related to stack frames in the "Kernel hacking" menu. But there is a "Kernel debugging" choice, so I check there, and still nothing. Also, I don't know what you mean by "Press the number"... I have no number choices to press.Barnsley
Thank You, sir! Never heard of the possibility to directly jump to the search result. 15 years wasted by going through long screens to find the right prompt. That's insane. Thank You! Thank You! Thank You!Emlyn
K
2

the number is the index of seach results. u jump to the result quickly

Klaraklarika answered 2/6, 2018 at 7:49 Comment(1)
Thank You! Didn't get your answer, but I searched here for better explanation (word "number") and found @Shantanu answer. You guys saved my life. Late, but you did :DEmlyn
B
0

this commit might help, select ARCH_WANT_FRAME_POINTERS in your arch/x86/Kconfig

http://visa.lab.asu.edu/gitlab/fstrace/android-kernel-msm-hammerhead-3.4-marshmallow-mr3/commit/da4276b8299a6544dc41ac2485d3ffca5811b3fb

Birdella answered 6/3, 2023 at 3:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.