From: William C. <wc...@nc...> - 2003-02-18 15:19:03
|
Here is a patch that does some rudimentary checking in opcontrol to prevent nonsense combinations of options. 2003-02-17 Will Cohen <wc...@re...> * utils/opcontrol (do_options): Better option error checking. One note is that "--list-event" was listed as an exclusive option. However, "--list-event" is treated like "--help", "--version", and "--verbose" in this implementation. Not a big deal. -Will Will Cohen wrote: > I have been looking over the options for opcontrol to figure out what > the errorcheck should do. I have broken the options into the following: > > options that shouldn't affect other options: > --help no checking with other options > --version no checking with other options > --verbose no checking with other options > --list-events > > exclusive (shouldn't have other options on line other than the ones above): > --init > --dump > --stop > --shutdown > --reset > --save=sessionname > --deinit > > > --start (only with --setup and setup options) > --start-daemon (only with --setup and setup options) > > --setup only allow setup options below, --start, and --start-daemon > > > setup options: > > --buffer-size=nnn > --ctrN-event=name > --ctrN-count=val > --ctrN-unit-mask=val > --ctrN-kernel=[0|1] > --ctrN-user=[0|1] > --pid-filter=pid > --pgrp-filter=pgrp > --separate=[library] > --vmlinux=file > --kernel-range=start,end > > > If an error occurs, state of things remains the same, ~root/.daemonrc > remains the same, nothing done to daemon, or the sample directory. > > For exclusive options print out something like the following: > > opcontrol --start --init > Option "--init" not valid with other options. > > For setup option: > opcontrol --start --ctr0-event=CPU_CLK_UNHALTED --ctr0-count=100000 > Setup options require "--setup". > > > John, is the level of error checking you were thinking of? Or were there > other things that need to be checked for? I want some feedback on this > before I implement it. > > -Will > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > |