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

Fix pthread cmdline issue #2872

Merged
merged 2 commits into from
Feb 20, 2021
Merged

Fix pthread cmdline issue #2872

merged 2 commits into from
Feb 20, 2021

Conversation

xiaoxiang781216
Copy link
Contributor

@xiaoxiang781216 xiaoxiang781216 commented Feb 19, 2021

Summary

  • fs/procfs: Avoid the duplicated 0x prefix in pthread cmdline
  • pthread: Change the default name from to <0xyyyyyyyy>
    Before change:
   63    20 100 RR       pthread --- Waiting  Signal    00000000 006148 000744  12.1%    0.0% <pthread> 0x0x341de68c

After change:

   63    20 100 RR       pthread --- Waiting  Signal    00000000 006148 000744  12.1%    0.0% <0x34187c00> 0x341de68c

Note, you can still change pthread name through pthread_setname_np, this patch just modify the default behaviour.

Impact

The content from: /proc/xxx/cmdline

Testing

include/pthread.h Outdated Show resolved Hide resolved
@davids5
Copy link
Contributor

davids5 commented Feb 19, 2021

Will you consider a "pt-" prefix?

@xiaoxiang781216
Copy link
Contributor Author

Is it enough to identify pthread by <>? task/kthread doesn't quote his name by <> normally.

@davids5
Copy link
Contributor

davids5 commented Feb 20, 2021

My feeling is that before it said what it was now it does not. The prefix of pt at least is a clue. Not really more obvious than <> but pthread-0xyyyyy would tell the whole story.

like this:
... <pthread> 0x0x341de68c
by removing "0x" from format string

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
since it's very easy to identify thread through entry pointer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
@xiaoxiang781216
Copy link
Contributor Author

Ok, it show pt-0xyyyyyyyy now.

@davids5 davids5 merged commit 092d23b into apache:master Feb 20, 2021
@xiaoxiang781216 xiaoxiang781216 deleted the pthread branch February 21, 2021 15:35
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.

3 participants