Dwarves Archive on lore.kernel.org
 help / color / Atom feed
From: Arnaldo Carvalho de Melo <acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: jamal <hadi-fAAogVwAN2Kw5LPnMra/2Q@public.gmane.org>
Cc: dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: eat your own dog food?
Date: Sat, 12 Jan 2008 13:21:09 -0200
Message-ID: <20080112152109.GA23567@ghostprotocols.net> (raw)
In-Reply-To: <1200001276.4443.40.camel@localhost>

Em Thu, Jan 10, 2008 at 04:41:16PM -0500, jamal escreveu:
> On Thu, 2008-10-01 at 19:39 -0200, Arnaldo Carvalho de Melo wrote:
> 
> 
> > Working now on unions, etc, have you had the chance of testing this
> > patch?
> 
> I should be able to test it in a couple of hours. If you have the unions
> change before then, send me a unified patch - else an incremental
> version.

Remove the non-commited patches and do a git-pull, basic work is done,
reusing code I had in ctracer to do some simple alignment fixups.

Please let me know about any bugs you may find.

- Arnaldo

commit f6eb9ed92dafbd8cac082737fe0352c0ff6e7fdc
Author: Arnaldo Carvalho de Melo <acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date:   Sat Jan 12 13:14:40 2008 -0200

    [PAHOLE]: Allow changing the architecture word-size
    
    Using a x86_64 binary:
    
    [acme@doppio pahole]$ build/pahole -C restart_block /usr/lib/debug/lib/modules/2.6.21-65.el5rt/kernel/drivers/net/e1000/e1000.ko.debug
    struct restart_block {
    	long int          (*fn)(struct restart_block *); /*     0     8 */
    	union {
    		struct {
    			long unsigned int arg0;          /*     8     8 */
    			long unsigned int arg1;          /*    16     8 */
    			long unsigned int arg2;          /*    24     8 */
    			long unsigned int arg3;          /*    32     8 */
    		};                                       /*          32 */
    		struct {
    			u32 *      uaddr;                /*     8     8 */
    			u32        val;                  /*    16     4 */
    			u32        flags;                /*    20     4 */
    			u64        time;                 /*    24     8 */
    		} fu;                                    /*          24 */
    	};                                               /*     8    32 */
    
    	/* size: 40, cachelines: 1 */
    	/* last cacheline: 40 bytes */
    };
    
    Changing the word-size from 8 to 4 bytes:
    
    [acme@doppio pahole]$ build/pahole -w 4 -C restart_block /usr/lib/debug/lib/modules/2.6.21-65.el5rt/kernel/drivers/net/e1000/e1000.ko.debug
    struct restart_block {
    	long int       (*fn)(struct restart_block *); /*     0     4 */
    	union {
    		struct {
    			long unsigned int arg0;          /*     4     4 */
    			long unsigned int arg1;          /*     8     4 */
    			long unsigned int arg2;          /*    12     4 */
    			long unsigned int arg3;          /*    16     4 */
    		};                                       /*          16 */
    		struct {
    			u32 *      uaddr;                /*     4     4 */
    			u32        val;                  /*     8     4 */
    			u32        flags;                /*    12     4 */
    			u64        time;                 /*    16     8 */
    		} fu;                                    /*          20 */
    	};                                               /*     4    20 */
    
    	/* size: 24, cachelines: 1 */
    	/* last cacheline: 24 bytes */
    };
    
    And from 8 to 16:
    
    [acme@doppio pahole]$ build/pahole -w 16 -C restart_block /usr/lib/debug/lib/modules/2.6.21-65.el5rt/kernel/drivers/net/e1000/e1000.ko.debug
    struct restart_block {
    	long int          (*fn)(struct restart_block *); /*     0    16 */
    	union {
    		struct {
    			long unsigned int arg0;          /*    16    16 */
    			long unsigned int arg1;          /*    32    16 */
    			long unsigned int arg2;          /*    48    16 */
    			long unsigned int arg3;          /*    64    16 */
    			/* --- cacheline 1 boundary (64 bytes) --- */
    		};                                       /*          64 */
    		struct {
    			u32 *      uaddr;                /*    16    16 */
    			u32        val;                  /*    32     4 */
    			u32        flags;                /*    36     4 */
    			u64        time;                 /*    40     8 */
    		} fu;                                    /*          32 */
    	};                                               /*    16    64 */
    	/* --- cacheline 1 boundary (64 bytes) was 16 bytes ago --- */
    
    	/* size: 80, cachelines: 2 */
    	/* last cacheline: 16 bytes */
    };
    
    More work is required to specify different alignment rules.
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply index

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 12:42 jamal
2008-01-10 13:39 ` Arnaldo Carvalho de Melo
     [not found]   ` <20080110133926.GF22437-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-10 13:55     ` jamal
2008-01-10 14:06       ` Arnaldo Carvalho de Melo
     [not found]         ` <20080110140635.GG22437-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-10 16:39           ` Arnaldo Carvalho de Melo
     [not found]             ` <20080110163959.GJ22437-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-10 21:37               ` jamal
2008-01-10 21:44                 ` Arnaldo Carvalho de Melo
     [not found]                   ` <20080110214438.GT22437-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-11  0:45                     ` jamal
2008-01-11  1:04                       ` jamal
2008-01-10 21:39               ` Arnaldo Carvalho de Melo
     [not found]                 ` <20080110213909.GS22437-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-10 21:41                   ` jamal
2008-01-12 15:21                     ` Arnaldo Carvalho de Melo [this message]
     [not found]                       ` <20080112152109.GA23567-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-12 15:54                         ` Changing the word-size was: " Arnaldo Carvalho de Melo
     [not found]                           ` <20080112155404.GB23567-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-12 16:28                             ` Arnaldo Carvalho de Melo
     [not found]                               ` <20080112162808.GC23567-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-12 17:28                                 ` Arnaldo Carvalho de Melo
     [not found]                                   ` <20080112172856.GD23567-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-12 18:08                                     ` jamal
2008-01-12 18:42                                       ` Arnaldo Carvalho de Melo
     [not found]                                         ` <20080112184211.GA17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-13  0:42                                           ` jamal
2008-01-13  1:15                                             ` jamal
     [not found]                                               ` <20080113163106.GE17675@ghostprotocols.net>
     [not found]                                                 ` <20080113163106.GE17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-13 18:07                                                   ` Arnaldo Carvalho de Melo
     [not found]                                                     ` <20080113180730.GG17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-13 18:19                                                       ` Arnaldo Carvalho de Melo
     [not found]                                                         ` <20080113181901.GH17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-13 18:26                                                           ` Arnaldo Carvalho de Melo
     [not found]                                                             ` <20080113182657.GI17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-13 19:13                                                               ` jamal
2008-01-12 21:36                                     ` Arnaldo Carvalho de Melo
     [not found]                                       ` <20080112213635.GC17675-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-12 22:08                                         ` Arnaldo Carvalho de Melo

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=20080112152109.GA23567@ghostprotocols.net \
    --to=acme-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hadi-fAAogVwAN2Kw5LPnMra/2Q@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

Dwarves Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dwarves/0 dwarves/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dwarves dwarves/ https://lore.kernel.org/dwarves \
		dwarves@vger.kernel.org
	public-inbox-index dwarves

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dwarves


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git