* [PATCH] scripts/gdb: change kernel config dumping method
@ 2022-06-10 7:14 Kuan-Ying Lee
2022-06-11 9:37 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Kuan-Ying Lee @ 2022-06-10 7:14 UTC (permalink / raw)
To: Jan Kiszka, Kieran Bingham, Matthias Brugger, Masahiro Yamada,
Andrew Morton
Cc: chinwen.chang, nicholas.tang, casper.li, andrew.yang,
Kuan-Ying Lee, linux-kernel, linux-arm-kernel, linux-mediatek
MAGIC_START("IKCFG_ST") and MAGIC_END("IKCFG_ED") are moved out
from the kernel_config_data variable [1].
Thus, we parse kernel_config_data directly instead of considering
offset of MAGIC_START and MAGIC_END.
[1] https://lore.kernel.org/lkml/1550108893-21226-1-git-send-email-yamada.masahiro@socionext.com/
Fixes: 13610aa908dc ("kernel/configs: use .incbin directive to embed config_data.gz")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
---
scripts/gdb/linux/config.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/gdb/linux/config.py b/scripts/gdb/linux/config.py
index 90e1565b1967..8843ab3cbadd 100644
--- a/scripts/gdb/linux/config.py
+++ b/scripts/gdb/linux/config.py
@@ -24,9 +24,9 @@ class LxConfigDump(gdb.Command):
filename = arg
try:
- py_config_ptr = gdb.parse_and_eval("kernel_config_data + 8")
- py_config_size = gdb.parse_and_eval(
- "sizeof(kernel_config_data) - 1 - 8 * 2")
+ py_config_ptr = gdb.parse_and_eval("&kernel_config_data")
+ py_config_ptr_end = gdb.parse_and_eval("&kernel_config_data_end")
+ py_config_size = py_config_ptr_end - py_config_ptr
except gdb.error as e:
raise gdb.GdbError("Can't find config, enable CONFIG_IKCONFIG?")
--
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts/gdb: change kernel config dumping method
2022-06-10 7:14 [PATCH] scripts/gdb: change kernel config dumping method Kuan-Ying Lee
@ 2022-06-11 9:37 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2022-06-11 9:37 UTC (permalink / raw)
To: Kuan-Ying Lee
Cc: Jan Kiszka, Kieran Bingham, Matthias Brugger, Andrew Morton,
chinwen.chang, nicholas.tang, casper.li, andrew.yang,
Linux Kernel Mailing List, linux-arm-kernel,
moderated list:ARM/Mediatek SoC support
On Fri, Jun 10, 2022 at 4:15 PM Kuan-Ying Lee
<Kuan-Ying.Lee@mediatek.com> wrote:
>
> MAGIC_START("IKCFG_ST") and MAGIC_END("IKCFG_ED") are moved out
> from the kernel_config_data variable [1].
>
> Thus, we parse kernel_config_data directly instead of considering
> offset of MAGIC_START and MAGIC_END.
>
> [1] https://lore.kernel.org/lkml/1550108893-21226-1-git-send-email-yamada.masahiro@socionext.com/
>
> Fixes: 13610aa908dc ("kernel/configs: use .incbin directive to embed config_data.gz")
> Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Thanks for the fix.
Applied to linux-kbuild/fixes.
> ---
> scripts/gdb/linux/config.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/gdb/linux/config.py b/scripts/gdb/linux/config.py
> index 90e1565b1967..8843ab3cbadd 100644
> --- a/scripts/gdb/linux/config.py
> +++ b/scripts/gdb/linux/config.py
> @@ -24,9 +24,9 @@ class LxConfigDump(gdb.Command):
> filename = arg
>
> try:
> - py_config_ptr = gdb.parse_and_eval("kernel_config_data + 8")
> - py_config_size = gdb.parse_and_eval(
> - "sizeof(kernel_config_data) - 1 - 8 * 2")
> + py_config_ptr = gdb.parse_and_eval("&kernel_config_data")
> + py_config_ptr_end = gdb.parse_and_eval("&kernel_config_data_end")
> + py_config_size = py_config_ptr_end - py_config_ptr
> except gdb.error as e:
> raise gdb.GdbError("Can't find config, enable CONFIG_IKCONFIG?")
>
> --
> 2.18.0
>
--
Best Regards
Masahiro Yamada
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-11 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 7:14 [PATCH] scripts/gdb: change kernel config dumping method Kuan-Ying Lee
2022-06-11 9:37 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).