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/sys/user.h | |
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/sys/user.h')
-rw-r--r-- | sys/sys/user.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h index a12669f..2a7b36b 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -236,6 +236,9 @@ struct user { struct kinfo_proc u_kproc; /* eproc */ }; +/* When exporting paths via sysctl, give a short version */ +#define KPROC_PATH_MAX 256 + /* * The KERN_PROC_FILE sysctl allows a process to dump the file descriptor * array of another process. @@ -277,20 +280,25 @@ struct user { #define KF_FLAG_DIRECT 0x00000040 #define KF_FLAG_HASLOCK 0x00000080 +#if defined(__amd64__) || defined(__i386__) +#define KINFO_FILE_SIZE 560 +#endif + struct kinfo_file { int kf_structsize; /* Size of kinfo_file. */ int kf_type; /* Descriptor type. */ int kf_fd; /* Array index. */ int kf_ref_count; /* Reference count. */ int kf_flags; /* Flags. */ - off_t kf_offset; /* Seek location. */ + int _kf_pad0; /* Alignment */ + uint64_t kf_offset; /* Seek location. */ int kf_vnode_type; /* Vnode type. */ int kf_sock_domain; /* Socket domain. */ int kf_sock_type; /* Socket type. */ int kf_sock_protocol; /* Socket protocol. */ - char kf_path[PATH_MAX]; /* Path to file, if any. */ struct sockaddr_storage kf_sa_local; /* Socket address. */ struct sockaddr_storage kf_sa_peer; /* Peer address. */ + char kf_path[KPROC_PATH_MAX]; /* Path to file, if any. */ }; /* @@ -313,23 +321,26 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 +#if defined(__amd64__) || defined(__i386__) +#define KINFO_VMENTRY_SIZE 384 +#endif + struct kinfo_vmentry { int kve_structsize; /* Size of kinfo_vmmapentry. */ int kve_type; /* Type of map entry. */ - void *kve_start; /* Starting pointer. */ - void *kve_end; /* Finishing pointer. */ + uint64_t kve_start; /* Starting address. */ + uint64_t kve_end; /* Finishing address. */ + uint64_t kve_offset; /* Mapping offset in object */ + uint64_t kve_fileid; /* inode number if vnode */ + uint32_t kve_fsid; /* dev_t of vnode location */ int kve_flags; /* Flags on map entry. */ int kve_resident; /* Number of resident pages. */ int kve_private_resident; /* Number of private pages. */ int kve_protection; /* Protection bitmask. */ int kve_ref_count; /* VM obj ref count. */ int kve_shadow_count; /* VM obj shadow count. */ - char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ - void *_kve_pspare[8]; /* Space for more stuff. */ - off_t kve_offset; /* Mapping offset in object */ - uint64_t kve_fileid; /* inode number of vnode */ - dev_t kve_fsid; /* dev_t of vnode location */ - int _kve_ispare[3]; /* Space for more stuff. */ + int _kve_ispare[15]; /* Space for more stuff. */ + char kve_path[KPROC_PATH_MAX]; /* Path to VM obj, if any. */ }; /* @@ -343,12 +354,15 @@ struct kinfo_vmentry { #define KKST_STATE_SWAPPED 1 /* Stack swapped out. */ #define KKST_STATE_RUNNING 2 /* Stack ephemeral. */ +#if defined(__amd64__) || defined(__i386__) +#define KINFO_KSTACK_SIZE 1096 +#endif + struct kinfo_kstack { lwpid_t kkst_tid; /* ID of thread. */ int kkst_state; /* Validity of stack. */ char kkst_trace[KKST_MAXLEN]; /* String representing stack. */ - void *_kkst_pspare[8]; /* Space for more stuff. */ - int _kkst_ispare[8]; /* Space for more stuff. */ + int _kkst_ispare[16]; /* Space for more stuff. */ }; #endif |