lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CACE2HEAC3EsV1XMRRg_cvXYN6GMT2yppS+NPOHoC51SxO3vPAA@mail.gmail.com>
Date:	Fri, 11 May 2012 13:26:20 -0700
From:	John Sheu <john.sheu@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: TRACE_* macros and #ifdef guards

I've been poking at the linux kernel events tracing, am seeing some
inconsistencies in the usage of the TRACE_* macros.

For example, samples/trace_events/trace-events.sample.h has the entire
block below outside #ifdef guards:


#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
/*
 * TRACE_INCLUDE_FILE is not needed if the filename and TRACE_SYSTEM are equal
 */
#define TRACE_INCLUDE_FILE trace-events-sample
#include <trace/define_trace.h>


This is the case for most usages of trace events.  Some drivers (e.g.
drm), though, have part of the block inside the #ifdef guard:


#undef TRACE_SYSTEM
#define TRACE_SYSTEM drm
#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
#define TRACE_INCLUDE_FILE drm_trace
<snip>
#endif /* _DRM_TRACE_H_ */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#include <trace/define_trace.h>


Can I assume that using the TRACE_* macros inside the #ifdef guards is
incorrect (e.g. in drm), and should be corrected?

Thanks,
-John Sheu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ