From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 06 of 10] xenalyze: move struct record_info into a header Date: Thu, 7 Jun 2012 12:11:26 +0100 Message-ID: <4FD08C5E.3010201@eu.citrix.com> References: <5723153376e0d7102012.1338462982@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5723153376e0d7102012.1338462982@qabil.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 31/05/12 12:16, David Vrabel wrote: > Split out struct record_info onto the analyze.h so it can be used > outside of xenalyze.c. I assume this is mainly to support the plugin infrastructure? -George > > Signed-off-by: David Vrabel > --- > > diff --git a/analyze.h b/analyze.h > --- a/analyze.h > +++ b/analyze.h > @@ -1,5 +1,8 @@ > #ifndef __ANALYZE_H > # define __ANALYZE_H > + > +#include > + > #define TRC_GEN_MAIN 0 > #define TRC_SCHED_MAIN 1 > #define TRC_DOM0OP_MAIN 2 > @@ -47,4 +50,56 @@ enum { > }; > > #define TRC_HVM_OP_DESTROY_PROC (TRC_HVM_HANDLER + 0x100) > + > +typedef unsigned long long tsc_t; > + > +/* -- on-disk trace buffer definitions -- */ > +struct trace_record { > + union { > + struct { > + unsigned event:28, > + extra_words:3, > + cycle_flag:1; > + union { > + struct { > + uint32_t tsc_lo, tsc_hi; > + uint32_t data[7]; > + } tsc; > + struct { > + uint32_t data[7]; > + } notsc; > + } u; > + }; > + uint32_t raw[8]; > + }; > +}; > + > +/* -- General info about a current record -- */ > +struct time_struct { > + unsigned long long time; > + unsigned int s, ns; > +}; > + > +#define DUMP_HEADER_MAX 256 > + > +struct record_info { > + int cpu; > + tsc_t tsc; > + union { > + unsigned event; > + struct { > + unsigned minor:12, > + sub:4, > + main:12, > + unused:4; > + } evt; > + }; > + int extra_words; > + int size; > + uint32_t *d; > + char dump_header[DUMP_HEADER_MAX]; > + struct time_struct t; > + struct trace_record rec; > +}; > + > #endif > diff --git a/xenalyze.c b/xenalyze.c > --- a/xenalyze.c > +++ b/xenalyze.c > @@ -40,8 +40,6 @@ > struct mread_ctrl; > > > -typedef unsigned long long tsc_t; > - > #define DEFAULT_CPU_HZ 2400000000LL > #define ADDR_SPACE_BITS 48 > #define DEFAULT_SAMPLE_SIZE 10240 > @@ -260,57 +258,8 @@ struct { > .interval = { .msec = DEFAULT_INTERVAL_LENGTH }, > }; > > -/* -- on-disk trace buffer definitions -- */ > -struct trace_record { > - union { > - struct { > - unsigned event:28, > - extra_words:3, > - cycle_flag:1; > - union { > - struct { > - uint32_t tsc_lo, tsc_hi; > - uint32_t data[7]; > - } tsc; > - struct { > - uint32_t data[7]; > - } notsc; > - } u; > - }; > - uint32_t raw[8]; > - }; > -}; > - > FILE *warn = NULL; > > -/* -- General info about a current record -- */ > -struct time_struct { > - unsigned long long time; > - unsigned int s, ns; > -}; > - > -#define DUMP_HEADER_MAX 256 > - > -struct record_info { > - int cpu; > - tsc_t tsc; > - union { > - unsigned event; > - struct { > - unsigned minor:12, > - sub:4, > - main:12, > - unused:4; > - } evt; > - }; > - int extra_words; > - int size; > - uint32_t *d; > - char dump_header[DUMP_HEADER_MAX]; > - struct time_struct t; > - struct trace_record rec; > -}; > - > /* -- Summary data -- */ > struct cycle_framework { > tsc_t first_tsc, last_tsc, total_cycles;