"Roger" == Roger <a_ver_est at yahoo.com> writes:
Roger> I am a newbie in solaris kernel knowledge, so i am sorry if my
Roger> question is too stupid.
Roger> I have a process that's is using the system call poll all the
Roger> time. I want to know which file descriptor is "polling".
Roger> Form headers i got this information.
Roger> poll.h
Roger> int poll(struct pollfd *, nfds_t, int);
Roger> typedef struct pollfd {
Roger> int fd; /* file desc to poll */
Roger> short events; /* events of interest on fd */
Roger> short revents; /* events that occurred on fd */
Roger> } pollfd_t;
Roger> I have done a truss to the process I can see the poll call:
Roger> 7640/1: 0.0148 poll(0xFFFFFFFF7FFF0990, 1, 0)
= 0
Have you tried "truss -v poll"? It may be that truss already knows
how to interpret struct pollfd *.
Another way is to use dtrace to grab the first argument and print it.
Roger> So I run scat and try to dump the pointer to the pollfd
Roger> structure, but it doesn't work.
Roger> SolarisCAT(live)> sdump 0xFFFFFFFF7FFF0990 pollfd
Roger> read failed for pollfd: 8 bytes @ 0xffffffff7fff0990: Invalid argument
The address is in user space, and scat is trying to interpret it as a
kernel space address. In fact, since that looks like a stack address
to me, I'd say unless you capture it at the right time, it may already
be overwritten by the time you look. A tool like truss or dtrace will
probably work more reliably in this case.
--
Dave Marquardt
Sun Microsystems, Inc.
Austin, TX
+1 512 401-1077 (SUN internal: x64077)