Re: Testers needed for LTTng 0.6.0pre1

Mathieu Desnoyers <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <20060928132330.GA1244@Krystal>
* Christopher Yeoh ([email protected]) wrote:
> At 2006/9/27 15:54-0400  Mathieu Desnoyers writes:
> > 
> > I would like you to test it on various architectures (and check for warnings) to
> > see if I broke something when porting the LTTng instrumentation to markers.
> 
> The marker mechanism doesn't compile on ppc64. Neither the asm-powerpc
> or asm-generic version of marker.h work.
> 
> The problem appears to be in the macro:
> 
> 		asm volatile(	".section .markers, \"a\";\n\t" \
> 					".long %1, 0f, %2, %3;\n\t" \
> 					".previous;\n\t" \
> 					".align 32;\n\t" \
> 					"0:\n\t" \
> 					"li $0,%0;\n\t" \
> 				: "=r" (condition) : \
> 				"m" (*(#name)), \
> 				"m" (__mark_call_##name), \
> 				"m" (*format)); \
> 
> For the .long part, gcc ends up outputting something like:
> 
> long 0(9), 0f, 0(11), 0(3);
> 
> ie register relative addresses which the assembler barfs on.
> 
> Would something like the following be ok? (based on asm-generic version
> - I did try to do get something working based on the asm-powerpc
> version working, but so far without success):
> 
> #define MARK(name, format, args...) \
>         do { \
>                 static marker_probe_func *__mark_call_##name = \
>                                         __mark_empty_function; \
>                 volatile static char __marker_enable_##name = 0; \
>                 static struct _mark_marker_local { \
>                         const char *local_name; \
>                         volatile char *enable; \
>                         marker_probe_func **call; \
>                         const char *local_format; \
>                 } __attribute__((packed)) i __attribute__ ((section(".markers"))) \
> 		 __attribute__((__used__))  = \
>                     { #name, &__marker_enable_##name, &__mark_call_##name, format }; \
>                 if (unlikely(__marker_enable_##name)) { \
>                         preempt_disable(); \
>                         (*__mark_call_##name)(format, ## args); \
>                         preempt_enable_no_resched(); \
>                 } \
>         } while(0)
> 
> 

The idea is interesting, however, gcc will put the "enable" pointer as a unique
value when the same marker is used more than once in a given object. We won't be
able to patch the immediate value for each marker site then.


> There also seems to be a problem with fs/compat.c (~1514) with lttng_name
> not being declared.
> 
Ok thank, I will fix it.

I'll try to come with something for ppc asm..

Mathieu

> Chris
> -- 
> [email protected]
> IBM OzLabs Linux Development Group, ADL
> Canberra, Australia
> 
OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.