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

Evaluate use of argv[0] from /proc/$PID/cmdline instead of/additionally to /proc/$pid/comm #352

Open
cvonelm opened this issue Nov 27, 2024 · 0 comments

Comments

@cvonelm
Copy link
Member

cvonelm commented Nov 27, 2024

According to this LWN article: https://lwn.net/Articles/999770/, if a program is started using fexecve, which takes a file descriptor instead of a filename, then /proc/$PID/comm contains the file descriptor number instead of the name of the program.

Having something like "5" as a name for a program in the trace instead of the actual name of the program, sounds not very helpful.

The right(tm) way, according to Torvalds in the discussion mentioned in the article, is to use argv[0] from /proc/$PID/cmdline instead.

As whats in argv[0] differs from what we currently (somewhat wrongly) assume to be in /proc/$PID/comm, this is not a drop-in replacement.

This might also affect the comm field in the PERF_RECORD_MISC_COMM_EXEC events that we get from perf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant