public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Does anyone have idea of how to trace the funtion "gethostbyname"?
@ 2008-10-30  1:44 Dongtao Liu
  2008-10-31 14:34 ` Breno Leitao
  0 siblings, 1 reply; 5+ messages in thread
From: Dongtao Liu @ 2008-10-30  1:44 UTC (permalink / raw)
  To: systemtap

Hi all:

I recently doing some work to record all DNS lookups in the system.
Could anyone tell me how to trace the function of gethostbyname using
SystemTap?

Thank you very much!

Dongtao

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
  2008-10-30  1:44 Does anyone have idea of how to trace the funtion "gethostbyname"? Dongtao Liu
@ 2008-10-31 14:34 ` Breno Leitao
  2008-10-31 16:04   ` Frank Ch. Eigler
  2008-11-01 20:14   ` Dongtao Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Breno Leitao @ 2008-10-31 14:34 UTC (permalink / raw)
  To: Dongtao Liu; +Cc: systemtap

Dongtao Liu wrote:
> I recently doing some work to record all DNS lookups in the system.
> 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. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
  2008-10-31 14:34 ` Breno Leitao
@ 2008-10-31 16:04   ` Frank Ch. Eigler
  2008-11-01 20:14     ` Dongtao Liu
  2008-11-01 20:14   ` Dongtao Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Ch. Eigler @ 2008-10-31 16:04 UTC (permalink / raw)
  To: Breno Leitao; +Cc: Dongtao Liu, systemtap

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
  2008-10-31 16:04   ` Frank Ch. Eigler
@ 2008-11-01 20:14     ` Dongtao Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Dongtao Liu @ 2008-11-01 20:14 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: Breno Leitao, systemtap

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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Does anyone have idea of how to trace the funtion "gethostbyname"?
  2008-10-31 14:34 ` Breno Leitao
  2008-10-31 16:04   ` Frank Ch. Eigler
@ 2008-11-01 20:14   ` Dongtao Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Dongtao Liu @ 2008-11-01 20:14 UTC (permalink / raw)
  To: Breno Leitao; +Cc: systemtap

yes, it is the function in libc. I downloaded the source code of
glibc-2.7.3 and found gethostbyname() function in
/resolv/gethnamaddr.c

dliu@dliu-desktop:/usr/src/glibc/glibc-2.7/resolv$ ls
arpa          gai_misc.c      getaddrinfo_a.c  inet_net_pton.c
netdb.h      ns_samedomain.c  res_debug.c  res_mkquery.c  tst-aton.c
Banner        gai_misc.h      gethnamaddr.c    inet_ntop.c
nsap_addr.c  nss_dns          res_debug.h  resolv.h
tst-inet_ntop.c
base64.c      gai_notify.c    herror.c         inet_pton.c
ns_name.c    ns_ttl.c         res_hconf.c  res_query.c    tst-leaks2.c
Depend        gai_sigqueue.c  inet_addr.c      Makefile
ns_netint.c  README           res_hconf.h  res_send.c     tst-leaks.c
gai_cancel.c  gai_suspend.c   inet_neta.c      mapv4v6addr.h
ns_parse.c   res_comp.c       res_init.c   res-state.c    Versions
gai_error.c   ga_test.c       inet_net_ntop.c  mapv4v6hostent.h
ns_print.c   res_data.c       res_libc.c   sys


2008/10/31 Breno Leitao <leitao@linux.vnet.ibm.com>:
> Dongtao Liu wrote:
>> I recently doing some work to record all DNS lookups in the system.
>> 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.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-01 20:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30  1:44 Does anyone have idea of how to trace the funtion "gethostbyname"? Dongtao Liu
2008-10-31 14:34 ` Breno Leitao
2008-10-31 16:04   ` Frank Ch. Eigler
2008-11-01 20:14     ` Dongtao Liu
2008-11-01 20:14   ` Dongtao Liu

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).