Signed-off-by: Jiří Župka <[email protected]>
---
 client/common_lib/utils.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 2cbc740..8d6c1f7 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -1105,6 +1105,14 @@ def get_pid_from_file(program_name):
     return pid
 
 
+def get_process_name(pid):
+    """
+    Get process name from PID.
+    @param pid: PID of process.
+    """
+    return get_field(read_file("/proc/%d/stat" % pid), 1)[1:-1]
+
+
 def program_is_alive(program_name):
     """
     Checks if the process is alive and not in Zombie state.
-- 
1.7.2.3

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to