@@ -118,19 +118,20 @@ filterx_expr_free_method(FilterXExpr *self)
118
118
}
119
119
120
120
void
121
- filterx_expr_init_instance (FilterXExpr * self )
121
+ filterx_expr_init_instance (FilterXExpr * self , const gchar * type )
122
122
{
123
123
self -> ref_cnt = 1 ;
124
124
self -> init = filterx_expr_init_method ;
125
125
self -> deinit = filterx_expr_deinit_method ;
126
126
self -> free_fn = filterx_expr_free_method ;
127
+ self -> type = type ;
127
128
}
128
129
129
130
FilterXExpr *
130
131
filterx_expr_new (void )
131
132
{
132
133
FilterXExpr * self = g_new0 (FilterXExpr , 1 );
133
- filterx_expr_init_instance (self );
134
+ filterx_expr_init_instance (self , "expr" );
134
135
return self ;
135
136
}
136
137
@@ -180,7 +181,7 @@ filterx_unary_op_init_method(FilterXExpr *s, GlobalConfig *cfg)
180
181
181
182
stats_lock ();
182
183
StatsClusterKey sc_key ;
183
- StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> name ) };
184
+ StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> super . type ) };
184
185
stats_cluster_single_key_set (& sc_key , "fx_op_evals_total" , labels , G_N_ELEMENTS (labels ));
185
186
stats_register_counter (STATS_LEVEL3 , & sc_key , SC_TYPE_SINGLE_VALUE , & self -> super .eval_count );
186
187
stats_unlock ();
@@ -195,7 +196,7 @@ filterx_unary_op_deinit_method(FilterXExpr *s, GlobalConfig *cfg)
195
196
196
197
stats_lock ();
197
198
StatsClusterKey sc_key ;
198
- StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> name ) };
199
+ StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> super . type ) };
199
200
stats_cluster_single_key_set (& sc_key , "fx_op_evals_total" , labels , G_N_ELEMENTS (labels ));
200
201
stats_unregister_counter (& sc_key , SC_TYPE_SINGLE_VALUE , & self -> super .eval_count );
201
202
stats_unlock ();
@@ -216,14 +217,12 @@ filterx_unary_op_free_method(FilterXExpr *s)
216
217
void
217
218
filterx_unary_op_init_instance (FilterXUnaryOp * self , const gchar * name , FilterXExpr * operand )
218
219
{
219
- filterx_expr_init_instance (& self -> super );
220
+ filterx_expr_init_instance (& self -> super , name );
220
221
self -> super .optimize = filterx_unary_op_optimize_method ;
221
222
self -> super .init = filterx_unary_op_init_method ;
222
223
self -> super .deinit = filterx_unary_op_deinit_method ;
223
224
self -> super .free_fn = filterx_unary_op_free_method ;
224
225
self -> operand = operand ;
225
-
226
- self -> name = name ;
227
226
}
228
227
229
228
void
@@ -259,7 +258,7 @@ filterx_binary_op_init_method(FilterXExpr *s, GlobalConfig *cfg)
259
258
260
259
stats_lock ();
261
260
StatsClusterKey sc_key ;
262
- StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> name ) };
261
+ StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> super . type ) };
263
262
stats_cluster_single_key_set (& sc_key , "fx_op_evals_total" , labels , G_N_ELEMENTS (labels ));
264
263
stats_register_counter (STATS_LEVEL3 , & sc_key , SC_TYPE_SINGLE_VALUE , & self -> super .eval_count );
265
264
stats_unlock ();
@@ -274,7 +273,7 @@ filterx_binary_op_deinit_method(FilterXExpr *s, GlobalConfig *cfg)
274
273
275
274
stats_lock ();
276
275
StatsClusterKey sc_key ;
277
- StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> name ) };
276
+ StatsClusterLabel labels [] = { stats_cluster_label ("name" , self -> super . type ) };
278
277
stats_cluster_single_key_set (& sc_key , "fx_op_evals_total" , labels , G_N_ELEMENTS (labels ));
279
278
stats_unregister_counter (& sc_key , SC_TYPE_SINGLE_VALUE , & self -> super .eval_count );
280
279
stats_unlock ();
@@ -287,7 +286,7 @@ filterx_binary_op_deinit_method(FilterXExpr *s, GlobalConfig *cfg)
287
286
void
288
287
filterx_binary_op_init_instance (FilterXBinaryOp * self , const gchar * name , FilterXExpr * lhs , FilterXExpr * rhs )
289
288
{
290
- filterx_expr_init_instance (& self -> super );
289
+ filterx_expr_init_instance (& self -> super , name );
291
290
self -> super .optimize = filterx_binary_op_optimize_method ;
292
291
self -> super .init = filterx_binary_op_init_method ;
293
292
self -> super .deinit = filterx_binary_op_deinit_method ;
@@ -296,6 +295,4 @@ filterx_binary_op_init_instance(FilterXBinaryOp *self, const gchar *name, Filter
296
295
g_assert (rhs );
297
296
self -> lhs = lhs ;
298
297
self -> rhs = rhs ;
299
-
300
- self -> name = name ;
301
298
}
0 commit comments