From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Profiling emacs. Date: Wed, 25 Mar 2009 13:03:26 -0400 Message-ID: References: <18615722.808621237997378857.JavaMail.www@wwinf4603> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1238000710 23173 80.91.229.12 (25 Mar 2009 17:05:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2009 17:05:10 +0000 (UTC) Cc: alinsoar@voila.fr, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 18:06:26 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LmWXI-00021K-Pg for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 18:05:12 +0100 Original-Received: from localhost ([127.0.0.1]:38718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmWVv-0004Fg-W6 for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 13:03:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmWVq-0004Ep-MZ for emacs-devel@gnu.org; Wed, 25 Mar 2009 13:03:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmWVm-0004EA-32 for emacs-devel@gnu.org; Wed, 25 Mar 2009 13:03:34 -0400 Original-Received: from [199.232.76.173] (port=60076 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmWVl-0004E7-Uq for emacs-devel@gnu.org; Wed, 25 Mar 2009 13:03:29 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:57765) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LmWVj-0007eG-MX; Wed, 25 Mar 2009 13:03:28 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n2PH3QF0025881; Wed, 25 Mar 2009 13:03:26 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 34E4D80B49; Wed, 25 Mar 2009 13:03:26 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Wed, 25 Mar 2009 18:43:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3238=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109835 Archived-At: >> Today I tried to compile Emacs including the profiler like so: >> >> CFLAGS=-pg LDFLAGS=-pg ./configure --without-x && make >> >> Emacs creates a profile >> >> However, when I run ./emacs -Q it creates the same gmon.out at all the times, even if I run and make something in emacs a few seconds or 1 minute. >> >> -rw-r--r-- 1 root root 4625 2009-03-25 11:45 gmon.out >> >> Running >> gprof emacs gmon.out | less >> >> it shows just help information, nothing about the symbols of emacs. >> >> Could you help me with some idea how to compile emacs includin the profiler? > This is a commentary from emacs.c: > /* Set up for profiling. This is known to work on FreeBSD, > GNU/Linux and MinGW. It might work on some other systems too. > Give it a try and tell us if it works on your system. To compile > for profiling, add -pg to the switches your platform uses in > CFLAGS and LDFLAGS. For example: > `make CFLAGS="-pg -g -O -DPROFILING=1" LDFLAGS="-pg -g"'. */ Yes, IIRC the -DPROFILING is the important one, otherwise only temacs is profiled. Stefan