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

[C++] add BPF::enable_usdt(void) and disble_usdt(void) to handle all the USDT at once #2854

Merged
merged 3 commits into from
Apr 4, 2020

Conversation

gfx
Copy link
Contributor

@gfx gfx commented Apr 2, 2020

It's bothering to write a loop such as:

  for (auto &probe : probes) {
    ret = bpf->attach_usdt(probe);
    if (!ret.ok()) {
      std::cerr << "attach_usdt: " << ret.msg() << std::endl;
      return EXIT_FAILURE;
    }
  }

So I think it makes sense when the BPF.h provides a way to enable/disable all the USDTs at once.

@gfx gfx changed the title [C++] add BPF::enable_usdt() to enable all the USDT [C++] add BPF::enable_usdt() and disble_usdt() to handle all the USDT at once Apr 2, 2020
@gfx gfx changed the title [C++] add BPF::enable_usdt() and disble_usdt() to handle all the USDT at once [C++] add BPF::enable_usdt(void) and disble_usdt(void) to handle all the USDT at once Apr 2, 2020
@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

This may break other applications. Maybe create a new API attach_usdt_all()?

@gfx
Copy link
Contributor Author

gfx commented Apr 4, 2020

I don't think these overloadings break the compatibility, but giving new names is absolutely better.

Renamed.

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

LGTM. Thanks!

@yonghong-song yonghong-song merged commit 689f900 into iovisor:master Apr 4, 2020
@gfx gfx deleted the cxx_attach_usdt_for_all branch April 4, 2020 06:09
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
…the USDT at once (iovisor#2854)

* add BPF::enable_usdt_all() to enable all the USDT
* add detach_usdt_all() to detach all the USDTs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants