From owner-freebsd-questions Thu Feb 21 15:17:46 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id 9064D37B427 for ; Thu, 21 Feb 2002 15:17:36 -0800 (PST) Received: (qmail 72273 invoked by uid 100); 21 Feb 2002 23:17:34 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15477.32781.764487.999101@guru.mired.org> Date: Thu, 21 Feb 2002 17:17:33 -0600 To: Haryadi Gunawi Cc: questions@freebsd.org Subject: Re: /proc/pid/map (freeBSD vs Linux) In-Reply-To: <4555239@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.46 (Python 2.2; freebsd-4.5-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Haryadi Gunawi types: > Here is my project in detail. > - I have a PID (from getpid) > - Then I want to look what program has that PID (by looking at the > /proc/pid/map) > - next I must know what libraries are utilized, and their text segments > (where the code are allocated) > Now the problem is: > I don't know what is the executable name, and the > libraries utilized from /proc/pid/map in FreeBSD. > In Linux I can easily get them from the last column. > Where can I get those names in FreeBSD? /proc/pid/file is a symlink to the executable. If the executable isn't there any more, it just says "unknown". > I assume the numbers in the third column (1, 12, 57) mean something, but > I don't know what they are. The source is in /usr/src/sys/miscfs/procfs/procfs_map.c. These lines are describing objects in the VM system. The name of the file associated with that segment of memory is no longer in the kernel. It should be possible to grovel the library name out of that segment of the processes memory. Getting the full path name may be impossible. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message