On Wed, 2010-10-13 at 16:02 +0200, Jiří Župka wrote:
> Signed-off-by: Jiří Župka <[email protected]>
Hey Jiri!
My only complaint about this is that the get_field function should go
first in the patch series. Nothing major, of course.
> ---
> 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.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest