]> sourceware.org Git - systemtap.git/commitdiff
(PR14571 partial fix) For dyninst, rename 'stat' to 'stat_data'.
authorDavid Smith <dsmith@redhat.com>
Mon, 17 Sep 2012 18:54:18 +0000 (13:54 -0500)
committerDavid Smith <dsmith@redhat.com>
Mon, 17 Sep 2012 18:54:18 +0000 (13:54 -0500)
* runtime/stat.h: To avoid clashing with 'stat' definition from
  /usr/include/sys/stat.h, rename internal 'stat' typedef to 'stat_data'.
* runtime/map-gen.c: Renamed 'stat' to 'stat_data'.
* runtime/map-stat.c: Ditto.
* runtime/map.c: Ditto.
* runtime/map.h: Ditto.
* runtime/pmap-gen.c: Ditto.
* runtime/stat-common.c: Ditto.
* runtime/stat.c: Ditto.

runtime/map-gen.c
runtime/map-stat.c
runtime/map.c
runtime/map.h
runtime/pmap-gen.c
runtime/stat-common.c
runtime/stat.c
runtime/stat.h

index 430b5531def611152ac632b24ce400d025efcc40..69993245be94669e85fbf1861d0c1c687f34eb88 100644 (file)
 #define MAP_GET_VAL(n) _stp_get_int64(n)
 #define NULLRET (int64_t)0
 #elif VALUE_TYPE == STAT
-#define VALTYPE stat*
+#define VALTYPE stat_data*
 #define VSTYPE int64_t
-#define VALNAME stat
+#define VALNAME stat_data
 #define VALN x
 #define MAP_SET_VAL(a,b,c,d) _new_map_set_stat(a,b,c,d)
 #define MAP_GET_VAL(n) _stp_get_stat(n)
-#define NULLRET (stat*)0
+#define NULLRET (stat_data*)0
 #else
 #error Need to define VALUE_TYPE as STRING, STAT, or INT64
 #endif /* VALUE_TYPE */
index 262c20b4f7fbabcd58e4d974e5ff1f4a03cb9a5e..2548a00157e61d0e6498f7712848ed5dab56a6e8 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "stat-common.c"
 
-static void _stp_map_print_histogram (MAP map, stat *sd)
+static void _stp_map_print_histogram (MAP map, stat_data *sd)
 {
        _stp_stat_print_histogram (&map->hist, sd);
 }
@@ -22,7 +22,7 @@ static void _stp_map_print_histogram (MAP map, stat *sd)
 static MAP _stp_map_new_hstat_log (unsigned max_entries, int key_size)
 {
        /* add size for buckets */
-       int size = HIST_LOG_BUCKETS * sizeof(int64_t) + sizeof(stat);
+       int size = HIST_LOG_BUCKETS * sizeof(int64_t) + sizeof(stat_data);
        MAP m = _stp_map_new (max_entries, STAT, key_size, size);
        if (m) {
                m->hist.type = HIST_LOG;
@@ -40,7 +40,7 @@ static MAP _stp_map_new_hstat_linear (unsigned max_entries, int ksize, int start
                return NULL;
        
         /* add size for buckets */
-       size = buckets * sizeof(int64_t) + sizeof(stat);
+       size = buckets * sizeof(int64_t) + sizeof(stat_data);
        
        m = _stp_map_new (max_entries, STAT, ksize, size);
        if (m) {
@@ -62,7 +62,7 @@ static PMAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int sta
                return NULL;
 
         /* add size for buckets */
-       size = buckets * sizeof(int64_t) + sizeof(stat);
+       size = buckets * sizeof(int64_t) + sizeof(stat_data);
 
        pmap = _stp_pmap_new (max_entries, STAT, ksize, size);
        if (pmap) {
@@ -90,7 +90,7 @@ static PMAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int sta
 static PMAP _stp_pmap_new_hstat_log (unsigned max_entries, int key_size)
 {
        /* add size for buckets */
-       int size = HIST_LOG_BUCKETS * sizeof(int64_t) + sizeof(stat);
+       int size = HIST_LOG_BUCKETS * sizeof(int64_t) + sizeof(stat_data);
        PMAP pmap = _stp_pmap_new (max_entries, STAT, key_size, size);
        if (pmap) {
                int i;
index 97cc6f7aace6b2c7fdfe3cf40f07c5fa57066d20..9bf625ebdf77ecbb6d87c715260790ae798a42e0 100644 (file)
@@ -21,7 +21,7 @@
 static int map_sizes[] = {
         sizeof(int64_t),
         MAP_STRING_LENGTH,
-        sizeof(stat),
+        sizeof(stat_data),
         0
 };
 
@@ -109,11 +109,11 @@ static char *_stp_get_str(struct map_node *m)
  * @param m pointer to the map_node.
  * @returns A pointer to the stats.  
  */
-static stat *_stp_get_stat(struct map_node *m)
+static stat_data *_stp_get_stat(struct map_node *m)
 {
        if (!m || m->map->type != STAT)
                return 0;
-       return (stat *)((long)m + m->map->data_offset);
+       return (stat_data *)((long)m + m->map->data_offset);
 }
 
 /** Return an int64 key from a map node.
@@ -459,8 +459,8 @@ static int _stp_cmp (struct list_head *a, struct list_head *b, int keynum, int d
                        a = _stp_key_get_int64(m1, keynum);
                        b = _stp_key_get_int64(m2, keynum);
                } else if (keynum < 0) {
-                       stat *sd1 = (stat *)((long)m1 + m1->map->data_offset);
-                       stat *sd2 = (stat *)((long)m2 + m2->map->data_offset);
+                       stat_data *sd1 = (stat_data *)((long)m1 + m1->map->data_offset);
+                       stat_data *sd2 = (stat_data *)((long)m2 + m2->map->data_offset);
                        switch (keynum) {
                        case SORT_COUNT:
                                a = sd1->count;
@@ -660,8 +660,8 @@ static struct map_node *_stp_new_agg(MAP agg, struct hlist_head *ahead, struct m
                                 0);
                break;
        case STAT: {
-               stat *sd1 = (stat *)((long)aptr + agg->data_offset);
-               stat *sd2 = (stat *)((long)ptr + ptr->map->data_offset);
+               stat_data *sd1 = (stat_data *)((long)aptr + agg->data_offset);
+               stat_data *sd2 = (stat_data *)((long)ptr + ptr->map->data_offset);
                Hist st = &agg->hist;
                sd1->count = sd2->count;
                sd1->sum = sd2->sum;
@@ -696,8 +696,8 @@ static void _stp_add_agg(struct map_node *aptr, struct map_node *ptr)
                                 1);
                break;
        case STAT: {
-               stat *sd1 = (stat *)((long)aptr + aptr->map->data_offset);
-               stat *sd2 = (stat *)((long)ptr + ptr->map->data_offset);
+               stat_data *sd1 = (stat_data *)((long)aptr + aptr->map->data_offset);
+               stat_data *sd2 = (stat_data *)((long)ptr + ptr->map->data_offset);
                Hist st = &aptr->map->hist;
                if (sd1->count == 0) {
                        sd1->count = sd2->count;
@@ -808,7 +808,7 @@ static void _new_map_clear_node (struct map_node *m)
                break;
        case STAT: 
        {
-               stat *sd = (stat *)((long)m + m->map->data_offset);
+               stat_data *sd = (stat_data *)((long)m + m->map->data_offset);
                Hist st = &m->map->hist;
                sd->count = 0;
                if (st->type != HIST_NONE) {
@@ -884,12 +884,12 @@ static int _new_map_set_str (MAP map, struct map_node *n, char *val, int add)
 
 static int _new_map_set_stat (MAP map, struct map_node *n, int64_t val, int add)
 {
-       stat *sd;
+       stat_data *sd;
 
        if (map == NULL || n == NULL)
                return -2;
 
-       sd = (stat *)((long)n + map->data_offset);
+       sd = (stat_data *)((long)n + map->data_offset);
        if (!add) {
                Hist st = &map->hist;
                sd->count = 0;
index 993fc5ebc467da5bdc710ed4edb70c2e10b4da60..51d657f8cd85770ac7c650e4b3f3d1a9662b1772 100644 (file)
@@ -179,9 +179,9 @@ static int int64_eq_p(int64_t key1, int64_t key2);
 void int64_copy(void *dest, int64_t val);
 void int64_add(void *dest, int64_t val);
 int64_t int64_get(void *ptr);
-void stat_copy(void *dest, stat *src);
-void stat_add(void *dest, stat *src);
-stat *stat_get(void *ptr);
+void stat_copy(void *dest, stat_data *src);
+void stat_add(void *dest, stat_data *src);
+stat_data *stat_get(void *ptr);
 static int64_t _stp_key_get_int64(struct map_node *mn, int n);
 static char * _stp_key_get_str(struct map_node *mn, int n);
 static unsigned int int64_hash(const int64_t v);
@@ -191,14 +191,14 @@ static void str_add(void *dest, char *val);
 static int str_eq_p(char *key1, char *key2);
 static int64_t _stp_get_int64(struct map_node *m);
 static char * _stp_get_str(struct map_node *m);
-static stat *_stp_get_stat(struct map_node *m);
+static stat_data *_stp_get_stat(struct map_node *m);
 static unsigned int str_hash(const char *key1);
 static MAP _stp_map_new(unsigned max_entries, int type, int key_size, int data_size);
 static PMAP _stp_pmap_new(unsigned max_entries, int type, int key_size, int data_size);
 static int msb64(int64_t x);
 static MAP _stp_map_new_hstat_log(unsigned max_entries, int key_size);
 static MAP _stp_map_new_hstat_linear(unsigned max_entries, int ksize, int start, int stop, int interval);
-static void _stp_map_print_histogram(MAP map, stat *s);
+static void _stp_map_print_histogram(MAP map, stat_data *s);
 static struct map_node * _stp_map_start(MAP map);
 static struct map_node * _stp_map_iter(MAP map, struct map_node *m);
 static void _stp_map_del(MAP map);
index 8261c89d4ab7d12d5031582f418af03ff6392ac9..c44b6339ca140c49a741a2252e3d56fea820a90e 100644 (file)
 #define MAP_GET_VAL(n) _stp_get_int64(n)
 #define NULLRET (int64_t)0
 #elif VALUE_TYPE == STAT
-#define VALTYPE stat*
+#define VALTYPE stat_data*
 #define VSTYPE int64_t
-#define VALNAME stat
+#define VALNAME stat_data
 #define VALN x
 #define MAP_SET_VAL(a,b,c,d) _new_map_set_stat(a,b,c,d)
 #define MAP_GET_VAL(n) _stp_get_stat(n)
-#define NULLRET (stat*)0
+#define NULLRET (stat_data*)0
 #else
 #error Need to define VALUE_TYPE as STRING, STAT, or INT64
 #endif /* VALUE_TYPE */
index fabe8404dfbcc7352d97c89e48a3f282a18e0c04..b247757e359584e5eb70a39b0ff2f22534933c18 100644 (file)
@@ -132,7 +132,8 @@ static int _stp_val_to_bucket(int64_t val)
 #endif
 
 
-static void _stp_stat_print_histogram_buf(char *buf, size_t size, Hist st, stat *sd)
+static void _stp_stat_print_histogram_buf(char *buf, size_t size, Hist st,
+                                         stat_data *sd)
 {
        int scale, i, j, val_space, cnt_space;
        int low_bucket = -1, high_bucket = 0, over = 0, under = 0;
@@ -279,13 +280,13 @@ static void _stp_stat_print_histogram_buf(char *buf, size_t size, Hist st, stat
 #undef HIST_PRINTF
 }
 
-static void _stp_stat_print_histogram(Hist st, stat *sd)
+static void _stp_stat_print_histogram(Hist st, stat_data *sd)
 {
        _stp_stat_print_histogram_buf(NULL, 0, st, sd);
        _stp_print_flush();
 }
 
-static void __stp_stat_add(Hist st, stat *sd, int64_t val)
+static void __stp_stat_add(Hist st, stat_data *sd, int64_t val)
 {
        int n;
        if (sd->count == 0) {
index 31b157dbebe1d0a3e14a10ef829fc5a7f47704a0..58c71eb0c47199f7200e62c239280d98576808a3 100644 (file)
 
 /* for the paranoid. */
 #if NEED_STAT_LOCKS == 1
-#define STAT_LOCK(st) spin_lock(&st->lock)
-#define STAT_UNLOCK(st) spin_unlock(&st->lock)
+#define STAT_LOCK(sd) spin_lock(&sd->lock)
+#define STAT_UNLOCK(sd) spin_unlock(&sd->lock)
 #else
-#define STAT_LOCK(st) ;
-#define STAT_UNLOCK(st) ;
+#define STAT_LOCK(sd) ;
+#define STAT_UNLOCK(sd) ;
 #endif
 
 /** Stat struct for stat.c. Maps do not need this */
 struct _Stat {
        struct _Hist hist;
        /* per-cpu data. allocated with _stp_alloc_percpu() */
-       stat *sd;
+       stat_data *sd;
        /* aggregated data */   
-       stat *agg;  
+       stat_data *agg;  
 };
 
 typedef struct _Stat *Stat;
@@ -77,7 +77,7 @@ typedef struct _Stat *Stat;
 static Stat _stp_stat_init (int type, ...)
 {
        int size, buckets=0, start=0, stop=0, interval=0;
-       stat *sd, *agg;
+       stat_data *sd, *agg;
        Stat st;
 
        if (type != HIST_NONE) {
@@ -102,8 +102,8 @@ static Stat _stp_stat_init (int type, ...)
        if (st == NULL)
                return NULL;
        
-       size = buckets * sizeof(int64_t) + sizeof(stat);        
-       sd = (stat *) _stp_alloc_percpu (size);
+       size = buckets * sizeof(int64_t) + sizeof(stat_data);   
+       sd = (stat_data *) _stp_alloc_percpu (size);
        if (sd == NULL)
                goto exit1;
 
@@ -111,13 +111,13 @@ static Stat _stp_stat_init (int type, ...)
        {
                int i;
                for_each_possible_cpu(i) {
-                       stat *sdp = per_cpu_ptr (sd, i);
+                       stat_data *sdp = per_cpu_ptr (sd, i);
                        spin_lock_init(sdp->lock);
                }
        }
 #endif
        
-       agg = (stat *)_stp_kmalloc_gfp(size, STP_ALLOC_SLEEP_FLAGS);
+       agg = (stat_data *)_stp_kmalloc_gfp(size, STP_ALLOC_SLEEP_FLAGS);
        if (agg == NULL)
                goto exit2;
 
@@ -159,7 +159,7 @@ static void _stp_stat_del (Stat st)
  */
 static void _stp_stat_add (Stat st, int64_t val)
 {
-       stat *sd = per_cpu_ptr (st->sd, get_cpu());
+       stat_data *sd = per_cpu_ptr (st->sd, get_cpu());
        STAT_LOCK(sd);
        __stp_stat_add (&st->hist, sd, val);
        STAT_UNLOCK(sd);
@@ -176,14 +176,14 @@ static void _stp_stat_add (Stat st, int64_t val)
  * @param cpu CPU number
  * @returns A pointer to a stat.
  */
-static stat *_stp_stat_get_cpu (Stat st, int cpu)
+static stat_data *_stp_stat_get_cpu (Stat st, int cpu)
 {
-       stat *sd = per_cpu_ptr (st->sd, cpu);
+       stat_data *sd = per_cpu_ptr (st->sd, cpu);
        STAT_LOCK(sd);
        return sd;
 }
 
-static void _stp_stat_clear_data (Stat st, stat *sd)
+static void _stp_stat_clear_data (Stat st, stat_data *sd)
 {
         int j;
         sd->count = sd->sum = sd->min = sd->max = 0;
@@ -204,15 +204,15 @@ static void _stp_stat_clear_data (Stat st, stat *sd)
  * for polling.
  * @returns A pointer to a stat.
  */
-static stat *_stp_stat_get (Stat st, int clear)
+static stat_data *_stp_stat_get (Stat st, int clear)
 {
        int i, j;
-       stat *agg = st->agg;
+       stat_data *agg = st->agg;
        STAT_LOCK(agg);
        _stp_stat_clear_data (st, agg);
 
        for_each_possible_cpu(i) {
-               stat *sd = per_cpu_ptr (st->sd, i);
+               stat_data *sd = per_cpu_ptr (st->sd, i);
                STAT_LOCK(sd);
                if (sd->count) {
                        if (agg->count == 0) {
@@ -247,7 +247,7 @@ static void _stp_stat_clear (Stat st)
 {
        int i;
        for_each_possible_cpu(i) {
-               stat *sd = per_cpu_ptr (st->sd, i);
+               stat_data *sd = per_cpu_ptr (st->sd, i);
                STAT_LOCK(sd);
                _stp_stat_clear_data (st, sd);
                STAT_UNLOCK(sd);
index 4357abb413cb25cf45e21f88cd9755c26afe862c..d61bfcfd5883f18b7dad40c054e17c29dcf9d12a 100644 (file)
@@ -38,7 +38,7 @@ struct stat_data {
 #endif
        int64_t histogram[];
 };
-typedef struct stat_data stat;
+typedef struct stat_data stat_data;
 
 /** Information about the histogram data collected. This data 
     is global and not duplicated per-cpu. */
This page took 0.044383 seconds and 5 git commands to generate.