This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: problem about compile script use guru mode
On Tue, 2012-03-20 at 16:22 +0800, ch huang wrote:
> i write this script ,but failed in compiling,any one can help?
>
> function tcp_ts_get_info_state:long(sock:long)
> %{
> struct sock *sk = (struct sock *)(long) THIS->sock;
> THIS->__retvalue = (int64_t) kread(&(sk->sk_state));
> CATCH_DEREF_FAULT();
> %}
>
> probe tcp.sendmsg {
> printf("%s: TCP: Sending message. state is : %d , Flags %d. Size
> %d\n", execname(),tcp_ts_get_info_state($sk), $sk->sk_flags, size)
> }
>
> # stap -v -g ex.stp
> [...]
> /tmp/stappHyhSV/stap_9a391050596aacbaaabe1cae0d39ca3d_5731_src.c: In
> function âprobe_2001â:
> /tmp/stappHyhSV/stap_9a391050596aacbaaabe1cae0d39ca3d_5731_src.c:555:
> error: âunion <anonymous>â has no member named
> âfunction_tcp_ts_get_info_stateâ
> /tmp/stappHyhSV/stap_9a391050596aacbaaabe1cae0d39ca3d_5731_src.c:556:
> error: implicit declaration of function
> âfunction_tcp_ts_get_info_stateâ
> /tmp/stappHyhSV/stap_9a391050596aacbaaabe1cae0d39ca3d_5731_src.c:558:
> error: âunion <anonymous>â has no member named
> âfunction_tcp_ts_get_info_stateâ
> make[1]: *** [/tmp/stappHyhSV/stap_9a391050596aacbaaabe1cae0d39ca3d_5731_src.o]
> Error 1
There is already a function tcp_ts_get_info_state in the standard tapset
tcp.stp. This causes confusion over which definition you want to use.
Just rename your version to my_tcp_ts_get_info_state. And everything
will be fine.
This can be considered a bug in stap. It should at least warn if you try
to override a standard tapset function. Could you file a bug report for
this at http://sourceware.org/bugzilla
Thanks,
Mark