From nobody Mon Nov 25 06:50:24 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F261224436 for ; Wed, 30 Oct 2024 17:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730307696; cv=none; b=lKGmzeKdqgRof9hVfq1Q8op+4M+mPjXgynB7vZ62EOvZfGG1rZAGIvdkTVnFXzL+e+5esYhzav0I4/F3basCIAAxRMol6bX+Gpr4TjZDMVE7et/a28L8MycWXva7I3o7VArxvZWKcTpqexbEEFqgy8SaNPAZsIglLt+UjHz+3jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730307696; c=relaxed/simple; bh=gfwkI+wkWUtAKEwBzqoGGs3R4CCOyp4w4uiQ+EugUWU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=p/J6FQB9gIU7kUBjvlYPQ0QROdyjfW6NFkSnGH/rfr14isL2EI2iwJjVgC5AGNP8ZKVm2WD9eUXrpsQ639soQT1PDOzx44tCcAbbX6fF2j8i2j0B1KIr3YmwhcgoSLCS2NXQiZmgHK5Xz/NIynEjzKmVrVv3YEsRplP58BNgpwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--samitolvanen.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FOCV0sPO; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--samitolvanen.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FOCV0sPO" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e30daaf5928so11629276.1 for ; Wed, 30 Oct 2024 10:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730307691; x=1730912491; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=UrMKZjqWhUo4AWENw8FCHc8CH+xsYKaqPrMTOdKuOxw=; b=FOCV0sPOqsbddFFTFC17dFjOYM2WoShLwpCZxFOqGpyIliCxjfyNM4KU5lLyDm5g/9 4Os4aVUJK6Um6OqtvWd4O2ZDFBiWeyzIHKeU/qvAWMK6MBZ6xeilGS4BPFGBJlOFAeQr zehX4vTGkt+KHadymKGOKGVreVErtJZZc5m9LaU1I5vNFxc1xateZ75UCZPrgGEr8bc/ 6sRm04cnaAqGGsIHxLnqpB3k610OsBb1pI+5aIaNr0zc6aoh6U5ctzGI9aaH7bA6yKWn S1s6YyjO64237BkYEa43TswqrTvJOFykQAcL84eR3YQW9a451POcJP5bW9J2yk+LwJ52 s2xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730307691; x=1730912491; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UrMKZjqWhUo4AWENw8FCHc8CH+xsYKaqPrMTOdKuOxw=; b=LYvbvMBlfMJsxZhPB7GkloQ6UsqK7pOrGB2b2THLekk6FmBCjtEMRm32jTeypZFm0+ QXYfJiuh7ieFRTzyt3r5IdwjzIlnTU6iA5Cl8X4t3raLRaangTzXfVvkdNX0GkR58v1x TRhvYL8CNNTQe4kiEqDHNjB8iToOAZBQEWIFRDe/3+T1fnAtCllPUfUS5a02f8x52oNp N1v7V/4snjCoovXgzyi8hEyWEQUbS7lnPHsk2nXx3hML+Kpc/qvRE2KWxHae+Kv1as+j nebpsOFjCug3WGb33GdHQ/3EIhQ4D7k6QfTBdBTe3aWfUH9rljTYsfYFe+WT8PW6ioQz RYrw== X-Forwarded-Encrypted: i=1; AJvYcCWepNZ+V53E3Rflp8zac0USDzhotvfqwnXNJmlNc26bnwgfak8meY3OTwn8g5WCEaZWb1WedOYUfMJrCjw=@vger.kernel.org X-Gm-Message-State: AOJu0YwwDU+KAIbZ7AWZzyZa6r0dOhtEXtXIvtnDhIUergh/lbLLyyik ce8H7UwOwtXDNj00HdxxfN0zmVmBFqGQz7TlDECpo85HogTuLmQDas3aFw46Nl2HCk8kvIWJYK7 ET/GXRUjaPfiDtQge00J3UmDO9A== X-Google-Smtp-Source: AGHT+IHDaxC9XKMwBFpGl1PRpgimf3fBE/8grWpbFkGmWk7TUymG6d7yhB+CoHEX+T8EGwh08WjPq9H11HZnZg1Y+E0= X-Received: from samitolvanen.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4f92]) (user=samitolvanen job=sendgmr) by 2002:a25:aa03:0:b0:e2e:2c0c:c219 with SMTP id 3f1490d57ef6-e3087c0b018mr155217276.8.1730307690861; Wed, 30 Oct 2024 10:01:30 -0700 (PDT) Date: Wed, 30 Oct 2024 17:01:12 +0000 In-Reply-To: <20241030170106.1501763-21-samitolvanen@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241030170106.1501763-21-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=15499; i=samitolvanen@google.com; h=from:subject; bh=gfwkI+wkWUtAKEwBzqoGGs3R4CCOyp4w4uiQ+EugUWU=; b=owGbwMvMwCEWxa662nLh8irG02pJDOlKaaExHfHuRvtijs51FfCaNZFjMZf9ZNaa5v5Y532Ox tk+DMs6SlkYxDgYZMUUWVq+rt66+7tT6qvPRRIwc1iZQIYwcHEKwESe5TD8z9JdJD2jblHrzWh/ 7QVrBJ7u92gpr/g/Z8H5jdOZvAr1zBn+WT66YJc9W+/Of46q1uAzntPsxCJC1Ob3PZ6Ql269Psa eGQA= X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241030170106.1501763-26-samitolvanen@google.com> Subject: [PATCH v5 05/19] gendwarfksyms: Add a cache for processed DIEs From: Sami Tolvanen To: Masahiro Yamada , Luis Chamberlain , Miguel Ojeda , Greg Kroah-Hartman Cc: Matthew Maurer , Alex Gaynor , Gary Guo , Petr Pavlu , Daniel Gomez , Neal Gompa , Hector Martin , Janne Grunau , Miroslav Benes , Asahi Linux , Sedat Dilek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org, Sami Tolvanen Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile | 1 + scripts/gendwarfksyms/die.c | 143 ++++++++++++++++++++++++++ scripts/gendwarfksyms/dwarf.c | 136 +++++++++++++++++------- scripts/gendwarfksyms/gendwarfksyms.c | 6 ++ scripts/gendwarfksyms/gendwarfksyms.h | 63 +++++++++++- 5 files changed, 308 insertions(+), 41 deletions(-) create mode 100644 scripts/gendwarfksyms/die.c diff --git a/scripts/gendwarfksyms/Makefile b/scripts/gendwarfksyms/Makefile index 9f8fec4fd39b..c0d4ce50fc27 100644 --- a/scripts/gendwarfksyms/Makefile +++ b/scripts/gendwarfksyms/Makefile @@ -2,6 +2,7 @@ hostprogs-always-y +=3D gendwarfksyms =20 gendwarfksyms-objs +=3D gendwarfksyms.o +gendwarfksyms-objs +=3D die.o gendwarfksyms-objs +=3D dwarf.o gendwarfksyms-objs +=3D symbols.o =20 diff --git a/scripts/gendwarfksyms/die.c b/scripts/gendwarfksyms/die.c new file mode 100644 index 000000000000..28d89fce89fc --- /dev/null +++ b/scripts/gendwarfksyms/die.c @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Google LLC + */ + +#include +#include "gendwarfksyms.h" + +#define DIE_HASH_BITS 20 + +/* {die->addr, state} -> struct die * */ +static HASHTABLE_DEFINE(die_map, 1 << DIE_HASH_BITS); + +static unsigned int map_hits; +static unsigned int map_misses; + +static inline unsigned int die_hash(uintptr_t addr, enum die_state state) +{ + return hash_32(addr_hash(addr) ^ (unsigned int)state); +} + +static void init_die(struct die *cd) +{ + cd->state =3D DIE_INCOMPLETE; + cd->fqn =3D NULL; + cd->tag =3D -1; + cd->addr =3D 0; + INIT_LIST_HEAD(&cd->fragments); +} + +static struct die *create_die(Dwarf_Die *die, enum die_state state) +{ + struct die *cd; + + cd =3D xmalloc(sizeof(struct die)); + init_die(cd); + cd->addr =3D (uintptr_t)die->addr; + + hash_add(die_map, &cd->hash, die_hash(cd->addr, state)); + return cd; +} + +int __die_map_get(uintptr_t addr, enum die_state state, struct die **res) +{ + struct die *cd; + + hash_for_each_possible(die_map, cd, hash, die_hash(addr, state)) { + if (cd->addr =3D=3D addr && cd->state =3D=3D state) { + *res =3D cd; + return 0; + } + } + + return -1; +} + +struct die *die_map_get(Dwarf_Die *die, enum die_state state) +{ + struct die *cd; + + if (__die_map_get((uintptr_t)die->addr, state, &cd) =3D=3D 0) { + map_hits++; + return cd; + } + + map_misses++; + return create_die(die, state); +} + +static void reset_die(struct die *cd) +{ + struct die_fragment *tmp; + struct die_fragment *df; + + list_for_each_entry_safe(df, tmp, &cd->fragments, list) { + if (df->type =3D=3D FRAGMENT_STRING) + free(df->data.str); + free(df); + } + + if (cd->fqn && *cd->fqn) + free(cd->fqn); + init_die(cd); +} + +void die_map_free(void) +{ + struct hlist_node *tmp; + unsigned int stats[DIE_LAST + 1]; + struct die *cd; + int i; + + memset(stats, 0, sizeof(stats)); + + hash_for_each_safe(die_map, cd, tmp, hash) { + stats[cd->state]++; + reset_die(cd); + free(cd); + } + hash_init(die_map); + + if (map_hits + map_misses > 0) + debug("hits %u, misses %u (hit rate %.02f%%)", map_hits, + map_misses, + (100.0f * map_hits) / (map_hits + map_misses)); + + for (i =3D 0; i <=3D DIE_LAST; i++) + debug("%s: %u entries", die_state_name(i), stats[i]); +} + +static struct die_fragment *append_item(struct die *cd) +{ + struct die_fragment *df; + + df =3D xmalloc(sizeof(struct die_fragment)); + df->type =3D FRAGMENT_EMPTY; + list_add_tail(&df->list, &cd->fragments); + return df; +} + +void die_map_add_string(struct die *cd, const char *str) +{ + struct die_fragment *df; + + if (!cd) + return; + + df =3D append_item(cd); + df->data.str =3D xstrdup(str); + df->type =3D FRAGMENT_STRING; +} + +void die_map_add_die(struct die *cd, struct die *child) +{ + struct die_fragment *df; + + if (!cd) + return; + + df =3D append_item(cd); + df->data.addr =3D child->addr; + df->type =3D FRAGMENT_DIE; +} diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c index 35fd1dfeeadc..c2cd4743515e 100644 --- a/scripts/gendwarfksyms/dwarf.c +++ b/scripts/gendwarfksyms/dwarf.c @@ -71,17 +71,19 @@ static bool match_export_symbol(struct state *state, Dw= arf_Die *die) /* * Type string processing */ -static void process(const char *s) +static void process(struct die *cache, const char *s) { s =3D s ?: ""; =20 if (dump_dies) fputs(s, stderr); + + die_map_add_string(cache, s); } =20 #define MAX_FMT_BUFFER_SIZE 128 =20 -static void process_fmt(const char *fmt, ...) +static void process_fmt(struct die *cache, const char *fmt, ...) { char buf[MAX_FMT_BUFFER_SIZE]; va_list args; @@ -91,7 +93,7 @@ static void process_fmt(const char *fmt, ...) if (checkp(vsnprintf(buf, sizeof(buf), fmt, args)) >=3D sizeof(buf)) error("vsnprintf overflow: increase MAX_FMT_BUFFER_SIZE"); =20 - process(buf); + process(cache, buf); va_end(args); } =20 @@ -164,18 +166,28 @@ static char *get_fqn(Dwarf_Die *die) return fqn; } =20 -static void process_fqn(Dwarf_Die *die) +static void update_fqn(struct die *cache, Dwarf_Die *die) +{ + if (!cache->fqn) + cache->fqn =3D get_fqn(die) ?: ""; +} + +static void process_fqn(struct die *cache, Dwarf_Die *die) { - process(" "); - process(get_fqn(die) ?: ""); + update_fqn(cache, die); + if (*cache->fqn) + process(cache, " "); + process(cache, cache->fqn); } =20 -#define DEFINE_PROCESS_UDATA_ATTRIBUTE(attribute) = \ - static void process_##attribute##_attr(Dwarf_Die *die) \ - { \ - Dwarf_Word value; \ - if (get_udata_attr(die, DW_AT_##attribute, &value)) \ - process_fmt(" " #attribute "(%" PRIu64 ")", value); \ +#define DEFINE_PROCESS_UDATA_ATTRIBUTE(attribute) = \ + static void process_##attribute##_attr(struct die *cache, \ + Dwarf_Die *die) \ + { \ + Dwarf_Word value; \ + if (get_udata_attr(die, DW_AT_##attribute, &value)) \ + process_fmt(cache, " " #attribute "(%" PRIu64 ")", \ + value); \ } =20 DEFINE_PROCESS_UDATA_ATTRIBUTE(alignment) @@ -187,8 +199,9 @@ bool match_all(Dwarf_Die *die) return true; } =20 -int process_die_container(struct state *state, Dwarf_Die *die, - die_callback_t func, die_match_callback_t match) +int process_die_container(struct state *state, struct die *cache, + Dwarf_Die *die, die_callback_t func, + die_match_callback_t match) { Dwarf_Die current; int res; @@ -197,7 +210,7 @@ int process_die_container(struct state *state, Dwarf_Di= e *die, while (!res) { if (match(¤t)) { /* <0 =3D error, 0 =3D continue, >0 =3D stop */ - res =3D checkp(func(state, ¤t)); + res =3D checkp(func(state, cache, ¤t)); if (res) return res; } @@ -208,39 +221,78 @@ int process_die_container(struct state *state, Dwarf_= Die *die, return 0; } =20 -static int process_type(struct state *state, Dwarf_Die *die); +static int process_type(struct state *state, struct die *parent, + Dwarf_Die *die); =20 -static void process_type_attr(struct state *state, Dwarf_Die *die) +static void process_type_attr(struct state *state, struct die *cache, + Dwarf_Die *die) { Dwarf_Die type; =20 if (get_ref_die_attr(die, DW_AT_type, &type)) { - check(process_type(state, &type)); + check(process_type(state, cache, &type)); return; } =20 /* Compilers can omit DW_AT_type -- print out 'void' to clarify */ - process("base_type void"); + process(cache, "base_type void"); +} + +static void process_base_type(struct state *state, struct die *cache, + Dwarf_Die *die) +{ + process(cache, "base_type"); + process_fqn(cache, die); + process_byte_size_attr(cache, die); + process_encoding_attr(cache, die); + process_alignment_attr(cache, die); } =20 -static void process_base_type(struct state *state, Dwarf_Die *die) +static void process_cached(struct state *state, struct die *cache, + Dwarf_Die *die) { - process("base_type"); - process_fqn(die); - process_byte_size_attr(die); - process_encoding_attr(die); - process_alignment_attr(die); + struct die_fragment *df; + Dwarf_Die child; + + list_for_each_entry(df, &cache->fragments, list) { + switch (df->type) { + case FRAGMENT_STRING: + process(NULL, df->data.str); + break; + case FRAGMENT_DIE: + if (!dwarf_die_addr_die(dwarf_cu_getdwarf(die->cu), + (void *)df->data.addr, &child)) + error("dwarf_die_addr_die failed"); + check(process_type(state, NULL, &child)); + break; + default: + error("empty die_fragment"); + } + } } =20 -#define PROCESS_TYPE(type) \ - case DW_TAG_##type##_type: \ - process_##type##_type(state, die); \ +#define PROCESS_TYPE(type) \ + case DW_TAG_##type##_type: \ + process_##type##_type(state, cache, die); \ break; =20 -static int process_type(struct state *state, Dwarf_Die *die) +static int process_type(struct state *state, struct die *parent, Dwarf_Die= *die) { + struct die *cache; int tag =3D dwarf_tag(die); =20 + /* + * If we have the DIE already cached, use it instead of walking + * through DWARF. + */ + cache =3D die_map_get(die, DIE_COMPLETE); + + if (cache->state =3D=3D DIE_COMPLETE) { + process_cached(state, cache, die); + die_map_add_die(parent, cache); + return 0; + } + switch (tag) { PROCESS_TYPE(base) default: @@ -248,6 +300,11 @@ static int process_type(struct state *state, Dwarf_Die= *die) break; } =20 + /* Update cache state and append to the parent (if any) */ + cache->tag =3D tag; + cache->state =3D DIE_COMPLETE; + die_map_add_die(parent, cache); + return 0; } =20 @@ -258,14 +315,15 @@ static void process_symbol(struct state *state, Dwarf= _Die *die, die_callback_t process_func) { debug("%s", state->sym->name); - check(process_func(state, die)); + check(process_func(state, NULL, die)); if (dump_dies) fputs("\n", stderr); } =20 -static int __process_subprogram(struct state *state, Dwarf_Die *die) +static int __process_subprogram(struct state *state, struct die *cache, + Dwarf_Die *die) { - process("subprogram"); + process(cache, "subprogram"); return 0; } =20 @@ -274,10 +332,11 @@ static void process_subprogram(struct state *state, D= warf_Die *die) process_symbol(state, die, __process_subprogram); } =20 -static int __process_variable(struct state *state, Dwarf_Die *die) +static int __process_variable(struct state *state, struct die *cache, + Dwarf_Die *die) { - process("variable "); - process_type_attr(state, die); + process(cache, "variable "); + process_type_attr(state, cache, die); return 0; } =20 @@ -286,7 +345,8 @@ static void process_variable(struct state *state, Dwarf= _Die *die) process_symbol(state, die, __process_variable); } =20 -static int process_exported_symbols(struct state *unused, Dwarf_Die *die) +static int process_exported_symbols(struct state *unused, struct die *cach= e, + Dwarf_Die *die) { int tag =3D dwarf_tag(die); =20 @@ -296,7 +356,7 @@ static int process_exported_symbols(struct state *unuse= d, Dwarf_Die *die) case DW_TAG_class_type: case DW_TAG_structure_type: return check(process_die_container( - NULL, die, process_exported_symbols, match_all)); + NULL, cache, die, process_exported_symbols, match_all)); =20 /* Possible exported symbols */ case DW_TAG_subprogram: @@ -320,6 +380,6 @@ static int process_exported_symbols(struct state *unuse= d, Dwarf_Die *die) =20 void process_cu(Dwarf_Die *cudie) { - check(process_die_container(NULL, cudie, process_exported_symbols, + check(process_die_container(NULL, NULL, cudie, process_exported_symbols, match_all)); } diff --git a/scripts/gendwarfksyms/gendwarfksyms.c b/scripts/gendwarfksyms/= gendwarfksyms.c index 1763234b6329..7552fde495ef 100644 --- a/scripts/gendwarfksyms/gendwarfksyms.c +++ b/scripts/gendwarfksyms/gendwarfksyms.c @@ -43,6 +43,10 @@ static int process_module(Dwfl_Module *mod, void **userd= ata, const char *name, debug("%s", name); dbg =3D dwfl_module_getdwarf(mod, &dwbias); =20 + /* + * Look for exported symbols in each CU, follow the DIE tree, and add + * the entries to die_map. + */ do { res =3D dwarf_get_units(dbg, cu, &cu, NULL, NULL, &cudie, NULL); if (res < 0) @@ -53,6 +57,8 @@ static int process_module(Dwfl_Module *mod, void **userda= ta, const char *name, process_cu(&cudie); } while (cu); =20 + die_map_free(); + return DWARF_CB_OK; } =20 diff --git a/scripts/gendwarfksyms/gendwarfksyms.h b/scripts/gendwarfksyms/= gendwarfksyms.h index f75d8ca33b45..b2aded992d42 100644 --- a/scripts/gendwarfksyms/gendwarfksyms.h +++ b/scripts/gendwarfksyms/gendwarfksyms.h @@ -90,6 +90,61 @@ void symbol_read_symtab(int fd); struct symbol *symbol_get(const char *name); void symbol_free(void); =20 +/* + * die.c + */ + +enum die_state { + DIE_INCOMPLETE, + DIE_COMPLETE, + DIE_LAST =3D DIE_COMPLETE +}; + +enum die_fragment_type { + FRAGMENT_EMPTY, + FRAGMENT_STRING, + FRAGMENT_DIE +}; + +struct die_fragment { + enum die_fragment_type type; + union { + char *str; + uintptr_t addr; + } data; + struct list_head list; +}; + +#define CASE_CONST_TO_STR(name) \ + case name: \ + return #name; + +static inline const char *die_state_name(enum die_state state) +{ + switch (state) { + CASE_CONST_TO_STR(DIE_INCOMPLETE) + CASE_CONST_TO_STR(DIE_COMPLETE) + } + + error("unexpected die_state: %d", state); +} + +struct die { + enum die_state state; + char *fqn; + int tag; + uintptr_t addr; + struct list_head fragments; + struct hlist_node hash; +}; + +int __die_map_get(uintptr_t addr, enum die_state state, struct die **res); +struct die *die_map_get(Dwarf_Die *die, enum die_state state); +void die_map_add_string(struct die *pd, const char *str); +void die_map_add_linebreak(struct die *pd, int linebreak); +void die_map_add_die(struct die *pd, struct die *child); +void die_map_free(void); + /* * dwarf.c */ @@ -99,12 +154,14 @@ struct state { Dwarf_Die die; }; =20 -typedef int (*die_callback_t)(struct state *state, Dwarf_Die *die); +typedef int (*die_callback_t)(struct state *state, struct die *cache, + Dwarf_Die *die); typedef bool (*die_match_callback_t)(Dwarf_Die *die); bool match_all(Dwarf_Die *die); =20 -int process_die_container(struct state *state, Dwarf_Die *die, - die_callback_t func, die_match_callback_t match); +int process_die_container(struct state *state, struct die *cache, + Dwarf_Die *die, die_callback_t func, + die_match_callback_t match); =20 void process_cu(Dwarf_Die *cudie); =20 --=20 2.47.0.163.g1226f6d8fa-goog