Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiler: Delete stack in batches #601

Open
kakkoyun opened this issue Jul 19, 2022 · 1 comment
Open

profiler: Delete stack in batches #601

kakkoyun opened this issue Jul 19, 2022 · 1 comment
Labels
area/eBPF Something involving eBPF feature/profiler This feature describes support for a new type of profiler.

Comments

@kakkoyun
Copy link
Member

kakkoyun commented Jul 19, 2022

// Delete all stacks.
//
// The capacity will be difficult to estimate without counting as it's
// likely that there will be more than we need due to duplicated stack IDs.
keysToDelete := make([]int32, 0, len(stacksKeys))
for key := range stacksKeys {
	keysToDelete = append(keysToDelete, key)
}

// TODO(javierhonduco): Getting -ENOTSUPP, perhaps my kernel doesn't support it?
// Needs more investigation.
//
processed, err := p.bpfMaps.stacks.DeleteKeyBatch(unsafe.Pointer(&keysToDelete[0]), uint32(len(keysToDelete)))
level.Debug(p.logger).Log("msg", "deleted counts map in batch", "deleted", processed)
if err != nil {
	    return fmt.Errorf("failed to delete stacks in batch: %w", err)
}

cc @javierhonduco

ref #602 and #395

@kakkoyun kakkoyun added feature/profiler This feature describes support for a new type of profiler. area/eBPF Something involving eBPF labels Jul 19, 2022
@javierhonduco
Copy link
Contributor

// TODO(javierhonduco): Getting -ENOTSUPP, perhaps my kernel doesn't support it?

Oh yes, I remember this, was quite odd. Can take a look in some weeks.

Wondering how hotDeleteKeyBatch is, would be interesting to perhaps check our own profiles in the demo cluster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/eBPF Something involving eBPF feature/profiler This feature describes support for a new type of profiler.
Projects
None yet
Development

No branches or pull requests

2 participants