@@ -3289,24 +3289,10 @@ int del_perf_probe_events(struct strfilter *filter)
3289
3289
return ret ;
3290
3290
}
3291
3291
3292
- /* TODO: don't use a global variable for filter ... */
3293
- static struct strfilter * available_func_filter ;
3294
-
3295
- /*
3296
- * If a symbol corresponds to a function with global binding and
3297
- * matches filter return 0. For all others return 1.
3298
- */
3299
- static int filter_available_functions (struct map * map __maybe_unused ,
3300
- struct symbol * sym )
3301
- {
3302
- if (strfilter__compare (available_func_filter , sym -> name ))
3303
- return 0 ;
3304
- return 1 ;
3305
- }
3306
-
3307
3292
int show_available_funcs (const char * target , struct strfilter * _filter ,
3308
3293
bool user )
3309
3294
{
3295
+ struct rb_node * nd ;
3310
3296
struct map * map ;
3311
3297
int ret ;
3312
3298
@@ -3324,9 +3310,7 @@ int show_available_funcs(const char *target, struct strfilter *_filter,
3324
3310
return - EINVAL ;
3325
3311
}
3326
3312
3327
- /* Load symbols with given filter */
3328
- available_func_filter = _filter ;
3329
- ret = map__load (map , filter_available_functions );
3313
+ ret = map__load (map , NULL );
3330
3314
if (ret ) {
3331
3315
if (ret == -2 ) {
3332
3316
char * str = strfilter__string (_filter );
@@ -3343,7 +3327,14 @@ int show_available_funcs(const char *target, struct strfilter *_filter,
3343
3327
3344
3328
/* Show all (filtered) symbols */
3345
3329
setup_pager ();
3346
- dso__fprintf_symbols_by_name (map -> dso , map -> type , stdout );
3330
+
3331
+ for (nd = rb_first (& map -> dso -> symbol_names [map -> type ]); nd ; nd = rb_next (nd )) {
3332
+ struct symbol_name_rb_node * pos = rb_entry (nd , struct symbol_name_rb_node , rb_node );
3333
+
3334
+ if (strfilter__compare (_filter , pos -> sym .name ))
3335
+ printf ("%s\n" , pos -> sym .name );
3336
+ }
3337
+
3347
3338
end :
3348
3339
if (user ) {
3349
3340
map__put (map );
0 commit comments