* Compilation error on 2.6.29-rc1
@ 2009-01-12 6:01 Wenji Huang
2009-01-12 7:47 ` Wenji Huang
0 siblings, 1 reply; 4+ messages in thread
From: Wenji Huang @ 2009-01-12 6:01 UTC (permalink / raw)
To: SystemTAP
Hi,
There will be compilation error executing stap script on 2.6.29-rc1.
$ uname -r
2.6.29-rc1
$ sudo stap -vve 'probe begin{print("hello")}'
SystemTap translator/driver (version 0.8/0.131 git branch master, commit
dc38c256 + changes)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: i686 release: 2.6.29-rc1
Created temporary directory "/tmp/stapKwFGzV"
Searched '/usr/local/share/systemtap/tapset/i686/*.stp', found 2
Searched '/usr/local/share/systemtap/tapset/*.stp', found 45
Pass 1: parsed user script and 47 library script(s) in
1040usr/130sys/1916real ms.
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0
global(s) in 20usr/10sys/101real ms.
Pass 3: translated to C into
"/tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.c" in
10usr/10sys/40real ms.
Running make -C "/lib/modules/2.6.29-rc1/build" M="/tmp/stapKwFGzV"
modules >/dev/null
In file included from
/usr/local/share/systemtap/runtime/transport/transport.c:22,
from /usr/local/share/systemtap/runtime/print.c:17,
from /usr/local/share/systemtap/runtime/runtime.h:84,
from
/tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.c:41:
/usr/local/share/systemtap/runtime/transport/symbols.c:124:33: macro
"swap" passed 3 arguments, but takes just 2
/usr/local/share/systemtap/runtime/transport/symbols.c:130:28: macro
"swap" passed 3 arguments, but takes just 2
/usr/local/share/systemtap/runtime/transport/symbols.c:137:33: macro
"swap" passed 3 arguments, but takes just 2
make[1]: ***
[/tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.o] Error 1
make: *** [_module_/tmp/stapKwFGzV] Error 2
Pass 4: compiled C into "stap_fde82e4fd6036a280f89069499515efe_182.ko"
in 6710usr/4200sys/16992real ms.
Pass 4: compilation failed. Try again with another '--vp 0001' option.
Running rm -rf /tmp/stapKwFGzV
Seems it's caused by kernel change
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b53907c0100a353a7ac53bed260e735e5ccbbbcc
Regards,
Wenji
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compilation error on 2.6.29-rc1
2009-01-12 6:01 Compilation error on 2.6.29-rc1 Wenji Huang
@ 2009-01-12 7:47 ` Wenji Huang
2009-01-12 19:37 ` Masami Hiramatsu
0 siblings, 1 reply; 4+ messages in thread
From: Wenji Huang @ 2009-01-12 7:47 UTC (permalink / raw)
To: wenji.huang; +Cc: SystemTAP
Wenji Huang wrote:
> Hi,
>
> There will be compilation error executing stap script on 2.6.29-rc1.
> $ uname -r
> 2.6.29-rc1
> $ sudo stap -vve 'probe begin{print("hello")}'
> SystemTap translator/driver (version 0.8/0.131 git branch master, commit
> dc38c256 + changes)
> Copyright (C) 2005-2008 Red Hat, Inc. and others
> This is free software; see the source for copying conditions.
> Session arch: i686 release: 2.6.29-rc1
> Created temporary directory "/tmp/stapKwFGzV"
> Searched '/usr/local/share/systemtap/tapset/i686/*.stp', found 2
> Searched '/usr/local/share/systemtap/tapset/*.stp', found 45
> Pass 1: parsed user script and 47 library script(s) in
> 1040usr/130sys/1916real ms.
> Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0
> global(s) in 20usr/10sys/101real ms.
> Pass 3: translated to C into
> "/tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.c" in
> 10usr/10sys/40real ms.
> Running make -C "/lib/modules/2.6.29-rc1/build" M="/tmp/stapKwFGzV"
> modules >/dev/null
> In file included from
> /usr/local/share/systemtap/runtime/transport/transport.c:22,
> from /usr/local/share/systemtap/runtime/print.c:17,
> from /usr/local/share/systemtap/runtime/runtime.h:84,
> from
> /tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.c:41:
> /usr/local/share/systemtap/runtime/transport/symbols.c:124:33: macro
> "swap" passed 3 arguments, but takes just 2
> /usr/local/share/systemtap/runtime/transport/symbols.c:130:28: macro
> "swap" passed 3 arguments, but takes just 2
> /usr/local/share/systemtap/runtime/transport/symbols.c:137:33: macro
> "swap" passed 3 arguments, but takes just 2
> make[1]: ***
> [/tmp/stapKwFGzV/stap_fde82e4fd6036a280f89069499515efe_182.o] Error 1
> make: *** [_module_/tmp/stapKwFGzV] Error 2
> Pass 4: compiled C into "stap_fde82e4fd6036a280f89069499515efe_182.ko"
> in 6710usr/4200sys/16992real ms.
> Pass 4: compilation failed. Try again with another '--vp 0001' option.
> Running rm -rf /tmp/stapKwFGzV
>
> Seems it's caused by kernel change
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b53907c0100a353a7ac53bed260e735e5ccbbbcc
>
>
>
> Regards,
> Wenji
Need similar update on runtime code.
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
index 6e3bef1..72f9ad8 100644
--- a/runtime/transport/symbols.c
+++ b/runtime/transport/symbols.c
@@ -92,8 +92,8 @@ static void generic_swap(void *a, void *b, int size)
* @base: pointer to data to sort
* @num: number of elements
* @size: size of each element
- * @cmp: pointer to comparison function
- * @swap: pointer to swap function or NULL
+ * @cmp_func: pointer to comparison function
+ * @swap_func: pointer to swap function or NULL
*
* This function does a heapsort on the given array. You may provide a
* swap function optimized to your element type.
@@ -104,37 +104,37 @@ static void generic_swap(void *a, void *b, int size)
* it less suitable for kernel use.
*/
void _stp_sort(void *_base, size_t num, size_t size,
- int (*cmp) (const void *, const void *), void (*swap)
(void *, void *, int size))
+ int (*cmp_func) (const void *, const void *), void
(*swap_func) (void *, void *, int size))
{
char *base = (char*) _base;
/* pre-scale counters for performance */
int i = (num / 2 - 1) * size, n = num * size, c, r;
- if (!swap)
- swap = (size == 4 ? u32_swap : generic_swap);
+ if (!swap_func)
+ swap_func = (size == 4 ? u32_swap : generic_swap);
/* heapify */
for (; i >= 0; i -= size) {
for (r = i; r * 2 + size < n; r = c) {
c = r * 2 + size;
- if (c < n - size && cmp(base + c, base + c +
size) < 0)
+ if (c < n - size && cmp_func(base + c, base + c
+ size) < 0)
c += size;
- if (cmp(base + r, base + c) >= 0)
+ if (cmp_func(base + r, base + c) >= 0)
break;
- swap(base + r, base + c, size);
+ swap_func(base + r, base + c, size);
}
}
/* sort */
for (i = n - size; i >= 0; i -= size) {
- swap(base, base + i, size);
+ swap_func(base, base + i, size);
for (r = 0; r * 2 + size < i; r = c) {
c = r * 2 + size;
- if (c < i - size && cmp(base + c, base + c +
size) < 0)
+ if (c < i - size && cmp_func(base + c, base + c
+ size) < 0)
c += size;
- if (cmp(base + r, base + c) >= 0)
+ if (cmp_func(base + r, base + c) >= 0)
break;
- swap(base + r, base + c, size);
+ swap_func(base + r, base + c, size);
}
}
}
It works well on 2.6.29/26.
Regards,
Wenji
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compilation error on 2.6.29-rc1
2009-01-12 7:47 ` Wenji Huang
@ 2009-01-12 19:37 ` Masami Hiramatsu
2009-01-13 17:33 ` [FIXED] " Masami Hiramatsu
0 siblings, 1 reply; 4+ messages in thread
From: Masami Hiramatsu @ 2009-01-12 19:37 UTC (permalink / raw)
To: wenji.huang; +Cc: SystemTAP
Wenji Huang wrote:
> Need similar update on runtime code.
Ack.
Thank you, that is a same error I've got on the latest -mm tree.
> diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
> index 6e3bef1..72f9ad8 100644
> --- a/runtime/transport/symbols.c
> +++ b/runtime/transport/symbols.c
> @@ -92,8 +92,8 @@ static void generic_swap(void *a, void *b, int size)
> * @base: pointer to data to sort
> * @num: number of elements
> * @size: size of each element
> - * @cmp: pointer to comparison function
> - * @swap: pointer to swap function or NULL
> + * @cmp_func: pointer to comparison function
> + * @swap_func: pointer to swap function or NULL
> *
> * This function does a heapsort on the given array. You may provide a
> * swap function optimized to your element type.
> @@ -104,37 +104,37 @@ static void generic_swap(void *a, void *b, int size)
> * it less suitable for kernel use.
> */
> void _stp_sort(void *_base, size_t num, size_t size,
> - int (*cmp) (const void *, const void *), void (*swap)
> (void *, void *, int size))
> + int (*cmp_func) (const void *, const void *), void
> (*swap_func) (void *, void *, int size))
> {
> char *base = (char*) _base;
> /* pre-scale counters for performance */
> int i = (num / 2 - 1) * size, n = num * size, c, r;
>
> - if (!swap)
> - swap = (size == 4 ? u32_swap : generic_swap);
> + if (!swap_func)
> + swap_func = (size == 4 ? u32_swap : generic_swap);
>
> /* heapify */
> for (; i >= 0; i -= size) {
> for (r = i; r * 2 + size < n; r = c) {
> c = r * 2 + size;
> - if (c < n - size && cmp(base + c, base + c +
> size) < 0)
> + if (c < n - size && cmp_func(base + c, base + c
> + size) < 0)
> c += size;
> - if (cmp(base + r, base + c) >= 0)
> + if (cmp_func(base + r, base + c) >= 0)
> break;
> - swap(base + r, base + c, size);
> + swap_func(base + r, base + c, size);
> }
> }
>
> /* sort */
> for (i = n - size; i >= 0; i -= size) {
> - swap(base, base + i, size);
> + swap_func(base, base + i, size);
> for (r = 0; r * 2 + size < i; r = c) {
> c = r * 2 + size;
> - if (c < i - size && cmp(base + c, base + c +
> size) < 0)
> + if (c < i - size && cmp_func(base + c, base + c
> + size) < 0)
> c += size;
> - if (cmp(base + r, base + c) >= 0)
> + if (cmp_func(base + r, base + c) >= 0)
> break;
> - swap(base + r, base + c, size);
> + swap_func(base + r, base + c, size);
> }
> }
> }
>
> It works well on 2.6.29/26.
>
> Regards,
> Wenji
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FIXED] Re: Compilation error on 2.6.29-rc1
2009-01-12 19:37 ` Masami Hiramatsu
@ 2009-01-13 17:33 ` Masami Hiramatsu
0 siblings, 0 replies; 4+ messages in thread
From: Masami Hiramatsu @ 2009-01-13 17:33 UTC (permalink / raw)
To: wenji.huang; +Cc: SystemTAP
I checked that patch was committed and stap could compile scripts on
2.6.28-rc1(x86-64).
Thanks,
Masami Hiramatsu wrote:
> Wenji Huang wrote:
>> Need similar update on runtime code.
>
> Ack.
> Thank you, that is a same error I've got on the latest -mm tree.
>
>> diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
>> index 6e3bef1..72f9ad8 100644
>> --- a/runtime/transport/symbols.c
>> +++ b/runtime/transport/symbols.c
>> @@ -92,8 +92,8 @@ static void generic_swap(void *a, void *b, int size)
>> * @base: pointer to data to sort
>> * @num: number of elements
>> * @size: size of each element
>> - * @cmp: pointer to comparison function
>> - * @swap: pointer to swap function or NULL
>> + * @cmp_func: pointer to comparison function
>> + * @swap_func: pointer to swap function or NULL
>> *
>> * This function does a heapsort on the given array. You may provide a
>> * swap function optimized to your element type.
>> @@ -104,37 +104,37 @@ static void generic_swap(void *a, void *b, int size)
>> * it less suitable for kernel use.
>> */
>> void _stp_sort(void *_base, size_t num, size_t size,
>> - int (*cmp) (const void *, const void *), void (*swap)
>> (void *, void *, int size))
>> + int (*cmp_func) (const void *, const void *), void
>> (*swap_func) (void *, void *, int size))
>> {
>> char *base = (char*) _base;
>> /* pre-scale counters for performance */
>> int i = (num / 2 - 1) * size, n = num * size, c, r;
>>
>> - if (!swap)
>> - swap = (size == 4 ? u32_swap : generic_swap);
>> + if (!swap_func)
>> + swap_func = (size == 4 ? u32_swap : generic_swap);
>>
>> /* heapify */
>> for (; i >= 0; i -= size) {
>> for (r = i; r * 2 + size < n; r = c) {
>> c = r * 2 + size;
>> - if (c < n - size && cmp(base + c, base + c +
>> size) < 0)
>> + if (c < n - size && cmp_func(base + c, base + c
>> + size) < 0)
>> c += size;
>> - if (cmp(base + r, base + c) >= 0)
>> + if (cmp_func(base + r, base + c) >= 0)
>> break;
>> - swap(base + r, base + c, size);
>> + swap_func(base + r, base + c, size);
>> }
>> }
>>
>> /* sort */
>> for (i = n - size; i >= 0; i -= size) {
>> - swap(base, base + i, size);
>> + swap_func(base, base + i, size);
>> for (r = 0; r * 2 + size < i; r = c) {
>> c = r * 2 + size;
>> - if (c < i - size && cmp(base + c, base + c +
>> size) < 0)
>> + if (c < i - size && cmp_func(base + c, base + c
>> + size) < 0)
>> c += size;
>> - if (cmp(base + r, base + c) >= 0)
>> + if (cmp_func(base + r, base + c) >= 0)
>> break;
>> - swap(base + r, base + c, size);
>> + swap_func(base + r, base + c, size);
>> }
>> }
>> }
>>
>> It works well on 2.6.29/26.
>>
>> Regards,
>> Wenji
>
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-13 17:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12 6:01 Compilation error on 2.6.29-rc1 Wenji Huang
2009-01-12 7:47 ` Wenji Huang
2009-01-12 19:37 ` Masami Hiramatsu
2009-01-13 17:33 ` [FIXED] " Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).