problem about compile script use guru mode
Mark Wielaard
mjw@redhat.com
Tue Mar 20 10:18:00 GMT 2012
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
More information about the Systemtap
mailing list