From mboxrd@z Thu Jan 1 00:00:00 1970 From: compudj@krystal.dyndns.org (Mathieu Desnoyers) Date: Mon, 2 Feb 2009 12:07:00 -0500 Subject: [ltt-dev] [PATCH] Fix missing definition of ltt_get_alignment() in kernel/marker.c In-Reply-To: <49851F93.30406@PolTec.COM> References: <49851F93.30406@PolTec.COM> Message-ID: <20090202170700.GB6256@Krystal> * Dennis W. Tokarski (dwt at PolTec.COM) wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > While looking into problems taking a trace on a dual cpu qemu-i386 VM, > I decided to try a kernel which had ltt turned off in the configuration > but was otherwise the same. > > This left me with ltt off but markers still on, and kernel/markers.c > wouldn't build because several of the *trace_mark() calls use > ltt_get_alignment() as an argument. Its definition in ltt-tracer.h > is entirely enclosed within the #ifdef CONFIG_LLT...#endif. I propose > to move it outside. Patch attached. > Merged, thanks ! Mathieu > - --Dennis > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org > > iD8DBQFJhR+DDJucIzCImrURAgGLAJ9W7r7hLS5rVvdy/uXLPM05Vk0g6gCgoVi0 > 7b/k63xy5k0SHbx3KJaBSD8= > =OGm/ > -----END PGP SIGNATURE----- > Index: include/linux/ltt-tracer.h > =================================================================== > RCS file: /usr/src/cvs-repository/fedora/fc10-kernel/include/linux/Attic/ltt-tracer.h,v > retrieving revision 1.1.2.1 > diff -u -r1.1.2.1 ltt-tracer.h > --- include/linux/ltt-tracer.h 26 Jan 2009 01:12:29 -0000 1.1.2.1 > +++ include/linux/ltt-tracer.h 1 Feb 2009 03:20:09 -0000 > @@ -138,6 +138,41 @@ > return MARKER_ID_DYNAMIC; > } > > +#if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) > + > +/* > + * Calculate the offset needed to align the type. > + * size_of_type must be non-zero. > + */ > +static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type) > +{ > + size_t alignment = min(sizeof(void *), size_of_type); > + return (alignment - align_drift) & (alignment - 1); > +} > +/* Default arch alignment */ > +#define LTT_ALIGN > + > +static inline int ltt_get_alignment(void) > +{ > + return sizeof(void *); > +} > + > +#else > + > +static inline unsigned int ltt_align(size_t align_drift, > + size_t size_of_type) > +{ > + return 0; > +} > + > +#define LTT_ALIGN __attribute__((packed)) > + > +static inline int ltt_get_alignment(void) > +{ > + return 0; > +} > +#endif /* CONFIG_LTT_ALIGNMENT */ > + > #ifdef CONFIG_LTT > > struct user_dbg_data { > @@ -300,41 +335,6 @@ > uint8_t header_end[0]; /* End of header */ > }; > > -#ifdef CONFIG_LTT_ALIGNMENT > - > -/* > - * Calculate the offset needed to align the type. > - * size_of_type must be non-zero. > - */ > -static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type) > -{ > - size_t alignment = min(sizeof(void *), size_of_type); > - return (alignment - align_drift) & (alignment - 1); > -} > -/* Default arch alignment */ > -#define LTT_ALIGN > - > -static inline int ltt_get_alignment(void) > -{ > - return sizeof(void *); > -} > - > -#else > - > -static inline unsigned int ltt_align(size_t align_drift, > - size_t size_of_type) > -{ > - return 0; > -} > - > -#define LTT_ALIGN __attribute__((packed)) > - > -static inline int ltt_get_alignment(void) > -{ > - return 0; > -} > -#endif /* CONFIG_LTT_ALIGNMENT */ > - > /** > * ltt_subbuffer_header_size - called on buffer-switch to a new sub-buffer > * > _______________________________________________ > ltt-dev mailing list > ltt-dev at lists.casi.polymtl.ca > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68