ia64/xen-unstable

view patches/linux-2.6.16.29/x86-elfnote-as-preprocessor-macro.patch @ 12327:eea9247ad5a0

[XENOPROF] Oprofile user level samples for passive domains are being lost.
The number of of lost samples is most significant when dom0 is idle.

From: joserenato.santos@hp.com
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Nov 09 11:47:42 2006 +0000 (2006-11-09)
parents 041be3f6b38e
children
line source
1 diff -pruN ../orig-linux-2.6.16.29/include/linux/elfnote.h ./include/linux/elfnote.h
2 --- ../orig-linux-2.6.16.29/include/linux/elfnote.h 2006-09-19 14:06:10.000000000 +0100
3 +++ ./include/linux/elfnote.h 2006-09-19 14:06:20.000000000 +0100
4 @@ -31,22 +31,24 @@
5 /*
6 * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
7 * turn out to be the same size and shape), followed by the name and
8 - * desc data with appropriate padding. The 'desc' argument includes
9 - * the assembler pseudo op defining the type of the data: .asciz
10 - * "hello, world"
11 + * desc data with appropriate padding. The 'desctype' argument is the
12 + * assembler pseudo op defining the type of the data e.g. .asciz while
13 + * 'descdata' is the data itself e.g. "hello, world".
14 + *
15 + * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
16 + * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
17 */
18 -.macro ELFNOTE name type desc:vararg
19 -.pushsection ".note.\name"
20 - .align 4
21 - .long 2f - 1f /* namesz */
22 - .long 4f - 3f /* descsz */
23 - .long \type
24 -1:.asciz "\name"
25 -2:.align 4
26 -3:\desc
27 -4:.align 4
28 -.popsection
29 -.endm
30 +#define ELFNOTE(name, type, desctype, descdata) \
31 +.pushsection .note.name ; \
32 + .align 4 ; \
33 + .long 2f - 1f /* namesz */ ; \
34 + .long 4f - 3f /* descsz */ ; \
35 + .long type ; \
36 +1:.asciz "name" ; \
37 +2:.align 4 ; \
38 +3:desctype descdata ; \
39 +4:.align 4 ; \
40 +.popsection ;
41 #else /* !__ASSEMBLER__ */
42 #include <linux/elf.h>
43 /*