Skip to contentSkip to conversation

tools: bpftool: Remove unused struct

PATCH Applied Yuan Can 4 participants 6 messages Sep 28, 2022 – Sep 30, 2022

Subsystems (2)
lore
Share & tools
lore

Yuan Can

author
#0 lore raw

cover tools: bpftool: Remove unused struct

This series contains two cleanup patches, remove unused struct.

Yuan Can (2):
tools: bpftool: Remove unused struct btf_attach_point
tools: bpftool: Remove unused struct event_ring_info

 tools/bpf/bpftool/btf.c           | 5 -----
 tools/bpf/bpftool/map_perf_ring.c | 7 -------
 2 files changed, 12 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 tools: bpftool: Remove unused struct btf_attach_point

After commit 2828d0d75b73("bpftool: Switch to libbpf's hashmap for programs/maps in BTF listing"), struct btf_attach_point is not used any more and can be removed as well.

---
 tools/bpf/bpftool/btf.c | 5 -----
 1 file changed, 5 deletions(-)
tools/bpf/bpftool/btf.c +0 -5
index 0744bd1150be..64411fe49a66 100644
@@ -43,11 +43,6 @@ static const char * const btf_kind_str[NR_BTF_KINDS] = {
 	[BTF_KIND_ENUM64]	= "ENUM64",
 };
 
-struct btf_attach_point {
-	__u32 obj_id;
-	__u32 btf_id;
-};
-
 static const char *btf_int_enc_str(__u8 encoding)
 {
 	switch (encoding) {
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/2 tools: bpftool: Remove unused struct event_ring_info

In reply to Yuan Can

After commit 9b190f185d2f("tools/bpftool: switch map event_pipe to libbpf's perf_buffer"), struct event_ring_info is not used any more and can be removed as well.

---
 tools/bpf/bpftool/map_perf_ring.c | 7 -------
 1 file changed, 7 deletions(-)
tools/bpf/bpftool/map_perf_ring.c +0 -7
index 6b0c410152de..1583281d1327 100644
@@ -29,13 +29,6 @@
 
 static volatile bool stop;
 
-struct event_ring_info {
-	int fd;
-	int key;
-	unsigned int cpu;
-	void *mem;
-};
-
 struct perf_event_sample {
 	struct perf_event_header header;
 	__u64 time;
Signature · 1 line
2.17.1
Reviewed-by on the v1 series
#3 lore raw
In reply to Yuan Can

Wed Sep 28 2022 10:04:38 GMT+0100 (British Summer Time) ~ Yuan Can <[email protected]>

Quoted 10 lines

This series contains two cleanup patches, remove unused struct.

Yuan Can (2):
tools: bpftool: Remove unused struct btf_attach_point
tools: bpftool: Remove unused struct event_ring_info

 tools/bpf/bpftool/btf.c           | 5 -----
 tools/bpf/bpftool/map_perf_ring.c | 7 -------
 2 files changed, 12 deletions(-)

Thanks for the clean-up.
Quentin

#4 lore raw
Quoted 13 lines · Quentin Monnet

Wed Sep 28 2022 10:04:38 GMT+0100 (British Summer Time) ~ Yuan Can <[email protected]>

Quoted 10 lines

This series contains two cleanup patches, remove unused struct.

Yuan Can (2):
tools: bpftool: Remove unused struct btf_attach_point
tools: bpftool: Remove unused struct event_ring_info

 tools/bpf/bpftool/btf.c           | 5 -----
 tools/bpf/bpftool/map_perf_ring.c | 7 -------
 2 files changed, 12 deletions(-)
Quoted 4 lines

Thanks for the clean-up.
Quentin

lgtm

#5 lore raw
In reply to Yuan Can
This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 9 lines · On Wed, 28 Sep 2022 09:04:38 +0000 you wrote:

This series contains two cleanup patches, remove unused struct.

Yuan Can (2):
tools: bpftool: Remove unused struct btf_attach_point
tools: bpftool: Remove unused struct event_ring_info

 tools/bpf/bpftool/btf.c           | 5 -----
 tools/bpf/bpftool/map_perf_ring.c | 7 -------
 2 files changed, 12 deletions(-)

Here is the summary with links:
- [1/2] tools: bpftool: Remove unused struct btf_attach_point

    https://git.kernel.org/bpf/bpf-next/c/d863f42930db
  - [2/2] tools: bpftool: Remove unused struct event_ring_info
    https://git.kernel.org/bpf/bpf-next/c/f95a479797dc

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html