ANDROID: GKI: Remove duplicates from symbol lists

scripts/gen_gki_modules_headers.sh:

Add an option to only keep unique symbols during the
symbol list prep phase as for header generation symbol
list needs to be unique union of all vendor symbol
lists in an ascending order.

This reduces the array size and improves the lookup
time for the binary search.

Bug: 232430739
Test: TH
Fixes: 0a903fe828 ("ANDROID: GKI: Header generation fix and improvements")
Change-Id: Ib6868f5a8eb0b3713e192bec111804e993e3d085
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
This commit is contained in:
Ramji Jiyani
2023-02-02 08:13:38 +00:00
committed by Treehugger Robot
parent 7a7986f840
commit 2069048a73

View File

@@ -54,7 +54,7 @@ generate_header() {
sed -i '/^[[:space:]]*$/d; /^#/d; /\[abi_symbol_list\]/d' "${symbol_file}"
# Sort in byte order for kernel binary search at runtime
LC_ALL=C sort -o "${symbol_file}" "${symbol_file}"
LC_ALL=C sort -u -o "${symbol_file}" "${symbol_file}"
# Trim white spaces & +1 for null termination
local max_name_len=$(awk '