diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2003-09-29 20:53:19 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2003-09-29 20:53:19 +0000 |
| commit | 309cd884321317fe6fb6f84f9c6f5c11bb0cb95e (patch) | |
| tree | 3ec7addbf0f85c515af7f7f07cd07130d818002a /sys/fs/procfs/procfs_map.c | |
| parent | cc7b13bfe0dc4a881a42519ba6f8a959d0452d4e (diff) | |
Notes
Diffstat (limited to 'sys/fs/procfs/procfs_map.c')
| -rw-r--r-- | sys/fs/procfs/procfs_map.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 380814521d8b..478bcba53f9e 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -42,9 +42,12 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/lock.h> +#include <sys/filedesc.h> +#include <sys/malloc.h> #include <sys/mutex.h> #include <sys/proc.h> #include <sys/uio.h> +#include <sys/vnode.h> #include <fs/pseudofs/pseudofs.h> #include <fs/procfs/procfs.h> @@ -77,6 +80,7 @@ procfs_doprocmap(PFS_FILL_ARGS) pmap_t pmap = vmspace_pmap(p->p_vmspace); vm_map_entry_t entry; char mebuffer[MEBUFFERSIZE]; + char *fullpath, *freepath; GIANT_REQUIRED; @@ -124,6 +128,8 @@ procfs_doprocmap(PFS_FILL_ARGS) for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) lobj = tobj; + freepath = NULL; + fullpath = "-"; if (lobj) { switch(lobj->type) { default: @@ -132,6 +138,11 @@ procfs_doprocmap(PFS_FILL_ARGS) break; case OBJT_VNODE: type = "vnode"; + vn_fullpath(td, + (struct vnode *)lobj->handle, + &fullpath, + &freepath); + printf("string: %s\n", fullpath); break; case OBJT_SWAP: type = "swap"; @@ -156,7 +167,7 @@ procfs_doprocmap(PFS_FILL_ARGS) * start, end, resident, private resident, cow, access, type. */ snprintf(mebuffer, sizeof mebuffer, - "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s\n", + "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", (u_long)entry->start, (u_long)entry->end, resident, privateresident, obj, (entry->protection & VM_PROT_READ)?"r":"-", @@ -165,7 +176,10 @@ procfs_doprocmap(PFS_FILL_ARGS) ref_count, shadow_count, flags, (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", - type); + type, fullpath); + + if (freepath != NULL) + free(freepath, M_TEMP); len = strlen(mebuffer); if (len > uio->uio_resid) { |
