All of lore.kernel.org
 help / color / mirror / Atom feed
* v4l2-tracer: use of __FILE__
@ 2023-03-31 14:18 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2023-03-31 14:18 UTC (permalink / raw)
  To: Deborah Brouwer; +Cc: Linux Media Mailing List

Hi Deb,

After switching over to meson the __FILE__macro adds '../utils/v4l2-tracer/' to the
filename (since it is compiling from a relative path).

It is nicer to use __FILE_NAME__ instead of __FILE__, but that is not available
for every compiler.

See https://git.linuxtv.org/v4l-utils.git/commit/?id=de7b731c4d4a191a530322d7c6dc42ba9c7c16d8

v4l2-tracer uses __FILE__ a lot, but that really should be modified to use a
macro, just like v4l2-compliance etc. do.

It's generally one of these two variants:

utils/v4l2-tracer/trace-helper.cpp:             fprintf(stderr, "%s:%s:%d: ", __FILE__, __func__, __LINE__);
utils/v4l2-tracer/trace-helper.cpp:             fprintf(stderr, "%s:%s:%d\n", __FILE__, __func__, __LINE__);

It's rather ugly to see that duplicated some 60+ times.

Can you replace it with a macro or something? And use __FILE_NAME__ in the macro?

No hurry, but this definitely can be improved.

Regards,

	Hans

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31 14:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 14:18 v4l2-tracer: use of __FILE__ Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.