Archive
Posts from 2007
Viewing function calls with whocalls
While catching up with various opensolaris.org mailing lists, I came across a post that described the whocalls utility. This nifty little utility can be used to view the stack frames leading up to a call to a specific function, which can be super useful for debugging. To view all of the code paths leading up to the printf function being called, whocalls can be run with the name of the function to look for, and the executable that we want to analyze for calls to that function: printf(0x80541b0, 0x8067800, 0x80653a8) /usr/bin/ls:pentry+0x593 /usr/bin/ls:pem+0xb1 /usr/bin/ls:pdirectory+0x266 /usr/bin/ls:main+0x70e /usr/bin/ls:_start+0x7a printf(0x80541b0, 0x8067a48, 0x80653a8) /usr/bin/ls:pentry+0x593 /usr/bin/ls:pem+0xb1 /usr/bin/ls:pdirectory+0x266 /usr/bin/ls:main+0x70e /usr/bin/ls:_start+0x7a < ..... > Now to do some research on the runtime linker's auditing facilities in /usr/lib/link_audit/*!
$ read more →Viewing busy code paths with DTrace
Periodically I want to see the busiest application and system code paths on a system. Prior to Solaris 10, this was a difficult questions to answer without custom instrumentation. Now that we have DTrace, we can use the DTrace profile provider and an aggregation to view the busiest code paths in the kernel: To see the busiest userland code paths, we can aggregate on the executable and userland stack frames, but only when we are in user context (arg1 indicates which context we are in): This is huge, and with two lines of DTrace, you can dynamically view the busiest code paths in kernel and user context. Nice!
$ read more →Testing NTP services
Periodically I need to update my systems with new NTP server information. Since I have no idea if the remote servers are well kept, I tend to run ntpdate in test mode prior to starting ntpd or adding ntpdate to root's crontab. To run ntpdate in test mode, you can use the "-d" option: In addition to printing the timestamps, it also provides the offset the clock will be adjusted by. Certain applications dislike the time moving forward or back, which makes the ntpdate test option even more useful.
$ read more →Changing the server name Sun One Web Server reports
I am a big fan of the Sun One Web Server, although I dislike the fact that it provides the server software and version by default in the HTTP header: Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.1 200 OK Server: Sun-ONE-Web-Server/6.1 Date: Fri, 23 Feb 2007 22:41:21TGMT:00-04:00 Content-length: 179 Content-type: text/html Last-modified: Tue, 20 Feb 2007 14:30:21 GMT Accept-ranges: bytes Connection: close Connection closed by foreign host…
$ read more →Configuring the V40z SP to email home when problems occur
Having now worked with the Sun V40Z for more than a year, I can safely say that it is one of the best server platforms I have ever used. It has incredible lights out management, does a killer job of monitoring the platform environmentals, and can be configured to alert staff to problems it detects. All of these featured are made available through the service processor, which is an out-of-band device dedicated to monitoring and management. Since the service processor is constantly polling the platform environmentals, it knows immediately when a problem arises, and can be configured to send email or an SNMP trap with a detailed explanation of the issue that is detected…
$ read more →