@@ -1340,6 +1340,14 @@ static void show_supported_btf_features(FILE *output)
fprintf(output, "\n");
}
+static void btf_features__enable_for_all(void)
+{
+ for (int i = 0; i < ARRAY_SIZE(btf_features); i++) {
+ if (btf_features[i].enable_for_all)
+ enable_btf_feature(&btf_features[i]);
+ }
+}
+
/* Translate --btf_features=feature1[,feature2] into conf_load values.
* Explicitly ignores unrecognized features to allow future specification
* of new opt-in features.
@@ -1352,12 +1360,7 @@ static void parse_btf_features(const char *features, bool strict)
init_btf_features();
if (strcmp(features, "all") == 0) {
- int i;
-
- for (i = 0; i < ARRAY_SIZE(btf_features); i++) {
- if (btf_features[i].enable_for_all)
- enable_btf_feature(&btf_features[i]);
- }
+ btf_features__enable_for_all();
return;
}
@@ -1371,7 +1374,7 @@ static void parse_btf_features(const char *features, bool strict)
* allowed.
*/
if (strcmp(feature_name, "all") == 0) {
- parse_btf_features(feature_name, strict);
+ btf_features__enable_for_all();
} else if (strict) {
fprintf(stderr, "Feature '%s' in '%s' is not supported. Supported BTF features are:\n",
feature_name, features);