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

Support task tracer #2851

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Support task tracer #2851

merged 4 commits into from
Jan 6, 2025

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Dec 16, 2024

What problem does this PR solve?

Issue Number: resolve #2389 #2797

Problem Summary:

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@wwbmmm
Copy link
Contributor

wwbmmm commented Dec 17, 2024

LGTM

@chenBright chenBright force-pushed the stb branch 2 times, most recently from 6b52eba to 4b4a974 Compare December 20, 2024 02:00
@chenBright
Copy link
Contributor Author

改动了以下几点:

  1. 优化信号追踪模式,使用信号量和self-pipe代理while + sleep,延时减少50%以上。
  2. 信号追踪模式的同步变量由原来的成员变量改成每次追踪分配一个,避免没有及时执行的信号处理函数影响后续的信号追踪。
  3. 移除信号追踪期间的bvar使用,因为初次使用bvar时会访问内存,可能会导致死锁。
  4. 一个还没分配栈的bthread在旧bthread结束时被调度,会复用旧bthread栈,并直接执行,不需要jump_stack。所以,bthread状态直接从TASK_STATUS_FIRST_READY变成TASK_STATUS_RUNNING,这样才能追踪该bthread。

@wwbmmm
Copy link
Contributor

wwbmmm commented Dec 21, 2024

LGTM

@chenBright
Copy link
Contributor Author

rebase解决冲突

@wwbmmm wwbmmm merged commit a18463f into apache:master Jan 6, 2025
20 checks passed
@chenBright chenBright deleted the stb branch January 6, 2025 06:59
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.

bthread能否引入STW进行实时打印
2 participants