Re: [PATCH i-g-t 3/5] lib: introduce log domains

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

 



On 3 December 2014 at 14:22, Daniel Vetter <daniel@xxxxxxxx> wrote:
On Tue, Dec 02, 2014 at 05:15:37PM +0000, Thomas Wood wrote:
> diff --git a/lib/igt_core.h b/lib/igt_core.h
> index a258348..5c5ee25 100644
> --- a/lib/igt_core.h
> +++ b/lib/igt_core.h
> @@ -512,16 +512,20 @@ bool igt_run_in_simulation(void);
>  void igt_skip_on_simulation(void);
>
>  /* structured logging */
> +#ifndef IGT_LOG_DOMAIN
> +#define IGT_LOG_DOMAIN (NULL)
> +#endif

I guess the idea is that different source files have a

#define IGT_LOG_DOMAIN "foobar"

at the top before any includes?

Yes, or defined with -D in CFLAGS.
 

Would be great if you can add some good defaults as a patch on top:
- For everything in tests/*c I think we should add a suitable define in
  the Makefile, perhaps "test"

The default domain for a test is the program name.

 
- Same for tools/ with "tools"
- lib/* should probably have per-file log domains, using the basename of
  the source file itself. Dunno whether there's a cool Makefile trick to
  make that happen.

 The helper library is currently all within the same domain (defined in Makefile.am), but separate domains for different parts of the library would improve the filtering options.

 

With that added I think patches 1-4 are a nice addition to the igt
logging.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux