From: Eduard Zingerman <eddyz87@gmail.com>
To: dwarves@vger.kernel.org, arnaldo.melo@gmail.com
Cc: bpf@vger.kernel.org, kernel-team@fb.com, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, yhs@fb.com,
jemarch@gnu.org, david.faust@oracle.com, mykolal@fb.com,
Eduard Zingerman <eddyz87@gmail.com>
Subject: [PATCH v3 dwarves 1/6] dwarves.h: expose ptr_table interface
Date: Wed, 24 May 2023 03:18:20 +0300 [thread overview]
Message-ID: <20230524001825.2688661-2-eddyz87@gmail.com> (raw)
In-Reply-To: <20230524001825.2688661-1-eddyz87@gmail.com>
Allow to use ptr_table__{init,exit,add} functions outside of dwarves.c.
This would be leveraged by subsequent patches.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
---
dwarves.c | 6 +++---
dwarves.h | 4 ++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dwarves.c b/dwarves.c
index 218367b..ed5c348 100644
--- a/dwarves.c
+++ b/dwarves.c
@@ -491,18 +491,18 @@ void cus__add(struct cus *cus, struct cu *cu)
cu__find_class_holes(cu);
}
-static void ptr_table__init(struct ptr_table *pt)
+void ptr_table__init(struct ptr_table *pt)
{
pt->entries = NULL;
pt->nr_entries = pt->allocated_entries = 0;
}
-static void ptr_table__exit(struct ptr_table *pt)
+void ptr_table__exit(struct ptr_table *pt)
{
zfree(&pt->entries);
}
-static int ptr_table__add(struct ptr_table *pt, void *ptr, uint32_t *idxp)
+int ptr_table__add(struct ptr_table *pt, void *ptr, uint32_t *idxp)
{
const uint32_t nr_entries = pt->nr_entries + 1;
const uint32_t rc = pt->nr_entries;
diff --git a/dwarves.h b/dwarves.h
index eb1a6df..54771d1 100644
--- a/dwarves.h
+++ b/dwarves.h
@@ -185,6 +185,10 @@ struct ptr_table {
uint32_t allocated_entries;
};
+void ptr_table__init(struct ptr_table *pt);
+void ptr_table__exit(struct ptr_table *pt);
+int ptr_table__add(struct ptr_table *pt, void *ptr, uint32_t *idxp);
+
struct function;
struct tag;
struct cu;
--
2.40.1
next prev parent reply other threads:[~2023-05-24 0:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 0:18 [PATCH v3 dwarves 0/6] Support for new btf_type_tag encoding Eduard Zingerman
2023-05-24 0:18 ` Eduard Zingerman [this message]
2023-05-24 0:18 ` [PATCH v3 dwarves 2/6] dwarf_loader: Track unspecified types in a separate list Eduard Zingerman
2023-05-24 0:18 ` [PATCH v3 dwarves 3/6] dwarf_loader: handle btf_type_tag w/o special pointer type Eduard Zingerman
2023-05-24 0:18 ` [PATCH v3 dwarves 4/6] dwarf_loader: support btf:type_tag DW_TAG_LLVM_annotation Eduard Zingerman
2023-05-24 0:18 ` [PATCH v3 dwarves 5/6] dwarf_loader: move type tags before CVR qualifiers when necessary Eduard Zingerman
2023-05-24 0:18 ` [PATCH v3 dwarves 6/6] btf_encoder: skip type tags for VAR entry types Eduard Zingerman
2023-05-25 0:13 ` [PATCH v3 dwarves 0/6] Support for new btf_type_tag encoding Eduard Zingerman
2023-05-26 0:06 ` Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230524001825.2688661-2-eddyz87@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=david.faust@oracle.com \
--cc=dwarves@vger.kernel.org \
--cc=jemarch@gnu.org \
--cc=kernel-team@fb.com \
--cc=mykolal@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).