From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Buesch Date: Tue, 15 Feb 2005 08:45:57 +0000 Subject: Re: [UDEV, PATCH] Add profiling support to Makefile Message-Id: <200502150946.02260.mbuesch@freenet.de> MIME-Version: 1 Content-Type: multipart/mixed; boundary="nextPart2220113.YqgpuUs851" List-Id: References: <200502131716.55756.mbuesch@freenet.de> In-Reply-To: <200502131716.55756.mbuesch@freenet.de> To: linux-hotplug@vger.kernel.org --nextPart2220113.YqgpuUs851 Content-Type: multipart/mixed; boundary="Boundary-01=_FbbECiqniXOWkUd" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_FbbECiqniXOWkUd Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoting Greg KH : > On Sun, Feb 13, 2005 at 05:16:51PM +0100, Michael Buesch wrote: > > Hi, > >=20 > > 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(). > >=20 > > Please apply. Thanks. >=20 > 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, >=20 > greg k-h >=20 >=20 =2D-=20 Regards Michael Buesch [ http://www.tuxsoft.de.vu ] --Boundary-01=_FbbECiqniXOWkUd Content-Type: text/x-diff; charset="iso-8859-1"; name="udev_profilesupport.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="udev_profilesupport.diff" =3D=3D=3D=3D=3D README 1.15 vs edited =3D=3D=3D=3D=3D =2D-- 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=3Dtrue. + 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=3Dtrue to find the kernel include =3D=3D=3D=3D=3D Makefile 1.232 vs edited =3D=3D=3D=3D=3D =2D-- 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 =3D false =20 +# Set the following to 'true' to let gcc generate +# additional profiling code. +# Profiling is NOT supported by klibc and disabled +# automatically if USE_KLIBC=3Dtrue +PROFILE =3D false + # Set this to compile with Security-Enhanced Linux support. USE_SELINUX =3D false =20 @@ -162,6 +168,10 @@ CFLAGS +=3D -DLOG endif =20 +ifeq ($(strip $(PROFILE)),true) + PROFILE_FLAGS =3D -pg -fno-omit-frame-pointer +endif + # if DEBUG is enabled, then we do not strip or optimize ifeq ($(strip $(DEBUG)),true) CFLAGS +=3D -O1 -g -DDEBUG -D_GNU_SOURCE @@ -185,6 +195,8 @@ # arch specific objects ARCH_LIB_OBJS =3D $(KLIBC_DIR)/libc.a =20 + # profiling is not supported by klibc (missing mcount() function) + PROFILE_FLAGS =3D =20 CRT0 =3D $(KLIBC_DIR)/crt0.o LIBC =3D $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) @@ -218,6 +230,9 @@ LIB_OBJS =3D -lc LDFLAGS =3D endif + +CFLAGS +=3D $(PROFILE_FLAGS) +LIB_OBJS +=3D $(PROFILE_FLAGS) =20 ifeq ($(strip $(USE_SELINUX)),true) UDEV_OBJS +=3D udev_selinux.o --Boundary-01=_FbbECiqniXOWkUd-- --nextPart2220113.YqgpuUs851 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBCEbbKFGK1OIvVOP4RAvC3AKDWCGwnOLSkjIHDfxOF/+obc9qCnACcDRnZ lpy/w0GmINrpjYyVcommZxA= =4CRF -----END PGP SIGNATURE----- --nextPart2220113.YqgpuUs851-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel