public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Marcelo Tosatti
	<marcelo.tosatti-3EexvZdKGZRWk0Htik3J/w@public.gmane.org>,
	linux-acpi <linux-acpi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: acpi code size
Date: 15 Oct 2003 15:36:09 -0400	[thread overview]
Message-ID: <1066246567.2534.43.camel@dhcppc4> (raw)

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

FYI,
Building 2.4.23 with gcc -Os (as the source tree currently does) shrinks
acpi text compared to gcc -O2.  How much -0s it saves depends on the
version of gcc:


19.5% gcc version 3.2.2 20030222 (RHL 9.0)
20.6% gcc version 3.3.1 20030930 (Fedora Test3)

as measured by text size for drivers/acpi.o with all modules excluded.

cheers,
-Len

attached the script I use to measure acpi size, and the results for -O2
and -Os on gcc 3.3.1.


[-- Attachment #2: report.acpi.size --]
[-- Type: text/plain, Size: 1198 bytes --]

#!/bin/bash
# summarize the size of ACPI in Linux

# ACPI kernel modules
MODULE_FILES=
#for MODULE in drivers/acpi/*.ko ; do
#	if [ -f $MODULE ] ; then
#		MODULE_FILES="$MODULE_FILES $MODULE"
#	fi
#done

MODULE_LIST="ac asus_acpi battery button fan processor thermal toshiba_acpi"
if [ "$MODULE_FILES" = "" ] ; then
	DIR=drivers/acpi
	for MODULE in $MODULE_LIST; do
		if [ -f $DIR/$MODULE.o ] ; then
			MODULE_FILES="$MODULE_FILES $DIR/$MODULE.o"
		fi
	done
fi


if [ "$MODULE_FILES" != "" ] ; then
	echo Loadable Module Sizes:
	size $MODULE_FILES
	echo
	echo Static Kernel Size:
fi

# ACPI obj files outside drivers/acpi
STATIC_FILES=
# acpi objects in base kernel
for FILE in arch/i386/kernel/acpi/built-in.o arch/i386/kernel/acpi*.o ; do
	if [ -f $FILE ] ; then
		STATIC_FILES="$STATIC_FILES $FILE"
	fi
done


# ACPI core driver
DRIVER_DIR=drivers/acpi
for DRIVER_OBJECT in acpi.o built-in.o ; do
	if [ -f $DRIVER_DIR/$DRIVER_OBJECT ] ; then
		STATIC_FILES="$STATIC_FILES $DRIVER_DIR/$DRIVER_OBJECT"
	fi
done


NUM_FILES=`echo $STATIC_FILES | wc -w`
if [ $NUM_FILES == 0 ] ; then
	echo $0: no acpi code present
elif [ $NUM_FILES == 1 ] ; then
	size $STATIC_FILES
else
	size -t $STATIC_FILES
fi


[-- Attachment #3: size.23.O2 --]
[-- Type: text/plain, Size: 889 bytes --]

Loadable Module Sizes:
   text	   data	    bss	    dec	    hex	filename
   1712	    212	     12	   1936	    790	drivers/acpi/ac.o
   8628	    884	     24	   9536	   2540	drivers/acpi/asus_acpi.o
   6220	    212	     12	   6444	   192c	drivers/acpi/battery.o
   2532	    212	     24	   2768	    ad0	drivers/acpi/button.o
   1423	    212	     12	   1647	    66f	drivers/acpi/fan.o
   9643	    212	    172	  10027	   272b	drivers/acpi/processor.o
   7543	    212	     16	   7771	   1e5b	drivers/acpi/thermal.o
   3451	     72	     24	   3547	    ddb	drivers/acpi/toshiba_acpi.o

Static Kernel Size:
   text	   data	    bss	    dec	    hex	filename
   3214	      8	    136	   3358	    d1e	arch/i386/kernel/acpi.o
    917	     52	      0	    969	    3c9	arch/i386/kernel/acpi_wakeup.o
 178384	   4194	   4888	 187466	  2dc4a	drivers/acpi/acpi.o
 182515	   4254	   5024	 191793	  2ed31	(TOTALS)

[-- Attachment #4: size.23.Os --]
[-- Type: text/plain, Size: 889 bytes --]

Loadable Module Sizes:
   text	   data	    bss	    dec	    hex	filename
   1294	    212	     12	   1518	    5ee	drivers/acpi/ac.o
   7249	    884	     24	   8157	   1fdd	drivers/acpi/asus_acpi.o
   5297	    212	     12	   5521	   1591	drivers/acpi/battery.o
   2031	    212	     24	   2267	    8db	drivers/acpi/button.o
   1098	    212	     12	   1322	    52a	drivers/acpi/fan.o
   7905	    212	    172	   8289	   2061	drivers/acpi/processor.o
   5894	    212	     16	   6122	   17ea	drivers/acpi/thermal.o
   2669	     72	     24	   2765	    acd	drivers/acpi/toshiba_acpi.o

Static Kernel Size:
   text	   data	    bss	    dec	    hex	filename
   3214	      8	    136	   3358	    d1e	arch/i386/kernel/acpi.o
    917	     52	      0	    969	    3c9	arch/i386/kernel/acpi_wakeup.o
 141584	   4194	   4888	 150666	  24c8a	drivers/acpi/acpi.o
 145715	   4254	   5024	 154993	  25d71	(TOTALS)

                 reply	other threads:[~2003-10-15 19:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1066246567.2534.43.camel@dhcppc4 \
    --to=len.brown-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-acpi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=marcelo.tosatti-3EexvZdKGZRWk0Htik3J/w@public.gmane.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