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

bugfix: trace main thread only #3

Closed
wants to merge 1 commit into from

Conversation

kingluo
Copy link

@kingluo kingluo commented Dec 14, 2022

When some new features are used, e.g. grpc-client-nginx-module, lua-resty-ffi, the nginx worker process has multiple threads.

CPU flamegraph is only meaningful for the main thread, which runs nginx event loop and lua code, so we should ignore other threads.

tid() gets the thread id, and in Linux, the process id is just equal to its main thread id, so we should use tid() to match target().

When some new features, e.g. grpc-client-nginx-module, lua-resty-ffi are
used, the nginx worker process has multiple threads.

CPU flamegraph is only meaningful for the main thread, which runs nginx
event loop and lua code, so we should ignore other threads.

`tid()` gets the thread id, and in Linux, the process id is just equal
to its main thread id, so we should use `tid()` to match `target()`.
Copy link

@membphis membphis left a comment

Choose a reason for hiding this comment

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

LGTM

@kingluo kingluo closed this Jul 13, 2024
@kingluo kingluo deleted the bugfix_pid branch July 13, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants