diff options
author | peter <peter@FreeBSD.org> | 2008-11-29 20:55:11 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2008-11-29 20:55:11 +0000 |
commit | 83dc2280cebd626d5a4fda7c4268a94d329c4e78 (patch) | |
tree | 7986065c4da46520b13e12c66b0106ad76a2b1e1 /sys/kern | |
parent | d8aff71262b6224530a865344e20823189bd5cb1 (diff) | |
download | FreeBSD-src-83dc2280cebd626d5a4fda7c4268a94d329c4e78.zip FreeBSD-src-83dc2280cebd626d5a4fda7c4268a94d329c4e78.tar.gz |
WIP kinfo_file/kinfo_vmmentry tweaks. The idea:
1) to get the 32 and 64 bit versions in sync so that no shims are needed,
Valgrind in particular excercises this. and:
2) reduce the size of the copyout. On large processes this turns out to
be a huge problem. Valgrind also suffers from this since it needs to do
this in a context that can't malloc. I want to pack the records.
3) Add new types.. 'tell me about fd N' and 'tell me about addr N'.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_proc.c | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 833aa2c..848aa92 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2509,6 +2509,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD, 0, 0, sysctl_kern_file, "S,xfile", "Entire file table"); +#ifdef KINFO_FILE_SIZE +CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); +#endif + static int export_vnode_for_sysctl(struct vnode *vp, int type, struct kinfo_file *kif, struct filedesc *fdp, struct sysctl_req *req) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index a331a42..e8e6e00 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1337,6 +1337,10 @@ sysctl_kern_proc_sv_name(SYSCTL_HANDLER_ARGS) return (sysctl_handle_string(oidp, sv_name, 0, req)); } +#ifdef KINFO_VMENTRY_SIZE +CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); +#endif + static int sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) { @@ -1461,9 +1465,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) kve->kve_shadow_count = 0; } - kve->kve_start = (void*)entry->start; - kve->kve_end = (void*)entry->end; - kve->kve_offset = (off_t)entry->offset; + kve->kve_start = entry->start; + kve->kve_end = entry->end; + kve->kve_offset = entry->offset; if (entry->protection & VM_PROT_READ) kve->kve_protection |= KVME_PROT_READ; |