All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mbuesch@freenet.de>
To: linux-hotplug@vger.kernel.org
Subject: [UDEV, PATCH] Add profiling support to Makefile
Date: Sun, 13 Feb 2005 16:16:51 +0000	[thread overview]
Message-ID: <200502131716.55756.mbuesch@freenet.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 260 bytes --]

Hi,

This patch adds an option to the Makefile to enable
profiling. Profiling is only enabled, when not building
against klibc, as klibc lacks support for mcount().

Please apply. Thanks.

-- 
Regards Michael Buesch  [ http://www.tuxsoft.de.vu ]



[-- Attachment #1.2: udev_makefile_profile.diff --]
[-- Type: text/x-diff, Size: 1234 bytes --]

===== Makefile 1.232 vs edited =====
--- 1.232/Makefile	2005-02-11 20:55:00 +01:00
+++ edited/Makefile	2005-02-13 17:15:25 +01:00
@@ -25,6 +25,12 @@
 # Leave this set to `false' for production use.
 DEBUG = false
 
+# Set the following to 'true' to let gcc generate
+# additional profiling code.
+# Profiling is NOT supported by klibc and disabled
+# automatically if USE_KLIBC=true
+PROFILE = false
+
 # Set this to compile with Security-Enhanced Linux support.
 USE_SELINUX = false
 
@@ -162,6 +168,10 @@
 	CFLAGS  += -DLOG
 endif
 
+ifeq ($(strip $(PROFILE)),true)
+	PROFILE_FLAGS = -pg -fno-omit-frame-pointer
+endif
+
 # if DEBUG is enabled, then we do not strip or optimize
 ifeq ($(strip $(DEBUG)),true)
 	CFLAGS  += -O1 -g -DDEBUG -D_GNU_SOURCE
@@ -185,6 +195,8 @@
 	# arch specific objects
 	ARCH_LIB_OBJS =	 $(KLIBC_DIR)/libc.a
 
+	# profiling is not supported by klibc (missing mcount() function)
+	PROFILE_FLAGS =
 
 	CRT0 = $(KLIBC_DIR)/crt0.o
 	LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
@@ -218,6 +230,9 @@
 	LIB_OBJS = -lc
 	LDFLAGS =
 endif
+
+CFLAGS += $(PROFILE_FLAGS)
+LIB_OBJS += $(PROFILE_FLAGS)
 
 ifeq ($(strip $(USE_SELINUX)),true)
 	UDEV_OBJS += udev_selinux.o

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-02-13 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-13 16:16 Michael Buesch [this message]
2005-02-15  3:54 ` [UDEV, PATCH] Add profiling support to Makefile Greg KH
2005-02-15  8:45 ` Michael Buesch
2005-02-15  9:12 ` Kay Sievers
2005-02-15 23:10 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502131716.55756.mbuesch@freenet.de \
    --to=mbuesch@freenet.de \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.