Re: A new option of the new command lscgroup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> Hello, Dave,
> 
> I have read your mail and think over the suggestions and done some
> changes. Firstly, I added a new option "-a" to meet the demand that user
> can enter a cgroup address and it would display its controller/path
> name.
> 
> Secondly, previously, when user specify controller:path to display
> chosen cgroups,there is no option. To make it in accordance with -a
> option, I did a little change, that is when user specify
> controller:path, there should be a option -g. The following example
> illustrates the change.
> Previously, user may run : crash> lscgroup cpu:/
> but now, user should run  : crash > lscgroup -g cpu:/
> 
> Accordingly,the help information was revised. You can refer to the
> help information and attachment to see detailed changes.
> 
> Many thanks
> Yongming Yu

Why bother with -a or -g?  The argument type can easily be
differentiated between a name string and a hexadecimal argument.
Many of the crash commands do that.  In your case, you could
simply do something like this:

        if (args[optind]) {
                do {
			if (hexadecimal(args[optind], 0))
				/* cgroup address */
                                ...
			} else {
                                /* must be a name string */
                                ...
			}
                        optind++;
                } while(args[optind]);
        }

Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility


[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux