help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to hold the finish of a program so that /proc/<pid>/m


From: Leonid Isaev (ifax)
Subject: Re: Is there a way to hold the finish of a program so that /proc/<pid>/maps can be accessed?
Date: Thu, 28 Jan 2021 05:34:11 +0000

On Tue, Jan 26, 2021 at 12:17:14AM -0600, Peng Yu wrote:
> Once I run a program, I want be able to cat /proc/<pid>/maps (on
> Linux). But the program may finish before /proc/<pid>/maps is
> accessed.
> 
> Is there a way to hold the execuration of the program to give enough
> time to access /proc/<pid>/maps? In terms of psuedo code (in one
> script), it looks like something like this.
> 
> start_and_hold_program myprog &
> pid=$!
> cat /proc/$pid/maps
> let_it_finish $pid

Ideally, you'd modify "myprog" to dump whatever state you need. But if you
can't, have a look at preeny [1]...

[1] https://superuser.com/a/913094

Hopefully this helps,
L.

--
Leonid Isaev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]