[vox-tech] Question about listing loaded modules by process...

R. Douglas Barbieri vox-tech@lists.lugod.org
Mon, 17 Jun 2002 15:49:24 -0700 (PDT)


Okay, here is what I'm getting at. Sorry for being unclear.

Say I have a program which plays an audio file. It asks the operating 
system to access the sound card device. If the device driver is compiled 
as a module, the OS requires the module be loaded into memory before the 
sound card can be accessed. For example, say I have a SB16, so I need sb.o 
loaded into memory (and all the dependant modules as well, a la "modprobe 
-r sb").

While the process has this "resource" open (may I refer to it as a
resource?), the module must remain in memory. A "modprobe -r sb" returns
"sb: Device or resource busy." If I can locate the process which is
accessing the sound device (say, for example, "play RMSSings.wav"), and
kill it ("killall play"), I can then do a "modprobe -r sb" successfully.

Suppose I don't know that I have "play" running in the background, or
which programs really are causing the "sb.o" module to remain in memory.  
Isn't there a program out there, a la lsmod and lsof, which allows me to
list what processes are requiring the use of what OS device modules? In
other words, to list out the fact that "play" has "sb.o" locked into
memory?

Does this make more sense, guys? :-)


On Thu, 13 Jun 2002, Jeff Newmiller wrote:

> On Thu, 13 Jun 2002, R. Douglas Barbieri wrote:
> 
> > Hello all,
> > 
> > I came across a command a while ago which allowed me to see which 
> > processes had what modules loaded. I can't for the life of me remember 
> > what it is! Anyone know?
> 
> Your terminology is confusing.  We don't usually refer to processes
> loading modules, since modules are kernel drivers.  Processes may open
> device files (see "lsof"), and may dynamically link with shared objects
> ("ldd").
> 
> Actually, Apache supports a different kind of "module"... but I don't know
> how to see which ones are loaded.
> 
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
> ---------------------------------------------------------------------------
> 
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
> 

-- 
R. Douglas Barbieri
doug@dooglio.net
http://www.dooglio.net

"That government is best which governs the least, because its people
   discipline themselves."

-- Thomas Jefferson