public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Trent Piepho <tpiepho-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [patch 2.6.27-rc7] i2c: smbalert# support
Date: Sun, 23 Nov 2008 22:45:02 +0100	[thread overview]
Message-ID: <20081123224502.37500e60@hyperion.delvare> (raw)
In-Reply-To: <Pine.LNX.4.64.0811221055470.18022-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>

Hi Trent,

On Sat, 22 Nov 2008 12:28:56 -0800 (PST), Trent Piepho wrote:
> On Sat, 22 Nov 2008, Jean Delvare wrote:
> > On Fri, 21 Nov 2008 22:04:26 -0800 (PST), Trent Piepho wrote:
> >> The size of i2c-core, struct i2c_client and struct i2c_adapter:
> >> v2.6.28 9718 392 500	w/ smbalert patch
> >> v2.6.28 8878 392 472
> >> v2.6.27 8732 368 448
> >> v2.6.26 7877 352 440
> >> v2.6.25 7854 376 444
> >> v2.6.24 9060 372 444
> >> v2.6.23 9359 404 476
> >> v2.6.22 9330 448 520
> >> v2.6.21 7814 464 692
> >> v2.6.20 7896 444 672
> >> v2.6.19 7871 444 668
> >> v2.6.18 6857 436 660
> >
> > Thanks for providing these numbers, these are really useful! I'm
> > curious if you would be able to compute the same numbers down to, say,
> > kernel 2.6.5 or even 2.6.0? I'm curious where we started from.
> >
> > I am also interested in the script / method you used to come up with
> > these numbers, so that maybe I can get the numbers myself if you do not
> > have the time.
> 
> It's not entirely automatic since you have to deal with configuring the
> kernel.  It helps to start at the newest kernel and work backwards, since
> kconfig options are added more often than removed.
> 
> I put this in my .bashrc to make getting object sizes easier:
> function objsize { ${CROSS_COMPILE}objdump -h $1 | awk '/text|data|bss/{x=strtonum("0x"$3);printf "%-16s%d\t%d\n",$2,x,s+=x;}' ;}

Not sure why you don't just use "size" for this?

> Then to get structure sizes:
> cat > lib/size.c
> #include <linux/i2c.h>
> #define S(t) cpu_to_be32(sizeof(struct t))
> uint32_t a=S(i2c_adapter), b=S(i2c_client);  // reverse order in obj
> 
> On older kernels you have to replace cpu_to_be32() with ___constant_swab32()
> on little-endian systems and remove it on big-endian.
> 
> Then do this for each version:
> 
> ver=v2.6.17
> git checkout -f $ver
> echo 'obj-y += size.o' >> lib/Makefile
> mkdir $ver
> cp last.config $ver/.config
> make O=$ver
> # answer make questions, try not to turn on anything that adds debug/trace
> # code or extra fields to data structures.  Or turns off extra fields that
> # used to be mandatory.  Or changes compiler flags, e.g. inlining or regparm. 
> # Wait...
> ssize=`objdump -s -j .data $ver/lib/size.o |
>  	awk '/^ 0/{print strtonum("0x"$2),strtonum("0x"$3);}'`
> csize=`objsize $ver/drivers/i2c/i2c-core.o | awk 'END{print $3}'`
> echo `git describe` $csize $ssize >> i2csize
> cp $ver/.config last.config
> 
> v2.6.17 6934 416 640
> v2.6.16 7320 404 620

Hmm, OK, that's not exactly trivial... I don't think I'll have the time
to setup this.

Given that you already have everything in place, would you please
provide the additional numbers I am interested in? No need to do all
kernel versions down to 2.6.0, you certainly have more interesting
things to do with your time. All I am really interested in are 2.6.5
and 2.6.0. This should give us a good idea of where we started from.

Thanks,
-- 
Jean Delvare

  parent reply	other threads:[~2008-11-23 21:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200804161434.54335.laurentp@cse-semaphore.com>
     [not found] ` <20080416153043.02f89554@hyperion.delvare>
     [not found]   ` <200804161027.49943.david-b@pacbell.net>
     [not found]     ` <200804161027.49943.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-05-02 11:10       ` [patch 2.6.25-git] i2c: smbalert# support David Brownell
     [not found]         ` <200805020410.44723.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-05-05  5:56           ` [patch 2.6.265-rc1] " David Brownell
     [not found]             ` <200805042256.49252.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-23 22:32               ` [patch 2.6.27-rc7] " David Brownell
     [not found]                 ` <200809231532.40083.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-26  1:07                   ` [lm-sensors] " Trent Piepho
     [not found]                     ` <Pine.LNX.4.64.0809251728130.7680-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-09-26  2:01                       ` David Brownell
     [not found]                         ` <200809251902.00201.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-27  0:29                           ` Trent Piepho
     [not found]                             ` <Pine.LNX.4.64.0809261652040.7680-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-10-17 19:04                               ` David Brownell
     [not found]                                 ` <200810171204.54448.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-10-17 20:43                                   ` Trent Piepho
2008-11-18  8:15                   ` Jean Delvare
     [not found]                     ` <20081118091546.421d6b78-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-18 22:01                       ` David Brownell
     [not found]                         ` <200811181401.34809.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-19  9:51                           ` [lm-sensors] " Trent Piepho
     [not found]                             ` <Pine.LNX.4.64.0811190140510.11673-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-11-19 15:16                               ` Jean Delvare
     [not found]                                 ` <20081119161632.2d0bde9e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-20 22:00                                   ` Trent Piepho
     [not found]                                     ` <Pine.LNX.4.64.0811201354310.11673-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-11-20 22:56                                       ` David Brownell
     [not found]                                         ` <200811201456.36551.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-22  0:55                                           ` Trent Piepho
     [not found]                                             ` <Pine.LNX.4.64.0811211621340.18022-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-11-22  2:58                                               ` David Brownell
2008-11-21  8:42                                       ` Jean Delvare
     [not found]                                         ` <20081121094218.34ecd82a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-22  6:04                                           ` Trent Piepho
     [not found]                                             ` <Pine.LNX.4.64.0811212122370.18022-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-11-22 10:13                                               ` Jean Delvare
     [not found]                                                 ` <20081122111340.0bfc2c05-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-22 20:28                                                   ` Trent Piepho
     [not found]                                                     ` <Pine.LNX.4.64.0811221055470.18022-3bmvVOk6DZ+DGx/iekXGtrjh7zpefjiS@public.gmane.org>
2008-11-23 21:45                                                       ` Jean Delvare [this message]
2008-11-19 13:57                           ` Jean Delvare
     [not found]                             ` <20081119145712.1abaa63f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-19 18:08                               ` David Brownell
2008-11-21 14:18                           ` Jean Delvare
     [not found]                             ` <20081121151808.324ca78c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-21 16:24                               ` David Brownell
     [not found]                                 ` <200811210824.55601.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-21 19:22                                   ` Jean Delvare
     [not found]                                     ` <20081121202223.0261fb9c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-21 21:54                                       ` David Brownell
     [not found]                                         ` <200811211354.51501.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-22  9:03                                           ` Jean Delvare
     [not found]                                             ` <20081122100344.61cf42b7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-11-22  9:48                                               ` David Brownell

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=20081123224502.37500e60@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=tpiepho-KZfg59tc24xl57MIdRCFDg@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