From: Michael Buesch <mbuesch@freenet.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: [UDEV, PATCH] Add profiling support to Makefile
Date: Tue, 15 Feb 2005 08:45:57 +0000 [thread overview]
Message-ID: <200502150946.02260.mbuesch@freenet.de> (raw)
In-Reply-To: <200502131716.55756.mbuesch@freenet.de>
[-- Attachment #1.1: Type: text/plain, Size: 1052 bytes --]
Quoting Greg KH <greg@kroah.com>:
> On Sun, Feb 13, 2005 at 05:16:51PM +0100, Michael Buesch wrote:
> > 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.
>
> You forgot to update the documentation about this option, so I'll hold
> off till you redo that :)
Oops. :O Here it is.
> Also, what has profiling information helped you out with in udev? Found
> anything interesting? Or are you just using it for coverage analysis
> (which is a flawed thing, but that's another topic...)
I did not do much testing, yet, because of missing time.
But I will do that.
My first testrun showed that the namedev matchrule function and the udevdb
are the slowest parts of the whole executable. So maybe there's some
optimization possible. But I'll look closer at it later.
> thanks,
>
> greg k-h
>
>
--
Regards Michael Buesch [ http://www.tuxsoft.de.vu ]
[-- Attachment #1.2: udev_profilesupport.diff --]
[-- Type: text/x-diff, Size: 1993 bytes --]
===== README 1.15 vs edited =====
--- 1.15/README 2004-10-06 00:51:23 +02:00
+++ edited/README 2005-02-15 09:40:07 +01:00
@@ -50,6 +50,13 @@
DEBUG
if set to 'true', debugging messages will be sent to the syslog
as udev is run. Default value is 'false'.
+ PROFILE
+ if set to 'true', additional profiling code is generated by gcc.
+ Every run of any udev executable will generate the gmon.out file,
+ which can be examined by tools like gprof / kprof and so on.
+ Klibc does NOT support profiling. Profiling is automatically
+ disabled if USE_KLIBC=true.
+ Default value is 'false'.
KERNEL_DIR
If this is not set it will default to /lib/modules/`uname -r`/build
This is used if USE_KLIBC=true to find the kernel include
===== 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 --]
next prev parent reply other threads:[~2005-02-15 8:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-13 16:16 [UDEV, PATCH] Add profiling support to Makefile Michael Buesch
2005-02-15 3:54 ` Greg KH
2005-02-15 8:45 ` Michael Buesch [this message]
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=200502150946.02260.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).