parca-agent icon indicating copy to clipboard operation
parca-agent copied to clipboard

Use batch operations

Open brancz opened this issue 3 years ago • 4 comments

https://github.com/parca-dev/parca-agent/blob/32327eae805c18a3483731cb3dea5fff697dbcb1/pkg/agent/profile.go#L280

libbpf supports the batch operations such as:

  • bpf_map_lookup_and_delete_batch
  • bpf_map_lookup_batch
  • bpf_map_delete_batch

These make sense to be used. Because we already load all the data from the BPF maps into the memory of our user-space program, so might as well do it efficiently. And not only does it allow us to batch, but it also allows us to delete items at the same time, which is exactly what we do anyways after each profiling iteration.

They first need to be implemented in libbpfgo.

brancz avatar Oct 07 '21 08:10 brancz

Sent in https://github.com/aquasecurity/libbpfgo/pull/97 to support this.

derekparker avatar Dec 13 '21 18:12 derekparker

Submitted https://github.com/aquasecurity/libbpfgo/pull/101 to improve error checking within libbpfgo which is necessary for our usage of these batch operations.

derekparker avatar Dec 21 '21 22:12 derekparker

This is currently blocked on a libbpfgo patch to improve error handling when calling into the libbpf C library.

See https://github.com/aquasecurity/libbpfgo/pull/100#issuecomment-1004202417 for a summary on my thoughts for error handling and look at comments from Grant on overall summary of where the patch is and the direction for it.

derekparker avatar Jan 03 '22 17:01 derekparker

#395 (reverted #403) Waiting for the minimum supported kernel version to 5.2

kakkoyun avatar Jul 04 '22 15:07 kakkoyun

👋 , is there any profile that shows this is a hotspot? If no, perhaps we can close it. We will always re-evaluate things and keep on profiling the agent to ensure that the performance is within what we expect

javierhonduco avatar Apr 24 '23 15:04 javierhonduco

Let's close it 😊

kakkoyun avatar Apr 24 '23 17:04 kakkoyun