This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
- From: "Dongtao Liu" <l dot dongtao at gmail dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: "Breno Leitao" <leitao at linux dot vnet dot ibm dot com>, systemtap at sources dot redhat dot com
- Date: Sat, 1 Nov 2008 16:14:14 -0400
- Subject: Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=20TUW7lN+bXf2VNVfaW7Pf+pSLULKw5L1KKPB1okxaQ=; b=BPFGm7TNsSVDEcrPjUUVhRjb1o1vJshwgfUNAgfRULpMgc6KWoDXw0jlfUiBOay/Bu TF1tiaujExlI/FPETtjmI+C3GEoPwmKKHaAeFgaWvShb5mfdKbTcb0cmhx6r8vPzM38V o2x6tgm/EtdWzz7McmbtabypXA7BSeVXAT7RA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=mcJE81Heqv/EPHPuFnzaWfLFxdQVzRXkGt/dPkSQbujobaCiToYqNOhXkiuYxR1Fop UrwFN8YFP4vtHC1s2aLJ8w4ZdajuYYZGbj8izj6g8AqbsyH8rfksOGEIfZR8gW+rHeif +qE1++oMwtB17FPn6QMtxg5uOB29u/vu+HKfU=
- References: <29445d0d0810291844y54d811fbqd2771a38615a3e79@mail.gmail.com> <490B1746.5020900@linux.vnet.ibm.com> <y0mtzasrbsw.fsf@ton.toronto.redhat.com>
Is it "/lib/libc-2.7.so" in my system?
probe process("/lib/libc-2.7.so").function("gethostbyname").call {
log(user_string($name)) }
Then how long will SystemTap support to trace this function? Thans a lot!
This is the information about libc in my system.
dliu@dliu-desktop:/lib$ ls -all libc.so.6
lrwxrwxrwx 1 root root 11 2008-10-23 22:02 libc.so.6 -> libc-2.7.so
dliu@dliu-desktop:/lib$ ls -all libc-2.7.so
-rwxr-xr-x 1 root root 1274092 2008-09-12 10:32 libc-2.7.so
dliu@dliu-desktop:/lib$ ls -all libc*.so*
-rwxr-xr-x 1 root root 1274092 2008-09-12 10:32 libc-2.7.so
lrwxrwxrwx 1 root root 11 2008-10-23 22:02 libcap.so -> libcap.so.1
lrwxrwxrwx 1 root root 14 2008-10-23 17:30 libcap.so.1 -> libcap.so.1.10
-rw-r--r-- 1 root root 10316 2007-07-31 15:20 libcap.so.1.10
lrwxrwxrwx 1 root root 17 2008-10-23 17:30 libcfont.so.0 ->
libcfont.so.0.0.0
-rw-r--r-- 1 root root 11512 2008-02-06 17:49 libcfont.so.0.0.0
-rw-r--r-- 1 root root 181724 2008-09-12 10:32 libcidn-2.7.so
lrwxrwxrwx 1 root root 14 2008-10-23 22:02 libcidn.so.1 -> libcidn-2.7.so
lrwxrwxrwx 1 root root 17 2008-10-23 17:30 libcom_err.so.2 ->
libcom_err.so.2.1
-rw-r--r-- 1 root root 7444 2008-03-27 13:25 libcom_err.so.2.1
lrwxrwxrwx 1 root root 19 2008-10-23 17:30 libconsole.so.0 ->
libconsole.so.0.0.0
-rw-r--r-- 1 root root 73312 2008-02-06 17:49 libconsole.so.0.0.0
-rw-r--r-- 1 root root 38300 2008-09-12 10:32 libcrypt-2.7.so
lrwxrwxrwx 1 root root 15 2008-10-23 22:02 libcrypt.so.1 -> libcrypt-2.7.so
lrwxrwxrwx 1 root root 11 2008-10-23 22:02 libc.so.6 -> libc-2.7.so
lrwxrwxrwx 1 root root 19 2008-10-23 17:30 libctutils.so.0 ->
libctutils.so.0.0.0
-rw-r--r-- 1 root root 17424 2008-02-06 17:49 libctutils.so.0.0.0
2008/10/31 Frank Ch. Eigler <fche@redhat.com>:
> Breno Leitao <leitao@linux.vnet.ibm.com> writes:
>
>>> Could anyone tell me how to trace the function of gethostbyname using
>>> SystemTap?
>> Since this is not a kernel function, you might want to probe userspace
>> functions.
>
> This should work, before long:
>
> probe process("/libMMM/libc-NNN.so").function("gethostbyname").call { log(user_string($name)) }
>
> In some testing on RHEL5 however, our prologue-searching heuristics
> can't outwit gcc's poor debuginfo quality, so that parameter is hidden
> at the moment. There's a systemtap PR about improving the heuristics.
>
> - FChE
>