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: "Breno Leitao" <leitao at linux dot vnet dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Sat, 1 Nov 2008 16:13:37 -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=o2ouvDg9Lo5DZF6N8aJYLgMjnXoBL5FUVsvef/2h0L8=; b=v+27X5nhkLcRhGJnFnEkvcfyEMxHNENFAjcM8hduRUOXGMKWPw3ddhjLSgXXgaN1VR 8VkduOkBtSIZu62P1AHj1zO66UhOxxq6gdagPgwQSA/qoWtLochyXZrKU8exLVkj3CYe emsAhCjwjnNlNYMFzBEuHTYoW8IG7z7b3AeCk=
- 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=nca9om7WJr6ePGYmnLinJYNJZV+4exuHl5kwHw17JLuo1gyqN9u/pnWpw1e2G7ha4A rVKZcasWTmWPch2/jiHtGZvBMcYXJw9RGIKzy5E0whX4KIMTmYJmTpotka7zdVqL4pkZ sqSCuWgHprdhXGUGruwn1aVSpGmCLdJutdGJ8=
- References: <29445d0d0810291844y54d811fbqd2771a38615a3e79@mail.gmail.com> <490B1746.5020900@linux.vnet.ibm.com>
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.
>