Travis Crawford wrote: > However, I'm confused by this code snippet (from > http://www.brendangregg.com/DTrace/iotop): > > """ > /* fetch 1 min load average */ > this->load1a = `hp_avenrun[0] / 65536; > this->load1b = ((`hp_avenrun[0] % 65536) * 100) / 65536; > """ > > I can't figure out where hp_avenrun is defined. I searched > http://wikis.sun.com/display/DTrace as well as looking at all the > probes on my system ($ sudo dtrace -l | grep hp_avenrun) and came up > empty. > > So my question is, when reading d scripts, how should I go about > finding out what these mysterious variables are?
The ` (backtick) is used to access to access kernel variables in DTrace scripts. The best way to find what these do is to use the OpenGrok source browser at http://src.opensolaris.org. The hp_avenrun variable is defined here: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/clock.c#97 Menno -- Menno Lageman - Sun Microsystems - http://blogs.sun.com/menno _______________________________________________ dtrace-discuss mailing list [email protected]
