Skip to content

Conversation

@snehavats1404
Copy link

@snehavats1404 snehavats1404 commented Jan 12, 2025

What problem does this PR solve?

Issue Number: resolve #1251

Problem Summary: The read_command_name function previously used /proc/self/stat to retrieve command names, which could lead to incorrect handling of command names, especially those enclosed in parentheses. This change improves accuracy and robustness by switching to /proc/self/cmdline and normalizing the command names.

What is changed and the side effects?

Changed: Replaced /proc/self/stat with /proc/self/cmdline in the read_command_name function.

Side effects:
-Performance effects (性能影响): Minimal impact; reading from /proc/self/cmdline is comparable in performance to reading from /proc/self/stat.
-Breaking backward compatibility (向后兼容性): No known breaking changes; the function behavior is expected to improve without impacting existing functionality.

@yanglimingcn
Copy link
Contributor

don't format file, just format what you changed

@snehavats1404
Copy link
Author

staging all changes u mean? @yanglimingcn

@snehavats1404
Copy link
Author

@chenBright is my PR now suitable?

Copy link
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

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

This PR has many unrelated changes. No need to format the whole file.

@lorinlee
Copy link
Contributor

lorinlee commented Apr 3, 2025

@snehavats1404 Hello, thank you for your contribution. Could you please modify the code according to the feedback provided in the review?

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.

command_name大于15个字符的时候会被截断

4 participants