Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/proc.h
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | #define td_retval td_uretoff.tdu_retval | ||||
/* LP64 hole */ | /* LP64 hole */ | ||||
void *td_emuldata; /* Emulator state data */ | void *td_emuldata; /* Emulator state data */ | ||||
int td_lastcpu; /* (t) Last cpu we were on. */ | int td_lastcpu; /* (t) Last cpu we were on. */ | ||||
int td_oncpu; /* (t) Which cpu we are on. */ | int td_oncpu; /* (t) Which cpu we are on. */ | ||||
void *td_lkpi_task; /* LinuxKPI task struct pointer */ | void *td_lkpi_task; /* LinuxKPI task struct pointer */ | ||||
int td_pmcpend; | int td_pmcpend; | ||||
#ifdef EPOCH_TRACE | #ifdef EPOCH_TRACE | ||||
SLIST_HEAD(, epoch_tracker) td_epochs; | SLIST_HEAD(, epoch_tracker) td_epochs; | ||||
#endif | #endif | ||||
kib: Please move the fields into dedicated structure, only pointer to which is stored in struct proc. | |||||
}; | }; | ||||
struct thread0_storage { | struct thread0_storage { | ||||
struct thread t0st_thread; | struct thread t0st_thread; | ||||
uint64_t t0st_sched[10]; | uint64_t t0st_sched[10]; | ||||
}; | }; | ||||
struct mtx *thread_lock_block(struct thread *); | struct mtx *thread_lock_block(struct thread *); | ||||
▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | #define p_endcopy p_xexit | ||||
struct label *p_label; /* (*) Proc (not subject) MAC label. */ | struct label *p_label; /* (*) Proc (not subject) MAC label. */ | ||||
STAILQ_HEAD(, ktr_request) p_ktr; /* (o) KTR event queue. */ | STAILQ_HEAD(, ktr_request) p_ktr; /* (o) KTR event queue. */ | ||||
LIST_HEAD(, mqueue_notifier) p_mqnotifier; /* (c) mqueue notifiers.*/ | LIST_HEAD(, mqueue_notifier) p_mqnotifier; /* (c) mqueue notifiers.*/ | ||||
struct kdtrace_proc *p_dtrace; /* (*) DTrace-specific data. */ | struct kdtrace_proc *p_dtrace; /* (*) DTrace-specific data. */ | ||||
struct cv p_pwait; /* (*) wait cv for exit/exec. */ | struct cv p_pwait; /* (*) wait cv for exit/exec. */ | ||||
uint64_t p_prev_runtime; /* (c) Resource usage accounting. */ | uint64_t p_prev_runtime; /* (c) Resource usage accounting. */ | ||||
struct racct *p_racct; /* (b) Resource accounting. */ | struct racct *p_racct; /* (b) Resource accounting. */ | ||||
int p_throttled; /* (c) Flag for racct pcpu throttling */ | int p_throttled; /* (c) Flag for racct pcpu throttling */ | ||||
struct vnode *p_coredump_vn; /* vnode to write coredump to. */ | |||||
Done Inline ActionsI suggest to not add these fields to the struct proc, they are almost never used, but have to be allocated for each process. Instead, add single pointer, which points to the structure containing these members. Structure needs to be malloc-ed by the debugger thread, it should be not allocated on stack, because sleeping thread waiting for the coredump to finish, might get it stack swapped out. Also this pointer != NULL may serve better than P2_COREDUMP. The structure should also include an indicator of the finished dump, which solves another use of P2_COREDUMP. kib: I suggest to not add these fields to the struct proc, they are almost never used, but have to… | |||||
/* | /* | ||||
* An orphan is the child that has been re-parented to the | * An orphan is the child that has been re-parented to the | ||||
* debugger as a result of attaching to it. Need to keep | * debugger as a result of attaching to it. Need to keep | ||||
* track of them for parent to be able to collect the exit | * track of them for parent to be able to collect the exit | ||||
* status of what used to be children. | * status of what used to be children. | ||||
*/ | */ | ||||
LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */ | LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */ | ||||
LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */ | LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */ | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | #define P2_PROTMAX_ENABLE 0x00000200 /* Force enable implied | ||||
PROT_MAX. */ | PROT_MAX. */ | ||||
#define P2_PROTMAX_DISABLE 0x00000400 /* Force disable implied | #define P2_PROTMAX_DISABLE 0x00000400 /* Force disable implied | ||||
PROT_MAX. */ | PROT_MAX. */ | ||||
#define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for | #define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for | ||||
MAP_STACK */ | MAP_STACK */ | ||||
#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | #define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | ||||
after exec */ | after exec */ | ||||
#define P2_ITSTOPPED 0x00002000 | #define P2_ITSTOPPED 0x00002000 | ||||
#define P2_COREDUMP 0x00004000 /* Coredump request */ | |||||
/* Flags protected by proctree_lock, kept in p_treeflags. */ | /* Flags protected by proctree_lock, kept in p_treeflags. */ | ||||
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | ||||
#define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | #define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | ||||
list */ | list */ | ||||
#define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | #define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | ||||
#define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | #define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | ||||
▲ Show 20 Lines • Show All 450 Lines • Show Last 20 Lines |
Please move the fields into dedicated structure, only pointer to which is stored in struct proc. See my previous note for more elaboration.