8000 dynamic: Refactor patch pattern logic by clementguidi · Pull Request #1703 · namhyung/uftrace · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dynamic: Refactor patch pattern logic #1703

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

Merged
merged 3 commits into from
Jul 30, 2023

Conversation

clementguidi
Copy link
Contributor
@clementguidi clementguidi commented May 11, 2023

clementguidi and others added 3 commits June 30, 2023 12:02
Originally, when the user asks to only unpatch functions, uftrace would
patch all other functions by default. This is counter-intuitive,
especially when using the agent to unpatch at runtime. The user doesn't
expect functions to be patched when they only unpatch funtions.

This commit removes this behavior, and requires the user to explicitly
define functions to patch.

Co-authored-by: Gabriel-Andrew Pollo-Guilbert <gabrielpolloguilbert@gmail.com>
Signed-off-by: Clément Guidi <cguidi@ciena.com>
Libmcount would try to unpatch by default any function that is not
matched by the user patch or unpatch options.

We remove this implicit behavior, so the user explicitly choses which
function to unpatch.

Signed-off-by: Clément Guidi <cguidi@ciena.com>
Return whether a symbol is positively or negatively matched against a
pattern list, or not matched at all.

Co-authored-by: Gabriel-Andrew Pollo-Guilbert <gabrielpolloguilbert@gmail.com>
Signed-off-by: Clément Guidi <cguidi@ciena.com>
Copy link
Owner
@namhyung namhyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it should work similar to -F and -N so patch all functions when -U is given. But I think it's different and we don't usually use -P and -U at the same time. For example, -pg and -mfentry only needs -U option since all functions are already enabled (traceable). While regular binary and -fpatchable-function-entry only needs -P.

So I think it's ok to change.

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
0