kdb: Get rid of custom debug heap allocator
authorSumit Garg <sumit.garg@linaro.org>
Wed, 14 Jul 2021 05:56:20 +0000 (11:26 +0530)
committerDaniel Thompson <daniel.thompson@linaro.org>
Tue, 27 Jul 2021 13:46:11 +0000 (14:46 +0100)
commit95f7f15461fa482a05237669507b4c9b06865b73
tree6db9ad7fd87cc1c54c4bdcea28c4f852d19c1eb4
parent2734d6c1b1a089fb593ef6a23d4b70903526fe0c
kdb: Get rid of custom debug heap allocator

Currently the only user for debug heap is kdbnearsym() which can be
modified to rather use statically allocated buffer for symbol name as
per it's current usage. So do that and hence remove custom debug heap
allocator.

Note that this change puts a restriction on kdbnearsym() callers to
carefully use shared namebuf such that a caller should consume the symbol
returned immediately prior to another call to fetch a different symbol.

Also, this change uses standard KSYM_NAME_LEN macro for namebuf
allocation instead of local variable: knt1_size which should avoid any
conflicts caused by changes to KSYM_NAME_LEN macro value.

This change has been tested using kgdbtest on arm64 which doesn't show
any regressions.

Suggested-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20210714055620.369915-1-sumit.garg@linaro.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_debugger.c
kernel/debug/kdb/kdb_private.h
kernel/debug/kdb/kdb_support.c