X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fanalyze%2Fanalyze.c;h=1e2a6bbf25b036d6a24d0cb4a503759af5cac7b4;hp=672a0d79761bae5f00ef7c2c54d0900b37e64188;hb=6ecb6cec66739d733e95302031998f517261380c;hpb=ee5de57b9d474161df259e7faa958fa9d7bbd736 diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 672a0d797..1e2a6bbf2 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -974,24 +974,34 @@ static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop, _cleanup_strv_free_ char **units = NULL; char **unit; int r; + bool match_patterns; assert(u); assert(prop); assert(color); + match_patterns = strv_fnmatch(u->id, patterns, 0); + + if (!strv_isempty(arg_dot_from_patterns) && + !match_patterns && + !strv_fnmatch(u->id, arg_dot_from_patterns, 0)) + return 0; + r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units); if (r < 0) return r; STRV_FOREACH(unit, units) { - if (!strv_fnmatch_or_empty(u->id, arg_dot_from_patterns, 0)) - continue; + bool match_patterns2; + + match_patterns2 = strv_fnmatch(*unit, patterns, 0); - if (!strv_fnmatch_or_empty(*unit, arg_dot_to_patterns, 0)) + if (!strv_isempty(arg_dot_to_patterns) && + !match_patterns2 && + !strv_fnmatch(*unit, arg_dot_to_patterns, 0)) continue; - if (!strv_fnmatch_or_empty(u->id, patterns, 0) && - !strv_fnmatch_or_empty(*unit, patterns, 0)) + if (!strv_isempty(patterns) && !match_patterns && !match_patterns2) continue; printf("\t\"%s\"->\"%s\" [color=\"%s\"];\n", u->id, *unit, color);