@@ -131,7 +131,6 @@ int profiler_context_init(struct profiler_context *ctx,
131
131
snprintf (ctx -> custom_stack_map_b .name , sizeof (ctx -> custom_stack_map_b .name ), "%s" ,
132
132
custom_stack_map_name_b );
133
133
134
- ctx -> regex_existed = false;
135
134
ctx -> only_matched_data = only_matched ;
136
135
ctx -> use_delta_time = use_delta_time ;
137
136
ctx -> type = type ;
@@ -162,37 +161,6 @@ void set_bpf_run_enabled(struct bpf_tracer *t, struct profiler_context *ctx,
162
161
enable_flag );
163
162
}
164
163
165
- int do_profiler_regex_config (const char * pattern , struct profiler_context * ctx )
166
- {
167
- if (* pattern == '\0' ) {
168
- ctx -> regex_existed = false;
169
- ebpf_warning ("%sSet 'profiler_regex' pattern : '', an empty"
170
- " regular expression will not generate any stack data."
171
- "Please configure the regular expression for profiler.\n" ,
172
- ctx -> tag );
173
- return (0 );
174
- }
175
-
176
- if (ctx -> regex_existed ) {
177
- regfree (& ctx -> profiler_regex );
178
- }
179
-
180
- int ret = regcomp (& ctx -> profiler_regex , pattern , REG_EXTENDED );
181
- if (ret != 0 ) {
182
- char error_buffer [100 ];
183
- regerror (ret , & ctx -> profiler_regex , error_buffer ,
184
- sizeof (error_buffer ));
185
- ebpf_warning ("%sPattern %s failed to compile the regular "
186
- "expression: %s\n" , ctx -> tag , pattern ,
187
- error_buffer );
188
- ctx -> regex_existed = false;
189
- return (-1 );
190
- }
191
-
192
- ctx -> regex_existed = true;
193
- return 0 ;
194
- }
195
-
196
164
static bool check_kallsyms_addr_is_zero (void )
197
165
{
198
166
const int check_num = 100 ;
@@ -1268,34 +1236,6 @@ void process_bpf_stacktraces(struct profiler_context *ctx, struct bpf_tracer *t)
1268
1236
push_and_release_stack_trace_msg (ctx , & ctx -> msg_hash , false);
1269
1237
}
1270
1238
1271
- bool check_profiler_regex (struct profiler_context * ctx , const char * name )
1272
- {
1273
- bool matched = false;
1274
- for (int i = 0 ; i < ARRAY_SIZE (g_ctx_array ); i ++ ) {
1275
- if (g_ctx_array [i ] == NULL )
1276
- continue ;
1277
-
1278
- if (ctx != NULL && ctx -> name != NULL ) {
1279
- if (strcmp (g_ctx_array [i ]-> name , ctx -> name ))
1280
- continue ;
1281
- }
1282
-
1283
- if (g_ctx_array [i ]-> regex_existed ) {
1284
- profile_regex_lock (g_ctx_array [i ]);
1285
- matched =
1286
- (regexec
1287
- (& g_ctx_array [i ]-> profiler_regex , name , 0 , NULL , 0 )
1288
- == 0 );
1289
- profile_regex_unlock (g_ctx_array [i ]);
1290
- if (matched ) {
1291
- return true;
1292
- }
1293
- }
1294
- }
1295
-
1296
- return false;
1297
- }
1298
-
1299
1239
bool profiler_is_running (void )
1300
1240
{
1301
1241
for (int i = 0 ; i < ARRAY_SIZE (g_ctx_array ); i ++ ) {
0 commit comments