iovisor / iovisor/bcc

python frontend: allow kernel to manage USDT probing semaphore

Open
#4,523 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Hello,

https://github.com/iovisor/bcc/blob/a37d0ee3d7f98d8f3bd44dff25922c4ff5c241da/src/cc/usdt/usdt.cc#L125-L135

doesn't seem to be aware of the fact that after https://github.com/iovisor/bcc/pull/3135, bcc can tell the kernel to manage USDT semaphore counts.

which makes the python frontend raise https://github.com/iovisor/bcc/blob/a37d0ee3d7f98d8f3bd44dff25922c4ff5c241da/src/python/bcc/usdt.py#L161-L167 (I think will need to make it clearer after the change)

The `enable_probe` phase should not block the `attach_uprobes` phase from doing its job.

I added a test https://github.com/iovisor/bcc/pull/4522 (usdt probes with semaphore were not tested e2e for python) that should pass but fails with the current code.

As I use a kernel > 4.20, after commenting out the `if (need_enable())` block, the test passes locally, I even managed to do a real world test by consuming USDT probes from a big application, it works as expected (I'm able to retrieve probes from all the processes the application creates by only passing the path to the binary).

If I'm right (if not we should at least adapt the doc), I can take care of the patch.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/cc/usdt/usdt.cc around lines 125-135 and src/python/bcc/usdt.py around lines 161-167, then review the semaphore behavior introduced by pull request 3135. Run the end-to-end Python USDT semaphore test from pull request 4522. Done means the enable_probe phase no longer prevents attach_uprobes from working and that test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, python
Domain
observability-sre, operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.