It depends on the function of the Linux kernel: there are two different names for the process.
- One of the names is the last component of the path to the executable, for example.
native_executable if your application is located in /data/apps/com.example.hello/native_executable . This name appears in the Name /proc/PID/status field. The kernel truncates it to 15 characters, so in this case it contains native_executab . - Another name is passed by the program that calls the application as command line parameter # 0 (
argv[0] in C, args[0] in Java). This name appears at the beginning of /proc/PID/cmdline and ps displayed. - The path to the executable is also the target of the
/proc/PID/exe symbolic link.
By convention, when a program launches another, it should use the name of the executable file as a command line parameter 0, but it can do it differently. In the Name /proc/PID/status field, the (truncated) name of the executable file by the kernel is always specified.
This is a common Linux feature - see also. Can I use standard tools to get the full process name when its name has embedded spaces? on Set Ubuntu .
The application itself can subsequently change both names (although there are length restrictions). Dalvik uses this feature to distinguish between applications: all applications come from the same native executable /sytem/bin/app_process ; instead of letting all of them be called app_process , the virtual machine changes both names as the name of the application package. The name in /proc/PID/status limited to 15 characters, so it is truncated. You can get a longer name from /proc/PID/cmdline (read to first zero byte).
source share