[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 06 of 10] xenalyze: move struct record_info into a header



Split out struct record_info onto the analyze.h so it can be used
outside of xenalyze.c.

Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx>
---

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 <stdint.h>
+
 #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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.