WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH 2/6] trace: fix T_INFO_FIRST_OFFSET

To: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH 2/6] trace: fix T_INFO_FIRST_OFFSET
From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Date: Wed, 30 Jun 2010 17:10:27 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Wed, 30 Jun 2010 09:11:28 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=usK8nsJDCbnis/IFEYYhInK5qAj+2pCV2pY5BDS43Lc=; b=SG14889ZH0Bnop9LjFSTSv1eHi+yK/74vBJOo7tPeaFu+Cl8zi+LczzhHiPYoXo0vw 0Vz5yjPtAyHY3Pd/hgzD7uq33N9KbYuEB1Eq72z/9zH5OdnWxhPW9wVOO3ZgR7MkJj1n yquYuUkoK8T5VxSUIDrs0hBRflhNm3o7KSCbM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Q5X26cmjwpvTedcCn4rIjU277ijbc+QWnRBsx7R1q0Gl3v4XZiuILaXwdWajjARr5c I7bEe4bOrHznnpmm69Kd2NKcpSswtMsluQrMF1upMo16B7M8/qZevSonpWVzn7xqeaPI jI7mMHp7u6szxaDh3XTpvv9XtyjFmXetz8U30=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C2B62AB.3020006@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4C2A2E370200007800008A61@xxxxxxxxxxxxxxxxxx> <AANLkTikGlmu-890_QnnjrFC8tZD2XhomriA9HZMskeVL@xxxxxxxxxxxxxx> <4C2B7BC60200007800008DFF@xxxxxxxxxxxxxxxxxx> <4C2B62AB.3020006@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Here's a version that calculates t_info_first_offset during
initialization, based on the actual layout of struct t_info and
NR_CPUs.

 -George

On Wed, Jun 30, 2010 at 4:28 PM, George Dunlap
<george.dunlap@xxxxxxxxxxxxx> wrote:
> Jan Beulich wrote:
>>
>> That part your patch doesn't address either - rather than
>> sizeof(uint16_t) as the first part of the expression you'd need to
>> use sizeof(struct t_info) or offsetof(struct t_info, mfn_offset).
>>
>
> I was assuming that when someone changed struct t_info that they'd modify
> this macro as well; I suppose then that the two complaints are really
> different aspects of the same one -- that it might not be clear to the
> person who adjusts struct t_info how to translate those changes into
> T_INFO_FIRST_OFFSET.  I think this way is more clear.
>
> I suppose even better might be to calculate t_info.mfn_mfn_offset[NR_CPUS]
> (or perhaps ...[num_possible_cpus]).  Hmm... let me see what I can come up
> with.
>>
>> Btw., didn't we agree that public headers shouldn't make use of
>> language extensions? struct t_info uses a variable sized array,
>> which is an extension (standard only in C99).
>>
>
> I'm not an expert in this.  It's lot more hassle to lay out the data the way
> I'd like without it.  I'll defer judgment to Keir.
>
> -George
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

Attachment: trace-t_info-first-offset-v3.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel