... | ... |
@@ -89,12 +89,20 @@ static int grp_no; /* number of groups */ |
89 | 89 |
|
90 | 90 |
/** counters array. a[proc_no][counter_id] => |
91 | 91 |
_cnst_vals[proc_no*cnts_no+counter_id] */ |
92 |
-counter_array_t* _cnts_vals; |
|
92 |
+counter_array_t* _cnts_vals = 0; |
|
93 | 93 |
int _cnts_row_len; /* number of elements per row */ |
94 | 94 |
static int cnts_no; /* number of registered counters */ |
95 | 95 |
static int cnts_max_rows; /* set to 0 if not yet fully init */ |
96 | 96 |
|
97 | 97 |
|
98 |
+int counters_initialized(void) |
|
99 |
+{ |
|
100 |
+ if (unlikely(_cnts_vals == 0)) { |
|
101 |
+ /* not init yet */ |
|
102 |
+ return 0; |
|
103 |
+ } |
|
104 |
+ return 1; |
|
105 |
+} |
|
98 | 106 |
|
99 | 107 |
/** init the coutner hash table(s). |
100 | 108 |
* @return 0 on success, -1 on error. |