[Crash-utility] A new option of the new command lscgroup

俞永明 yuym.fnst at cn.fujitsu.com
Fri Nov 16 06:47:51 UTC 2012


Hello,Dave,
	I have made changes to the unproper command style pattern just
as you said in the last mail, you can check it with the attachment or
refer to the help information.

Thanks
Yongming Yu


Dave Anderson 写道:
> 
> ----- 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
> 
> 

-- 
--------------------------------------------------
Yu Yongming
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.
(FNST)No. 6 Wenzhu Road, Nanjing, 210012, China
EMail:yuym.fnst at cn.fujitsu.com

Regards__
--------------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lscgroup.c
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121116/0c689e5c/attachment.c>


More information about the Crash-utility mailing list