From: "George G. Davis" <george_davis@mentor.com> To: shuah <shuah@kernel.org> Cc: Eugeniu Rosca <roscaeugeniu@gmail.com>, Jerry Hoemann <jerry.hoemann@hpe.com>, Colin Ian King <colin.king@canonical.com>, <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Eugeniu Rosca <erosca@de.adit-jv.com> Subject: Re: [PATCH 2/2] selftests: watchdog: Add command line option to show watchdog_info Date: Mon, 16 Sep 2019 09:55:54 -0400 Message-ID: <20190916135553.GA19227@mam-gdavis-lt> (raw) In-Reply-To: <2b08fa83-185b-4eb7-1217-37ed31d810b5@kernel.org> Hello, On Mon, Sep 16, 2019 at 07:26:41AM -0600, shuah wrote: > On 9/7/19 2:58 AM, Eugeniu Rosca wrote: > >diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c > >index 6ed822dc2222..f45e510500c0 100644 > >--- a/tools/testing/selftests/watchdog/watchdog-test.c > >+++ b/tools/testing/selftests/watchdog/watchdog-test.c > >@@ -19,7 +19,7 @@ > > int fd; > > const char v = 'V'; > >-static const char sopts[] = "bdehp:t:Tn:NLf:"; > >+static const char sopts[] = "bdehp:t:Tn:NLf:i"; > > static const struct option lopts[] = { > > {"bootstatus", no_argument, NULL, 'b'}, > > {"disable", no_argument, NULL, 'd'}, > >@@ -32,6 +32,7 @@ static const struct option lopts[] = { > > {"getpretimeout", no_argument, NULL, 'N'}, > > {"gettimeleft", no_argument, NULL, 'L'}, > > {"file", required_argument, NULL, 'f'}, > >+ {"info", no_argument, NULL, 'i'}, > > {NULL, no_argument, NULL, 0x0} > > }; > >@@ -72,6 +73,7 @@ static void usage(char *progname) > > printf("Usage: %s [options]\n", progname); > > printf(" -f, --file\t\tOpen watchdog device file\n"); > > printf("\t\t\tDefault is /dev/watchdog\n"); > >+ printf(" -i, --info\t\tShow watchdog_info\n"); > > printf(" -b, --bootstatus\tGet last boot status (Watchdog/POR)\n"); > > printf(" -d, --disable\t\tTurn off the watchdog timer\n"); > > printf(" -e, --enable\t\tTurn on the watchdog timer\n"); > >@@ -216,6 +218,18 @@ int main(int argc, char *argv[]) > > case 'f': > > /* Handled above */ > > break; > >+ case 'i': > >+ /* > >+ * watchdog_info was obtained as part of file open > >+ * validation. So we just show it here. > >+ */ > >+ oneshot = 1; > >+ printf("watchdog_info:\n"); > >+ printf(" identity:\t\t%s\n", info.identity); > >+ printf(" firmware_version:\t%u\n", > >+ info.firmware_version); > >+ printf(" options:\t\t%08x\n", info.options); > >+ break; > > default: > > usage(argv[0]); > > > > I would like to see these combined. Ok. > Please don't add another argument. I'm not clear on your request here. Do you want to drop the addition of optional --info|-i command line option and always display the watchdog_info? If yes, perhaps Eugeniu may mention what he has already mentioned to me earlier that "it's very useful to see the watchdog identity" but "some users might perceive the console output a bit busy if the Watchdog identity: <WDT name> message is always on" so perhaps it is "more user-friendly to still call the WDIOC_GETSUPPORT ioctl to sanitize the device file, but to only print the Watchdog identity: message when the user passes e.g. a new -i, --identity parameter". > Combine patch and 1&2. I'll do that but I'm not entirely clear on your "Please don't add another argument" request. > > thanks, > -- Shuah -- Regards, George
next prev parent reply index Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-07 8:58 [PATCH 1/2] selftests: watchdog: Validate optional file argument Eugeniu Rosca 2019-09-07 8:58 ` [PATCH 2/2] selftests: watchdog: Add command line option to show watchdog_info Eugeniu Rosca 2019-09-16 13:26 ` shuah 2019-09-16 13:55 ` George G. Davis [this message] 2019-09-16 13:57 ` Eugeniu Rosca 2019-09-16 16:05 ` shuah 2019-09-16 16:15 ` George G. Davis 2019-09-17 18:53 ` Eugeniu Rosca 2019-09-16 12:08 ` [PATCH 1/2] selftests: watchdog: Validate optional file argument Eugeniu Rosca 2019-09-16 13:29 ` shuah 2019-09-17 18:55 ` Eugeniu Rosca 2019-09-16 13:25 ` shuah
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190916135553.GA19227@mam-gdavis-lt \ --to=george_davis@mentor.com \ --cc=colin.king@canonical.com \ --cc=erosca@de.adit-jv.com \ --cc=jerry.hoemann@hpe.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-kselftest@vger.kernel.org \ --cc=roscaeugeniu@gmail.com \ --cc=shuah@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-kselftest Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \ linux-kselftest@vger.kernel.org public-inbox-index linux-kselftest Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest AGPL code for this site: git clone https://public-inbox.org/public-inbox.git