Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

TRACE_* macros and #ifdef guards

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


john.sheu at gmail

May 11, 2012, 1:26 PM

Post #1 of 1 (45 views)
Permalink
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 [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.