Just use strace and u can see all the system call made to the kernel.
The concept is that any userspace application always go through the
system call to reach the kernel, although some assembly insn (eg,
sysenter) may get u directly into kernel as well. so from the system
call trace, and then u extract out all the open() API, u can see a lot
of device specific handling parts of the program.
So for example for pvcreate:
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libdevmapper.so.1.02", O_RDONLY) = 3
open("/lib/librt.so.1", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/lib/libpthread.so.0", O_RDONLY) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY) = 3
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
open("/etc/lvm/lvm.conf", O_RDONLY|O_LARGEFILE) = 3
open("/etc/localtime", O_RDONLY) = 3
open("/proc/mounts", O_RDONLY|O_LARGEFILE) = 3
open("/proc/devices", O_RDONLY) = 3
open("/etc/lvm/.cache", O_RDONLY|O_LARGEFILE) = 3
open("/var/lock/lvm/P_orphans", O_RDWR|O_APPEND|O_CREAT|O_LARGEFILE, 0777) = 3
open("/dev", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/proc/meminfo", O_RDONLY) = 4
open("/dev/bus", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/bus/usb/001", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/bus/usb/002", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/disk", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/disk/by-id", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/disk/by-label", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/disk/by-path", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/disk/by-uuid", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/input", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/input/by-id", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/input/by-path", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/mapper", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/net", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/pts", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/shm", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/shm/sysconfig", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/shm/sysconfig/tmp", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/dev/snd", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
open("/var/lock/lvm/P_orphans", O_RDWR|O_APPEND|O_CREAT|O_LARGEFILE, 0777) = 3
>From each of the different devices above, u should be able to map back
the kernel source that implement these opening.
On Thu, Sep 11, 2008 at 1:51 AM, rohit vashist
<[EMAIL PROTECTED]> wrote:
> Hi,
> I am currently working on device mapper and logical volume manager.
> Can anyone tell me that which function is an entry point for
> lvcreate,pvcreate and vgcreate in kernel.
> Thank You
> Rohit Vashist
--
Regards,
Peter Teoh
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ