This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does anyone have idea of how to trace the funtion "gethostbyname"?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]