sys: rename td_coredump to td_remotereq

and TDB_COREDUMPRQ to TDB_COREDUMPREQ

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37590
This commit is contained in:
Konstantin Belousov 2022-11-30 10:48:24 +02:00
parent f081a291a1
commit e6feeae2f9
3 changed files with 12 additions and 12 deletions

View File

@ -2639,12 +2639,12 @@ ptrace_coredump(struct thread *td)
MPASS(td == curthread);
p = td->td_proc;
PROC_LOCK_ASSERT(p, MA_OWNED);
if ((td->td_dbgflags & TDB_COREDUMPRQ) == 0)
if ((td->td_dbgflags & TDB_COREDUMPREQ) == 0)
return;
KASSERT((p->p_flag & P_STOPPED_TRACE) != 0, ("not stopped"));
tcq = td->td_coredump;
KASSERT(tcq != NULL, ("td_coredump is NULL"));
tcq = td->td_remotereq;
KASSERT(tcq != NULL, ("td_remotereq is NULL"));
if (p->p_sysent->sv_coredump == NULL) {
tcq->tc_error = ENOSYS;
@ -2660,8 +2660,8 @@ ptrace_coredump(struct thread *td)
vn_rangelock_unlock(tcq->tc_vp, rl_cookie);
PROC_LOCK(p);
wake:
td->td_dbgflags &= ~TDB_COREDUMPRQ;
td->td_coredump = NULL;
td->td_dbgflags &= ~TDB_COREDUMPREQ;
td->td_remotereq = NULL;
wakeup(p);
}
@ -2792,7 +2792,7 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si)
td->td_dbgflags |= TDB_SSWITCH;
thread_suspend_switch(td, p);
td->td_dbgflags &= ~TDB_SSWITCH;
if ((td->td_dbgflags & TDB_COREDUMPRQ) != 0) {
if ((td->td_dbgflags & TDB_COREDUMPREQ) != 0) {
PROC_SUNLOCK(p);
ptrace_coredump(td);
PROC_SLOCK(p);

View File

@ -1559,7 +1559,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
error = EBUSY;
goto coredump_cleanup_locked;
}
KASSERT((td2->td_dbgflags & TDB_COREDUMPRQ) == 0,
KASSERT((td2->td_dbgflags & TDB_COREDUMPREQ) == 0,
("proc %d tid %d req coredump", p->p_pid, td2->td_tid));
tcq->tc_vp = fp->f_vnode;
@ -1569,10 +1569,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
tcq->tc_flags |= SVC_NOCOMPRESS;
if ((pc->pc_flags & PC_ALL) != 0)
tcq->tc_flags |= SVC_ALL;
td2->td_coredump = tcq;
td2->td_dbgflags |= TDB_COREDUMPRQ;
td2->td_remotereq = tcq;
td2->td_dbgflags |= TDB_COREDUMPREQ;
thread_run_flash(td2);
while ((td2->td_dbgflags & TDB_COREDUMPRQ) != 0)
while ((td2->td_dbgflags & TDB_COREDUMPREQ) != 0)
msleep(p, &p->p_mtx, PPAUSE, "crdmp", 0);
error = tcq->tc_error;
coredump_cleanup_locked:

View File

@ -384,7 +384,7 @@ struct thread {
int td_oncpu; /* (t) Which cpu we are on. */
void *td_lkpi_task; /* LinuxKPI task struct pointer */
int td_pmcpend;
void *td_coredump; /* (c) coredump request. */
void *td_remotereq; /* (c) dbg remote request. */
off_t td_ktr_io_lim; /* (k) limit for ktrace file size */
#ifdef EPOCH_TRACE
SLIST_HEAD(, epoch_tracker) td_epochs;
@ -522,7 +522,7 @@ enum {
#define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */
#define TDB_STEP 0x00002000 /* (x86) PSL_T set for PT_STEP */
#define TDB_SSWITCH 0x00004000 /* Suspended in ptracestop */
#define TDB_COREDUMPRQ 0x00008000 /* Coredump request */
#define TDB_COREDUMPREQ 0x00008000 /* Coredump request */
/*
* "Private" flags kept in td_pflags: