[systemd-devel] [PATCH] do not ellipsize cgroup members in full status

Lukáš Nykrýn lnykryn at redhat.com
Tue Jan 15 01:58:26 PST 2013


Lennart Poettering píše v Út 25. 09. 2012 v 17:45 +0200:
> On Tue, 25.09.12 15:36, Lukáš Nykrýn (lnykryn at redhat.com) wrote:
> 
> Heya,
> 
> > diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h
> > index 3e6b6e0..3b63a5d 100644
> > --- a/src/shared/logs-show.h
> > +++ b/src/shared/logs-show.h
> > @@ -27,26 +27,6 @@
> >  
> >  #include "util.h"
> >  
> > -typedef enum OutputMode {
> > -        OUTPUT_SHORT,
> > -        OUTPUT_SHORT_MONOTONIC,
> > -        OUTPUT_VERBOSE,
> > -        OUTPUT_EXPORT,
> > -        OUTPUT_JSON,
> > -        OUTPUT_JSON_PRETTY,
> > -        OUTPUT_CAT,
> > -        _OUTPUT_MODE_MAX,
> > -        _OUTPUT_MODE_INVALID = -1
> > -} OutputMode;
> > -
> > -typedef enum OutputFlags {
> > -        OUTPUT_SHOW_ALL       = 1 << 0,
> > -        OUTPUT_FOLLOW         = 1 << 1,
> > -        OUTPUT_WARN_CUTOFF    = 1 << 2,
> > -        OUTPUT_FULL_WIDTH     = 1 << 3,
> > -        OUTPUT_COLOR          = 1 << 4
> > -} OutputFlags;
> > -
> 
> Hmm, I don't think this should be part of util.[ch] really, it's far to
> specific to be considered just a utility. Could you please move this to a new
> file output.h or so?
> 
> > -int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line) {
> > -        char *r, *k;
> > +int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line, OutputFlags flags) {
> > +        char *r = NULL, *k;
> >          int c;
> > -        bool space = false;
> > -        size_t left;
> >          FILE *f;
> 
> I don't think this flag really should be passed here, this call is too
> low-level for that. Instead, max_length == 0 could be used as a good
> indicator for "as big as needed" or so.
> 
> Otherwise looks pretty OK!
> 
> Lennart
> 

Hello,
I completely forget about this patch and there were again some
complaints about this behavior. Here is my original patch with some
modification (see commit log).

Lukas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-systemctl-loginctl-cgls-do-not-ellipsize-cgroup-memb.patch
Type: text/x-patch
Size: 29562 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130115/3d32f80b/attachment-0001.bin>


More information about the systemd-devel mailing list