From owner-freebsd-hackers Tue Mar 18 23:46:41 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87A6737B407 for ; Tue, 18 Mar 2003 23:46:40 -0800 (PST) Received: from Princeton.EDU (postoffice.Princeton.EDU [128.112.129.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF99143F3F for ; Tue, 18 Mar 2003 23:46:33 -0800 (PST) (envelope-from yruan@cs.princeton.edu) Received: from smtpserver2.Princeton.EDU (smtpserver2.Princeton.EDU [128.112.129.148]) by Princeton.EDU (8.12.8/8.12.8) with ESMTP id h2J7kWBc026195 for ; Wed, 19 Mar 2003 02:46:32 -0500 (EST) Received: from cs.princeton.edu (targe.CS.Princeton.EDU [128.112.139.194]) (authenticated bits=0) by smtpserver2.Princeton.EDU (8.12.8/8.12.8) with ESMTP id h2J7kVKl016112 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Wed, 19 Mar 2003 02:46:32 -0500 (EST) Message-ID: <3E781FE1.10A0F029@cs.princeton.edu> Date: Wed, 19 Mar 2003 02:44:33 -0500 From: Yaoping Ruan X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: hackers@FreeBSD.ORG Subject: mcount() / kernel profiling References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Greeting, Could anybody give me some advise about the kernel profiling implementation in FreeBSD. Specifically, I am confused by: 1. Is the asm code in /sys/i386/isa/prof_machdep.c the entry code plugged into each function? and it calls _MCOUNT_DECL(frompc, selfpc) in /sys/libkern/mcount.c, which to my understanding is the implementation doing real profiling? 2. How does __mcount linked by each function? I know GCC has an option -finstrument-functions and one can write __cyg_profile_func_enter() and __cyg_profile_func_exit() procedure. But what mechanism is used for mcount? Thanks a lot - Yaoping R. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message