Skip to contentSkip to conversation

libbpf: remove sample_period init in perf_buffer

PATCH In review Tao Chen 3 participants 4 messages Apr 23, 2025 – Apr 29, 2025

Subsystems (2)
lore
Share & tools
lore

Tao Chen

author
#0 lore raw

PATCH 1/1 libbpf: remove sample_period init in perf_buffer

It seems that sample_period no used in perf buffer, actually only wakeup_events valid about events aggregation for wakeup. So remove it to avoid causing confusion.

Fixes fb84b8224655 ("libbpf: add perf buffer API")
---
 tools/lib/bpf/libbpf.c | 1 -
 1 file changed, 1 deletion(-)
tools/lib/bpf/libbpf.c +0 -1
index 194809da5172..1830e3c011a5 100644
@@ -13306,7 +13306,6 @@ struct perf_buffer *perf_buffer__new(int map_fd, size_t page_cnt,
 	attr.config = PERF_COUNT_SW_BPF_OUTPUT;
 	attr.type = PERF_TYPE_SOFTWARE;
 	attr.sample_type = PERF_SAMPLE_RAW;
-	attr.sample_period = sample_period;
 	attr.wakeup_events = sample_period;
 
 	p.attr = &attr;
Signature · 1 line
2.43.0
author
#1 lore raw

在 2025/4/24 00:39, Tao Chen 写道:

ping...

Quoted 24 lines

It seems that sample_period no used in perf buffer, actually only wakeup_events valid about events aggregation for wakeup. So remove it to avoid causing confusion.

Fixes fb84b8224655 ("libbpf: add perf buffer API")
---
  tools/lib/bpf/libbpf.c | 1 -
  1 file changed, 1 deletion(-)
tools/lib/bpf/libbpf.c +0 -1
index 194809da5172..1830e3c011a5 100644
@@ -13306,7 +13306,6 @@ struct perf_buffer *perf_buffer__new(int map_fd, size_t page_cnt,
  	attr.config = PERF_COUNT_SW_BPF_OUTPUT;
  	attr.type = PERF_TYPE_SOFTWARE;
  	attr.sample_type = PERF_SAMPLE_RAW;
-	attr.sample_period = sample_period;
  	attr.wakeup_events = sample_period;
 
  	p.attr = &attr;
Signature · 2 lines
Best Regards
Tao Chen
#2 lore raw
Quoted 4 lines · Tao Chen

在 2025/4/24 00:39, Tao Chen 写道:

ping...

The patch has already been accepted and merged into bpf-next:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=64821d25f05ac468d435e61669ae745ce5a633ea

Interestingly, [email protected] didn't send a notification about this.

You can check the current status of your patches on Patchwork:
https://patchwork.kernel.org/project/netdevbpf/list/?delegate=121173&state=*

Signature · 2 lines
Regards
Yafang
#3 lore raw
Quoted 5 lines · Yafang Shao
Quoted 3 lines · Tao Chen

在 2025/4/24 00:39, Tao Chen 写道:

Quoted 7 lines
Quoted 1 line

ping...

The patch has already been accepted and merged into bpf-next:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=64821d25f05ac468d435e61669ae745ce5a633ea

Interestingly, [email protected] didn't send a notification about this.

Yeah, we had a day or two of patchwork not working. The patch was applied. Sorry, I forgot to reply manually to let everyone know.

Quoted 8 lines

You can check the current status of your patches on Patchwork:
https://patchwork.kernel.org/project/netdevbpf/list/?delegate=121173&state=*

--
Regards
Yafang