[systemd-devel] [PATCH] systemd-analyze: filter dot output with a regular expression

Łukasz Stelmach l.stelmach at samsung.com
Mon Mar 25 09:49:23 PDT 2013


It was <2013-03-25 pon 16:48>, when Lennart Poettering wrote:
> On Sun, 24.03.13 13:32, Łukasz Stelmach (stlman at poczta.fm) wrote:
>
>> Make "systemd-analyze dot" output only lines matching a regular
>> expression passed on the command line. Without the regular expression
>> print everything.
>
> So far we mostly used globs everywhere in system. Does it really make
> sense to use regexes here?
>
> I mean, unit file names on purpose are "file-name like", and generally
> even show up in the file system, so it sounds more natural to me to use
> fnmatch here?

Sounds reasonable and probably would be enough. I'll change it and see
how it suits me.

>>          static const char * const colors[] = {
>>                  "Requires",              "[color=\"black\"]",
>> @@ -591,6 +594,7 @@ static int graph_one_property(const char *name, const char *prop, DBusMessageIte
>>                  "After",                 "[color=\"green\"]"
>>          };
>>  
>> +        char buf[1024];
>
> We generally avoid using fixed size strings like this. Use dynamic
> memory for this if you can... i.e. asprintf(), and consider freeing it
> with _cleanup_free_...

Sure. I haven't looked around too much before to see you do things like
this. I'll change it.

-- 
Łukasz Stelmach
Software wizzard
Samsung Poland R&D Center

Al. Armii Ludowej 26, 00-609 Warszawa
http://www.rd.samsung.pl


More information about the systemd-devel mailing list