public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] lib: Add a --igt-debug command line option
Date: Wed, 28 May 2014 21:28:02 +0200	[thread overview]
Message-ID: <20140528192802.GZ14841@phenom.ffwll.local> (raw)
In-Reply-To: <1401301444-10824-7-git-send-email-damien.lespiau@intel.com>

On Wed, May 28, 2014 at 07:24:04PM +0100, Damien Lespiau wrote:
> Sometimes it's practical to be able to set the logging level to debug
> from the command line arguments.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

The problem with this is that it won't work with simple igt tests which
don't use this for cmdline parsing. And I kinda don't like inconsistent
interfaces - I've originally considered this but then decided against it
since I didn't want to do the churn of going through all simple tests.

But now we have igt_simple_main which covers most simple tests, so this
would be feasible again. Care to do this right?

For bikesheds: I'd vote for -d --debug only, and maybe set the
igt_log_level variable directly.
-Daniel

> ---
>  lib/igt_core.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 6e553cf..9d59ab4 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -274,6 +274,7 @@ static void print_usage(const char *command_str, const char *help_str,
>  	FILE *f = output_on_stderr ? stderr : stdout;
>  
>  	fprintf(f, "Usage: %s [OPTIONS]\n"
> +		   "  --igt-debug\n"
>  		   "  --list-subtests\n"
>  		   "  --run-subtest <pattern>\n", command_str);
>  	if (help_str)
> @@ -317,6 +318,7 @@ int igt_subtest_init_parse_opts(int argc, char **argv,
>  {
>  	int c, option_index = 0;
>  	static struct option long_options[] = {
> +		{"igt-debug", 0, 0, 'd'},
>  		{"list-subtests", 0, 0, 'l'},
>  		{"run-subtest", 1, 0, 'r'},
>  		{"help", 0, 0, 'h'},
> @@ -357,6 +359,9 @@ int igt_subtest_init_parse_opts(int argc, char **argv,
>  	while ((c = getopt_long(argc, argv, short_opts, combined_opts,
>  			       &option_index)) != -1) {
>  		switch(c) {
> +		case 'd':
> +			setenv("IGT_LOG_LEVEL", "debug", 1);
> +			break;
>  		case 'l':
>  			if (!run_single_subtest)
>  				list_subtests = true;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-05-28 19:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 18:23 [PATCH i-g-t 0/6] Make kms_pipe_crc_basic cover pipe A + eDP on HSW Damien Lespiau
2014-05-28 18:23 ` [PATCH 1/6] kms_pipe_crc_basic: Split the main test function a bit more Damien Lespiau
2014-05-28 18:24 ` [PATCH 2/6] kms_pipe_crc_basic: Cycle between 2 differently colored buffer Damien Lespiau
2014-05-28 18:24 ` [PATCH 3/6] kms_pipe_crc_basic: Make the number of CRCs a parameter Damien Lespiau
2014-05-28 18:24 ` [PATCH 4/6] kms_pipe_crc_basic: Bump the number of collected CRCs to 60 Damien Lespiau
2014-05-28 19:32   ` Daniel Vetter
2014-05-28 18:24 ` [PATCH 5/6] kms_pipe_crc_basic: Add a bit a debugging output Damien Lespiau
2014-05-28 18:24 ` [PATCH 6/6] lib: Add a --igt-debug command line option Damien Lespiau
2014-05-28 19:28   ` Daniel Vetter [this message]
2014-07-07 16:43 ` [PATCH i-g-t 0/6] Make kms_pipe_crc_basic cover pipe A + eDP on HSW Damien Lespiau

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=20140528192802.GZ14841@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox