Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136905157
D20178.id57124.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
64 KB
Referenced Files
None
Subscribers
None
D20178.id57124.diff
View Options
Index: sys/amd64/linux/linux.h
===================================================================
--- sys/amd64/linux/linux.h
+++ sys/amd64/linux/linux.h
@@ -37,15 +37,6 @@
#define LINUX_LEGACY_SYSCALLS
-/*
- * debugging support
- */
-extern u_char linux_debug_map[];
-#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
-#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator
#define PTRIN(v) (void *)(v)
Index: sys/amd64/linux/linux_sysvec.c
===================================================================
--- sys/amd64/linux/linux_sysvec.c
+++ sys/amd64/linux/linux_sysvec.c
@@ -86,20 +86,6 @@
MODULE_VERSION(linux64, 1);
-#if defined(DEBUG)
-SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
- CTLTYPE_STRING | CTLFLAG_RW,
- 0, 0, linux_sysctl_debug, "A",
- "Linux 64 debugging control");
-#endif
-
-/*
- * Allow the sendsig functions to use the ldebug() facility even though they
- * are not syscalls themselves. Map them to syscall 0. This is slightly less
- * bogus than using ldebug(sigreturn).
- */
-#define LINUX_SYS_linux_rt_sendsig 0
-
const char *linux_kplatform;
static int linux_szsigcode;
static vm_object_t linux_shared_page_obj;
@@ -645,9 +631,6 @@
/* Copy the sigframe out to the user's stack. */
if (copyout(&sf, sfp, sizeof(*sfp)) != 0) {
-#ifdef DEBUG
- printf("process %ld has trashed its stack\n", (long)p->p_pid);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
Index: sys/amd64/linux32/linux.h
===================================================================
--- sys/amd64/linux32/linux.h
+++ sys/amd64/linux32/linux.h
@@ -40,15 +40,6 @@
#define LINUX_LEGACY_SYSCALLS
-/*
- * debugging support
- */
-extern u_char linux_debug_map[];
-#define ldebug(name) isclr(linux_debug_map, LINUX32_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
-#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator32
#define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE)
Index: sys/amd64/linux32/linux32_machdep.c
===================================================================
--- sys/amd64/linux32/linux32_machdep.c
+++ sys/amd64/linux32/linux32_machdep.c
@@ -133,11 +133,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(execve))
- printf(ARGS(execve, "%s"), path);
-#endif
-
error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
args->argp, args->envp);
free(path, M_TEMP);
@@ -382,11 +377,6 @@
struct linux_select_args newsel;
int error;
-#ifdef DEBUG
- if (ldebug(old_select))
- printf(ARGS(old_select, "%p"), args->ptr);
-#endif
-
error = copyin(args->ptr, &linux_args, sizeof(linux_args));
if (error)
return (error);
@@ -410,29 +400,19 @@
error = copyin(desc, &info, sizeof(struct l_user_desc));
if (error) {
- printf(LMSG("copyin failed!"));
+ linux_msg(td, "set_cloned_tls copyin info failed!");
} else {
+
/* We might copy out the entry_number as GUGS32_SEL. */
info.entry_number = GUGS32_SEL;
error = copyout(&info, desc, sizeof(struct l_user_desc));
if (error)
- printf(LMSG("copyout failed!"));
+ linux_msg(td, "set_cloned_tls copyout info failed!");
a[0] = LINUX_LDT_entry_a(&info);
a[1] = LINUX_LDT_entry_b(&info);
memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
- if (ldebug(clone))
- printf("Segment created in clone with "
- "CLONE_SETTLS: lobase: %x, hibase: %x, "
- "lolimit: %x, hilimit: %x, type: %i, "
- "dpl: %i, p: %i, xx: %i, long: %i, "
- "def32: %i, gran: %i\n", sd.sd_lobase,
- sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
- sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
- sd.sd_long, sd.sd_def32, sd.sd_gran);
-#endif
pcb = td->td_pcb;
pcb->pcb_gsbase = (register_t)info.base_addr;
td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
@@ -461,13 +441,6 @@
linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
{
-#ifdef DEBUG
- if (ldebug(mmap2))
- printf(ARGS(mmap2, "0x%08x, %d, %d, 0x%08x, %d, %d"),
- args->addr, args->len, args->prot,
- args->flags, args->fd, args->pgoff);
-#endif
-
return (linux_mmap_common(td, PTROUT(args->addr), args->len, args->prot,
args->flags, args->fd, (uint64_t)(uint32_t)args->pgoff *
PAGE_SIZE));
@@ -483,13 +456,6 @@
if (error)
return (error);
-#ifdef DEBUG
- if (ldebug(mmap))
- printf(ARGS(mmap, "0x%08x, %d, %d, 0x%08x, %d, %d"),
- linux_args.addr, linux_args.len, linux_args.prot,
- linux_args.flags, linux_args.fd, linux_args.pgoff);
-#endif
-
return (linux_mmap_common(td, linux_args.addr, linux_args.len,
linux_args.prot, linux_args.flags, linux_args.fd,
(uint32_t)linux_args.pgoff));
@@ -526,12 +492,6 @@
l_sigaction_t act, oact;
int error;
-#ifdef DEBUG
- if (ldebug(sigaction))
- printf(ARGS(sigaction, "%d, %p, %p"),
- args->sig, (void *)args->nsa, (void *)args->osa);
-#endif
-
if (args->nsa != NULL) {
error = copyin(args->nsa, &osa, sizeof(l_osigaction_t));
if (error)
@@ -568,11 +528,6 @@
sigset_t sigmask;
l_sigset_t mask;
-#ifdef DEBUG
- if (ldebug(sigsuspend))
- printf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask);
-#endif
-
LINUX_SIGEMPTYSET(mask);
mask.__mask = args->mask;
linux_to_bsd_sigset(&mask, &sigmask);
@@ -586,12 +541,6 @@
sigset_t sigmask;
int error;
-#ifdef DEBUG
- if (ldebug(rt_sigsuspend))
- printf(ARGS(rt_sigsuspend, "%p, %d"),
- (void *)uap->newset, uap->sigsetsize);
-#endif
-
if (uap->sigsetsize != sizeof(l_sigset_t))
return (EINVAL);
@@ -609,11 +558,6 @@
struct proc *p = td->td_proc;
sigset_t sigmask;
-#ifdef DEBUG
- if (ldebug(pause))
- printf(ARGS(pause, ""));
-#endif
-
PROC_LOCK(p);
sigmask = td->td_sigmask;
PROC_UNLOCK(p);
@@ -627,11 +571,6 @@
l_stack_t lss;
int error;
-#ifdef DEBUG
- if (ldebug(sigaltstack))
- printf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss);
-#endif
-
if (uap->uss != NULL) {
error = copyin(uap->uss, &lss, sizeof(l_stack_t));
if (error)
@@ -657,12 +596,6 @@
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
{
-#ifdef DEBUG
- if (ldebug(ftruncate64))
- printf(ARGS(ftruncate64, "%u, %jd"), args->fd,
- (intmax_t)args->length);
-#endif
-
return (kern_ftruncate(td, args->fd, args->length));
}
@@ -743,15 +676,6 @@
if (error)
return (error);
-#ifdef DEBUG
- if (ldebug(set_thread_area))
- printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, "
- "%i, %i, %i"), info.entry_number, info.base_addr,
- info.limit, info.seg_32bit, info.contents,
- info.read_exec_only, info.limit_in_pages,
- info.seg_not_present, info.useable);
-#endif
-
/*
* Semantics of Linux version: every thread in the system has array
* of three TLS descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown.
@@ -805,25 +729,6 @@
}
memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
- if (ldebug(set_thread_area))
- printf("Segment created in set_thread_area: "
- "lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, "
- "type: %i, dpl: %i, p: %i, xx: %i, long: %i, "
- "def32: %i, gran: %i\n",
- sd.sd_lobase,
- sd.sd_hibase,
- sd.sd_lolimit,
- sd.sd_hilimit,
- sd.sd_type,
- sd.sd_dpl,
- sd.sd_p,
- sd.sd_xx,
- sd.sd_long,
- sd.sd_def32,
- sd.sd_gran);
-#endif
-
pcb = td->td_pcb;
pcb->pcb_gsbase = (register_t)info.base_addr;
set_pcb_flags(pcb, PCB_32BIT);
Index: sys/amd64/linux32/linux32_sysvec.c
===================================================================
--- sys/amd64/linux32/linux32_sysvec.c
+++ sys/amd64/linux32/linux32_sysvec.c
@@ -91,14 +91,6 @@
MODULE_VERSION(linux, 1);
-/*
- * Allow the sendsig functions to use the ldebug() facility even though they
- * are not syscalls themselves. Map them to syscall 0. This is slightly less
- * bogus than using ldebug(sigreturn).
- */
-#define LINUX32_SYS_linux_rt_sendsig 0
-#define LINUX32_SYS_linux_sendsig 0
-
const char *linux_kplatform;
static int linux_szsigcode;
static vm_object_t linux_shared_page_obj;
@@ -286,11 +278,6 @@
regs = td->td_frame;
oonstack = sigonstack(regs->tf_rsp);
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(ARGS(rt_sendsig, "%p, %d, %p, %u"),
- catcher, sig, (void*)mask, code);
-#endif
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
@@ -349,23 +336,11 @@
frame.sf_sc.uc_mcontext.sc_cr2 = (u_int32_t)(uintptr_t)ksi->ksi_addr;
frame.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(LMSG("rt_sendsig flags: 0x%x, sp: %p, ss: 0x%lx, mask: 0x%x"),
- frame.sf_sc.uc_stack.ss_flags, td->td_sigstk.ss_sp,
- td->td_sigstk.ss_size, frame.sf_sc.uc_mcontext.sc_mask);
-#endif
-
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
* Process has trashed its stack; give it an illegal
* instruction to halt it in its tracks.
*/
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"),
- fp, oonstack);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
@@ -423,12 +398,6 @@
regs = td->td_frame;
oonstack = sigonstack(regs->tf_rsp);
-#ifdef DEBUG
- if (ldebug(sendsig))
- printf(ARGS(sendsig, "%p, %d, %p, %u"),
- catcher, sig, (void*)mask, code);
-#endif
-
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
@@ -521,10 +490,6 @@
regs = td->td_frame;
-#ifdef DEBUG
- if (ldebug(sigreturn))
- printf(ARGS(sigreturn, "%p"), (void *)args->sfp);
-#endif
/*
* The trampoline code hands us the sigframe.
* It is unsafe to keep track of it ourselves, in the event that a
@@ -606,10 +571,6 @@
regs = td->td_frame;
-#ifdef DEBUG
- if (ldebug(rt_sigreturn))
- printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp);
-#endif
/*
* The trampoline code hands us the ucontext.
* It is unsafe to keep track of it ourselves, in the event that a
@@ -674,11 +635,6 @@
ss.ss_size = lss->ss_size;
ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
-#ifdef DEBUG
- if (ldebug(rt_sigreturn))
- printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%lx, mask: 0x%x"),
- ss.ss_flags, ss.ss_sp, ss.ss_size, context->sc_mask);
-#endif
(void)kern_sigaltstack(td, &ss, NULL);
return (EJUSTRETURN);
@@ -869,11 +825,6 @@
SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW,
&linux32_maxvmem, 0, "");
-#if defined(DEBUG)
-SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
- linux_sysctl_debug, "A", "Linux debugging control");
-#endif
-
static void
linux32_fixlimit(struct rlimit *rl, int which)
{
Index: sys/arm64/linux/linux.h
===================================================================
--- sys/arm64/linux/linux.h
+++ sys/arm64/linux/linux.h
@@ -34,14 +34,6 @@
#include <compat/linux/linux.h>
#include <arm64/linux/linux_syscall.h>
-/* Debugging support */
-#define DEBUG
-extern u_char linux_debug_map[];
-#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
-#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator
#define PTRIN(v) (void *)(v)
Index: sys/arm64/linux/linux_sysvec.c
===================================================================
--- sys/arm64/linux/linux_sysvec.c
+++ sys/arm64/linux/linux_sysvec.c
@@ -59,11 +59,6 @@
MODULE_VERSION(linux64elf, 1);
-#if defined(DEBUG)
-SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
- linux_sysctl_debug, "A", "64-bit Linux debugging control");
-#endif
-
const char *linux_kplatform;
static int linux_szsigcode;
static vm_object_t linux_shared_page_obj;
Index: sys/compat/linux/linux_file.c
===================================================================
--- sys/compat/linux/linux_file.c
+++ sys/compat/linux/linux_file.c
@@ -76,10 +76,7 @@
int error;
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(creat))
- printf(ARGS(creat, "%s, %d"), path, args->mode);
-#endif
+
error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE,
O_WRONLY | O_CREAT | O_TRUNC, args->mode);
LFREEPATH(path);
@@ -165,14 +162,6 @@
}
done:
-#ifdef DEBUG
-#ifdef LINUX_LEGACY_SYSCALLS
- if (ldebug(open))
-#else
- if (ldebug(openat))
-#endif
- printf(LMSG("open returns error %d"), error);
-#endif
LFREEPATH(path);
return (error);
}
@@ -188,11 +177,7 @@
LCONVPATH_AT(td, args->filename, &path, 1, dfd);
else
LCONVPATH_AT(td, args->filename, &path, 0, dfd);
-#ifdef DEBUG
- if (ldebug(openat))
- printf(ARGS(openat, "%i, %s, 0x%x, 0x%x"), args->dfd,
- path, args->flags, args->mode);
-#endif
+
return (linux_common_open(td, dfd, path, args->flags, args->mode));
}
@@ -206,11 +191,7 @@
LCONVPATHCREAT(td, args->path, &path);
else
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(open))
- printf(ARGS(open, "%s, 0x%x, 0x%x"),
- path, args->flags, args->mode);
-#endif
+
return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode));
}
#endif
@@ -219,11 +200,6 @@
linux_lseek(struct thread *td, struct linux_lseek_args *args)
{
-#ifdef DEBUG
- if (ldebug(lseek))
- printf(ARGS(lseek, "%d, %ld, %d"),
- args->fdes, (long)args->off, args->whence);
-#endif
return (kern_lseek(td, args->fdes, args->off, args->whence));
}
@@ -234,11 +210,6 @@
int error;
off_t off;
-#ifdef DEBUG
- if (ldebug(llseek))
- printf(ARGS(llseek, "%d, %d:%d, %d"),
- args->fd, args->ohigh, args->olow, args->whence);
-#endif
off = (args->olow) | (((off_t) args->ohigh) << 32);
error = kern_lseek(td, args->fd, off, args->whence);
@@ -327,10 +298,6 @@
int buflen, error;
size_t retval;
-#ifdef DEBUG
- if (ldebug(getdents))
- printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count);
-#endif
buflen = min(args->count, MAXBSIZE);
buf = malloc(buflen, M_TEMP, M_WAITOK);
@@ -408,10 +375,6 @@
int buflen, error;
size_t retval;
-#ifdef DEBUG
- if (ldebug(getdents64))
- uprintf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count);
-#endif
buflen = min(args->count, MAXBSIZE);
buf = malloc(buflen, M_TEMP, M_WAITOK);
@@ -483,10 +446,6 @@
struct l_dirent *linux_dirent;
int buflen, error;
-#ifdef DEBUG
- if (ldebug(readdir))
- printf(ARGS(readdir, "%d, *"), args->fd);
-#endif
buflen = LINUX_RECLEN(LINUX_NAME_MAX);
buf = malloc(buflen, M_TEMP, M_WAITOK);
@@ -539,10 +498,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(access))
- printf(ARGS(access, "%s, %d"), path, args->amode);
-#endif
error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0,
args->amode);
LFREEPATH(path);
@@ -564,11 +519,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
-#ifdef DEBUG
- if (ldebug(faccessat))
- printf(ARGS(access, "%s, %d"), path, args->amode);
-#endif
-
error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0, args->amode);
LFREEPATH(path);
@@ -585,11 +535,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(unlink))
- printf(ARGS(unlink, "%s"), path);
-#endif
-
error = kern_funlinkat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0, 0);
if (error == EPERM) {
/* Introduce POSIX noncompliant behaviour of Linux */
@@ -617,11 +562,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
-#ifdef DEBUG
- if (ldebug(unlinkat))
- printf(ARGS(unlinkat, "%s"), path);
-#endif
-
if (args->flag & LINUX_AT_REMOVEDIR)
error = kern_frmdirat(td, dfd, path, FD_NONE, UIO_SYSSPACE, 0);
else
@@ -644,10 +584,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(chdir))
- printf(ARGS(chdir, "%s"), path);
-#endif
error = kern_chdir(td, path, UIO_SYSSPACE);
LFREEPATH(path);
return (error);
@@ -662,10 +598,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(chmod))
- printf(ARGS(chmod, "%s, %d"), path, args->mode);
-#endif
error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE,
args->mode, 0);
LFREEPATH(path);
@@ -682,11 +614,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
-#ifdef DEBUG
- if (ldebug(fchmodat))
- printf(ARGS(fchmodat, "%s, %d"), path, args->mode);
-#endif
-
error = kern_fchmodat(td, dfd, path, UIO_SYSSPACE, args->mode, 0);
LFREEPATH(path);
return (error);
@@ -701,10 +628,6 @@
LCONVPATHCREAT(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(mkdir))
- printf(ARGS(mkdir, "%s, %d"), path, args->mode);
-#endif
error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode);
LFREEPATH(path);
return (error);
@@ -720,10 +643,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHCREAT_AT(td, args->pathname, &path, dfd);
-#ifdef DEBUG
- if (ldebug(mkdirat))
- printf(ARGS(mkdirat, "%s, %d"), path, args->mode);
-#endif
error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode);
LFREEPATH(path);
return (error);
@@ -738,10 +657,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(rmdir))
- printf(ARGS(rmdir, "%s"), path);
-#endif
error = kern_frmdirat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0);
LFREEPATH(path);
return (error);
@@ -761,10 +676,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(rename))
- printf(ARGS(rename, "%s, %s"), from, to);
-#endif
error = kern_renameat(td, AT_FDCWD, from, AT_FDCWD, to, UIO_SYSSPACE);
LFREEPATH(from);
LFREEPATH(to);
@@ -788,10 +699,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(renameat))
- printf(ARGS(renameat, "%s, %s"), from, to);
-#endif
error = kern_renameat(td, olddfd, from, newdfd, to, UIO_SYSSPACE);
LFREEPATH(from);
LFREEPATH(to);
@@ -813,10 +720,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(symlink))
- printf(ARGS(symlink, "%s, %s"), path, to);
-#endif
error = kern_symlinkat(td, path, AT_FDCWD, to, UIO_SYSSPACE);
LFREEPATH(path);
LFREEPATH(to);
@@ -839,11 +742,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(symlinkat))
- printf(ARGS(symlinkat, "%s, %s"), path, to);
-#endif
-
error = kern_symlinkat(td, path, dfd, to, UIO_SYSSPACE);
LFREEPATH(path);
LFREEPATH(to);
@@ -859,11 +757,6 @@
LCONVPATHEXIST(td, args->name, &name);
-#ifdef DEBUG
- if (ldebug(readlink))
- printf(ARGS(readlink, "%s, %p, %d"), name, (void *)args->buf,
- args->count);
-#endif
error = kern_readlinkat(td, AT_FDCWD, name, UIO_SYSSPACE,
args->buf, UIO_USERSPACE, args->count);
LFREEPATH(name);
@@ -880,12 +773,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->path, &name, dfd);
-#ifdef DEBUG
- if (ldebug(readlinkat))
- printf(ARGS(readlinkat, "%s, %p, %d"), name, (void *)args->buf,
- args->bufsiz);
-#endif
-
error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf,
UIO_USERSPACE, args->bufsiz);
LFREEPATH(name);
@@ -900,11 +787,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(truncate))
- printf(ARGS(truncate, "%s, %ld"), path, (long)args->length);
-#endif
-
error = kern_truncate(td, path, UIO_SYSSPACE, args->length);
LFREEPATH(path);
return (error);
@@ -919,11 +801,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(truncate64))
- printf(ARGS(truncate64, "%s, %jd"), path, args->length);
-#endif
-
error = kern_truncate(td, path, UIO_SYSSPACE, args->length);
LFREEPATH(path);
return (error);
@@ -952,10 +829,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(link))
- printf(ARGS(link, "%s, %s"), path, to);
-#endif
error = kern_linkat(td, AT_FDCWD, AT_FDCWD, path, to, UIO_SYSSPACE,
FOLLOW);
LFREEPATH(path);
@@ -983,12 +856,6 @@
return (error);
}
-#ifdef DEBUG
- if (ldebug(linkat))
- printf(ARGS(linkat, "%i, %s, %i, %s, %i"), args->olddfd, path,
- args->newdfd, to, args->flag);
-#endif
-
follow = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? NOFOLLOW :
FOLLOW;
error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, follow);
@@ -1110,12 +977,6 @@
if (error != 0)
goto out;
-#ifdef DEBUG
- if (ldebug(mount))
- printf(ARGS(mount, "%s, %s, %s"),
- fstypename, mntfromname, mntonname);
-#endif
-
if (strcmp(fstypename, "ext2") == 0) {
strcpy(fstypename, "ext2fs");
} else if (strcmp(fstypename, "proc") == 0) {
@@ -1424,11 +1285,6 @@
linux_fcntl(struct thread *td, struct linux_fcntl_args *args)
{
-#ifdef DEBUG
- if (ldebug(fcntl))
- printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
-#endif
-
return (fcntl_common(td, args));
}
@@ -1441,11 +1297,6 @@
struct linux_fcntl_args fcntl_args;
int error;
-#ifdef DEBUG
- if (ldebug(fcntl64))
- printf(ARGS(fcntl64, "%d, %08x, *"), args->fd, args->cmd);
-#endif
-
switch (args->cmd) {
case LINUX_F_GETLK64:
error = copyin((void *)args->arg, &linux_flock,
@@ -1495,10 +1346,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(chown))
- printf(ARGS(chown, "%s, %d, %d"), path, args->uid, args->gid);
-#endif
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid,
args->gid, 0);
LFREEPATH(path);
@@ -1518,11 +1365,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
-#ifdef DEBUG
- if (ldebug(fchownat))
- printf(ARGS(fchownat, "%s, %d, %d"), path, args->uid, args->gid);
-#endif
-
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) == 0 ? 0 :
AT_SYMLINK_NOFOLLOW;
error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid,
@@ -1540,10 +1382,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(lchown))
- printf(ARGS(lchown, "%s, %d, %d"), path, args->uid, args->gid);
-#endif
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid,
args->gid, AT_SYMLINK_NOFOLLOW);
LFREEPATH(path);
@@ -1605,11 +1443,6 @@
int fildes[2];
int error;
-#ifdef DEBUG
- if (ldebug(pipe))
- printf(ARGS(pipe, "*"));
-#endif
-
error = kern_pipe(td, fildes, 0, NULL, NULL);
if (error != 0)
return (error);
@@ -1630,11 +1463,6 @@
int fildes[2];
int error, flags;
-#ifdef DEBUG
- if (ldebug(pipe2))
- printf(ARGS(pipe2, "*, %d"), args->flags);
-#endif
-
if ((args->flags & ~(LINUX_O_NONBLOCK | LINUX_O_CLOEXEC)) != 0)
return (EINVAL);
Index: sys/compat/linux/linux_fork.c
===================================================================
--- sys/compat/linux/linux_fork.c
+++ sys/compat/linux/linux_fork.c
@@ -74,11 +74,6 @@
struct proc *p2;
struct thread *td2;
-#ifdef DEBUG
- if (ldebug(fork))
- printf(ARGS(fork, ""));
-#endif
-
bzero(&fr, sizeof(fr));
fr.fr_flags = RFFDG | RFPROC | RFSTOPPED;
fr.fr_procp = &p2;
@@ -110,11 +105,6 @@
struct proc *p2;
struct thread *td2;
-#ifdef DEBUG
- if (ldebug(vfork))
- printf(ARGS(vfork, ""));
-#endif
-
bzero(&fr, sizeof(fr));
fr.fr_flags = RFFDG | RFPROC | RFMEM | RFPPWAIT | RFSTOPPED;
fr.fr_procp = &p2;
@@ -149,14 +139,6 @@
int exit_signal;
struct linux_emuldata *em;
-#ifdef DEBUG
- if (ldebug(clone)) {
- printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, "
- "child tid: %p"), (unsigned)args->flags,
- args->stack, args->parent_tidptr, args->child_tidptr);
- }
-#endif
-
exit_signal = args->flags & 0x000000ff;
if (LINUX_SIG_VALID(exit_signal)) {
exit_signal = linux_to_bsd_signal(exit_signal);
@@ -212,7 +194,7 @@
error = copyout(&p2->p_pid, args->parent_tidptr,
sizeof(p2->p_pid));
if (error)
- printf(LMSG("copyout failed!"));
+ linux_msg(td, "copyout p_pid failed!");
}
PROC_LOCK(p2);
@@ -240,13 +222,6 @@
sx_xunlock(&proctree_lock);
}
-#ifdef DEBUG
- if (ldebug(clone))
- printf(LMSG("clone: successful rfork to %d, "
- "stack %p sig = %d"), (int)p2->p_pid, args->stack,
- exit_signal);
-#endif
-
/*
* Make this runnable after we are finished with it.
*/
@@ -268,14 +243,6 @@
struct proc *p;
int error;
-#ifdef DEBUG
- if (ldebug(clone)) {
- printf(ARGS(clone, "thread: flags %x, stack %p, parent tid: %p, "
- "child tid: %p"), (unsigned)args->flags,
- args->stack, args->parent_tidptr, args->child_tidptr);
- }
-#endif
-
LINUX_CTR4(clone_thread, "thread(%d) flags %x ptid %p ctid %p",
td->td_tid, (unsigned)args->flags,
args->parent_tidptr, args->child_tidptr);
@@ -360,12 +327,6 @@
tidhash_add(newtd);
-#ifdef DEBUG
- if (ldebug(clone))
- printf(ARGS(clone, "successful clone to %d, stack %p"),
- (int)newtd->td_tid, args->stack);
-#endif
-
LINUX_CTR2(clone_thread, "thread(%d) successful clone to %d",
td->td_tid, newtd->td_tid);
@@ -373,7 +334,7 @@
error = copyout(&newtd->td_tid, args->parent_tidptr,
sizeof(newtd->td_tid));
if (error)
- printf(LMSG("clone_thread: copyout failed!"));
+ linux_msg(td, "clone_thread: copyout td_tid failed!");
}
/*
Index: sys/compat/linux/linux_getcwd.c
===================================================================
--- sys/compat/linux/linux_getcwd.c
+++ sys/compat/linux/linux_getcwd.c
@@ -65,11 +65,6 @@
char *path;
int error, lenused;
-#ifdef DEBUG
- if (ldebug(getcwd))
- printf(ARGS(getcwd, "%p, %ld"), args->buf, (long)args->bufsize);
-#endif
-
/*
* Linux returns ERANGE instead of EINVAL.
*/
Index: sys/compat/linux/linux_ioctl.c
===================================================================
--- sys/compat/linux/linux_ioctl.c
+++ sys/compat/linux/linux_ioctl.c
@@ -238,12 +238,7 @@
*/
bytespercyl = (off_t) sectorsize * fwheads * fwsectors;
fwcylinders = mediasize / bytespercyl;
-#if defined(DEBUG)
- linux_msg(td, "HDIO_GET_GEO: mediasize %jd, c/h/s %d/%d/%d, "
- "bpc %jd",
- (intmax_t)mediasize, fwcylinders, fwheads, fwsectors,
- (intmax_t)bytespercyl);
-#endif
+
if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO) {
struct linux_hd_geometry hdg;
@@ -404,19 +399,6 @@
{
int i;
-#ifdef DEBUG
- if (ldebug(ioctl)) {
- printf("LINUX: BSD termios structure (input):\n");
- printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n",
- bios->c_iflag, bios->c_oflag, bios->c_cflag, bios->c_lflag,
- bios->c_ispeed, bios->c_ospeed);
- printf("c_cc ");
- for (i=0; i<NCCS; i++)
- printf("%02x ", bios->c_cc[i]);
- printf("\n");
- }
-#endif
-
lios->c_iflag = 0;
if (bios->c_iflag & IGNBRK)
lios->c_iflag |= LINUX_IGNBRK;
@@ -525,19 +507,6 @@
lios->c_cc[i] = LINUX_POSIX_VDISABLE;
}
lios->c_line = 0;
-
-#ifdef DEBUG
- if (ldebug(ioctl)) {
- printf("LINUX: LINUX termios structure (output):\n");
- printf("i=%08x o=%08x c=%08x l=%08x line=%d\n",
- lios->c_iflag, lios->c_oflag, lios->c_cflag,
- lios->c_lflag, (int)lios->c_line);
- printf("c_cc ");
- for (i=0; i<LINUX_NCCS; i++)
- printf("%02x ", lios->c_cc[i]);
- printf("\n");
- }
-#endif
}
static void
@@ -545,19 +514,6 @@
{
int i;
-#ifdef DEBUG
- if (ldebug(ioctl)) {
- printf("LINUX: LINUX termios structure (input):\n");
- printf("i=%08x o=%08x c=%08x l=%08x line=%d\n",
- lios->c_iflag, lios->c_oflag, lios->c_cflag,
- lios->c_lflag, (int)lios->c_line);
- printf("c_cc ");
- for (i=0; i<LINUX_NCCS; i++)
- printf("%02x ", lios->c_cc[i]);
- printf("\n");
- }
-#endif
-
bios->c_iflag = 0;
if (lios->c_iflag & LINUX_IGNBRK)
bios->c_iflag |= IGNBRK;
@@ -667,19 +623,6 @@
bios->c_ispeed = bios->c_ospeed =
linux_to_bsd_speed(lios->c_cflag & LINUX_CBAUD, sptab);
-
-#ifdef DEBUG
- if (ldebug(ioctl)) {
- printf("LINUX: BSD termios structure (output):\n");
- printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n",
- bios->c_iflag, bios->c_oflag, bios->c_cflag, bios->c_lflag,
- bios->c_ispeed, bios->c_ospeed);
- printf("c_cc ");
- for (i=0; i<NCCS; i++)
- printf("%02x ", bios->c_cc[i]);
- printf("\n");
- }
-#endif
}
static void
@@ -2367,10 +2310,6 @@
case LINUX_SIOCSPGRP:
case LINUX_SIOCGIFCOUNT:
/* these ioctls don't take an interface name */
-#ifdef DEBUG
- printf("%s(): ioctl %d\n", __func__,
- args->cmd & 0xffff);
-#endif
break;
case LINUX_SIOCGIFFLAGS:
@@ -2392,10 +2331,6 @@
error = copyin((void *)args->arg, lifname, LINUX_IFNAMSIZ);
if (error != 0)
return (error);
-#ifdef DEBUG
- printf("%s(): ioctl %d on %.*s\n", __func__,
- args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname);
-#endif
memset(ifname, 0, sizeof(ifname));
ifp = ifname_linux_to_bsd(td, lifname, ifname);
if (ifp == NULL)
@@ -2409,10 +2344,6 @@
error = copyout(ifname, (void *)args->arg, IFNAMSIZ);
if (error != 0)
return (error);
-#ifdef DEBUG
- printf("%s(): %s translated to %s\n", __func__,
- lifname, ifname);
-#endif
break;
default:
@@ -2555,9 +2486,6 @@
/* restore the original interface name */
copyout(lifname, (void *)args->arg, LINUX_IFNAMSIZ);
-#ifdef DEBUG
- printf("%s(): returning %d\n", __func__, error);
-#endif
return (error);
}
@@ -3613,12 +3541,6 @@
struct linux_ioctl_handler_element *he;
int error, cmd;
-#ifdef DEBUG
- if (ldebug(ioctl))
- printf(ARGS(ioctl, "%d, %04lx, *"), args->fd,
- (unsigned long)args->cmd);
-#endif
-
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
if (error != 0)
return (error);
Index: sys/compat/linux/linux_misc.h
===================================================================
--- sys/compat/linux/linux_misc.h
+++ sys/compat/linux/linux_misc.h
@@ -156,8 +156,6 @@
int linux_set_upcall_kse(struct thread *td, register_t stack);
int linux_set_cloned_tls(struct thread *td, void *desc);
struct thread *linux_tdfind(struct thread *, lwpid_t, pid_t);
-
-int linux_sysctl_debug(SYSCTL_HANDLER_ARGS);
#endif
#endif /* _LINUX_MISC_H_ */
Index: sys/compat/linux/linux_misc.c
===================================================================
--- sys/compat/linux/linux_misc.c
+++ sys/compat/linux/linux_misc.c
@@ -200,10 +200,6 @@
u_int secs;
int error;
-#ifdef DEBUG
- if (ldebug(alarm))
- printf(ARGS(alarm, "%u"), args->secs);
-#endif
secs = args->secs;
/*
* Linux alarm() is always successful. Limit secs to INT32_MAX / 2
@@ -235,10 +231,6 @@
struct vmspace *vm = td->td_proc->p_vmspace;
uintptr_t new, old;
-#ifdef DEBUG
- if (ldebug(brk))
- printf(ARGS(brk, "%p"), (void *)(uintptr_t)args->dsend);
-#endif
old = (uintptr_t)vm->vm_daddr + ctob(vm->vm_dsize);
new = (uintptr_t)args->dsend;
if ((caddr_t)new > vm->vm_daddr && !kern_break(td, &new))
@@ -271,11 +263,6 @@
LCONVPATHEXIST(td, args->library, &library);
-#ifdef DEBUG
- if (ldebug(uselib))
- printf(ARGS(uselib, "%s"), library);
-#endif
-
a_out = NULL;
vp = NULL;
locked = false;
@@ -416,9 +403,6 @@
* (what a waste).
*/
if (file_offset & PAGE_MASK) {
-#ifdef DEBUG
- printf("uselib: Non page aligned binary %lu\n", file_offset);
-#endif
/* Map text+data read/write/execute */
/* a_entry is the load address and is page aligned */
@@ -441,9 +425,6 @@
goto cleanup;
}
} else {
-#ifdef DEBUG
- printf("uselib: Page aligned binary %lu\n", file_offset);
-#endif
/*
* for QMAGIC, a_entry is 20 bytes beyond the load address
* to skip the executable header
@@ -470,10 +451,7 @@
vm_map_unlock(map);
textset = false;
}
-#ifdef DEBUG
- printf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long *)vmaddr)[0],
- ((long *)vmaddr)[1]);
-#endif
+
if (bss_size != 0) {
/* Calculate BSS start address */
vmaddr = trunc_page(a_out->a_entry) + a_out->a_text +
@@ -516,13 +494,6 @@
struct timeval tv0, tv1, utv, *tvp;
int error;
-#ifdef DEBUG
- if (ldebug(select))
- printf(ARGS(select, "%d, %p, %p, %p, %p"), args->nfds,
- (void *)args->readfds, (void *)args->writefds,
- (void *)args->exceptfds, (void *)args->timeout);
-#endif
-
/*
* Store current time for computation of the amount of
* time left.
@@ -532,11 +503,6 @@
goto select_out;
utv.tv_sec = ltv.tv_sec;
utv.tv_usec = ltv.tv_usec;
-#ifdef DEBUG
- if (ldebug(select))
- printf(LMSG("incoming timeout (%jd/%ld)"),
- (intmax_t)utv.tv_sec, utv.tv_usec);
-#endif
if (itimerfix(&utv)) {
/*
@@ -559,11 +525,6 @@
error = kern_select(td, args->nfds, args->readfds, args->writefds,
args->exceptfds, tvp, LINUX_NFDBITS);
-
-#ifdef DEBUG
- if (ldebug(select))
- printf(LMSG("real select returns %d"), error);
-#endif
if (error)
goto select_out;
@@ -582,11 +543,6 @@
timevalclear(&utv);
} else
timevalclear(&utv);
-#ifdef DEBUG
- if (ldebug(select))
- printf(LMSG("outgoing timeout (%jd/%ld)"),
- (intmax_t)utv.tv_sec, utv.tv_usec);
-#endif
ltv.tv_sec = utv.tv_sec;
ltv.tv_usec = utv.tv_usec;
if ((error = copyout(<v, args->timeout, sizeof(ltv))))
@@ -594,10 +550,6 @@
}
select_out:
-#ifdef DEBUG
- if (ldebug(select))
- printf(LMSG("select_out -> %d"), error);
-#endif
return (error);
}
#endif
@@ -609,15 +561,6 @@
size_t len;
int error = 0;
-#ifdef DEBUG
- if (ldebug(mremap))
- printf(ARGS(mremap, "%p, %08lx, %08lx, %08lx"),
- (void *)(uintptr_t)args->addr,
- (unsigned long)args->old_len,
- (unsigned long)args->new_len,
- (unsigned long)args->flags);
-#endif
-
if (args->flags & ~(LINUX_MREMAP_FIXED | LINUX_MREMAP_MAYMOVE)) {
td->td_retval[0] = 0;
return (EINVAL);
@@ -670,11 +613,6 @@
l_time_t tm;
int error;
-#ifdef DEBUG
- if (ldebug(time))
- printf(ARGS(time, "*"));
-#endif
-
microtime(&tv);
tm = tv.tv_sec;
if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm))))
@@ -713,11 +651,6 @@
struct proc *p;
int error;
-#ifdef DEBUG
- if (ldebug(times))
- printf(ARGS(times, "*"));
-#endif
-
if (args->buf != NULL) {
p = td->td_proc;
PROC_LOCK(p);
@@ -750,11 +683,6 @@
char osrelease[LINUX_MAX_UTSNAME];
char osversion[LINUX_MAX_UTSNAME];
-#ifdef DEBUG
- if (ldebug(newuname))
- printf(ARGS(newuname, "*"));
-#endif
-
linux_get_osname(td, osname);
linux_get_osrelease(td, osrelease);
linux_get_osversion(td, osversion);
@@ -786,11 +714,6 @@
LCONVPATHEXIST(td, args->fname, &fname);
-#ifdef DEBUG
- if (ldebug(utime))
- printf(ARGS(utime, "%s, *"), fname);
-#endif
-
if (args->times) {
if ((error = copyin(args->times, &lut, sizeof lut))) {
LFREEPATH(fname);
@@ -822,11 +745,6 @@
LCONVPATHEXIST(td, args->fname, &fname);
-#ifdef DEBUG
- if (ldebug(utimes))
- printf(ARGS(utimes, "%s, *"), fname);
-#endif
-
if (args->tptr != NULL) {
if ((error = copyin(args->tptr, ltv, sizeof ltv))) {
LFREEPATH(fname);
@@ -867,11 +785,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
-#ifdef DEBUG
- if (ldebug(utimensat))
- printf(ARGS(utimensat, "%d, *"), dfd);
-#endif
-
if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW)
return (EINVAL);
@@ -951,11 +864,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->filename, &fname, dfd);
-#ifdef DEBUG
- if (ldebug(futimesat))
- printf(ARGS(futimesat, "%s, *"), fname);
-#endif
-
if (args->utimes != NULL) {
if ((error = copyin(args->utimes, ltv, sizeof ltv))) {
LFREEPATH(fname);
@@ -1006,12 +914,6 @@
{
struct linux_wait4_args wait4_args;
-#ifdef DEBUG
- if (ldebug(waitpid))
- printf(ARGS(waitpid, "%d, %p, %d"),
- args->pid, (void *)args->status, args->options);
-#endif
-
wait4_args.pid = args->pid;
wait4_args.status = args->status;
wait4_args.options = args->options;
@@ -1027,12 +929,6 @@
int error, options;
struct rusage ru, *rup;
-#ifdef DEBUG
- if (ldebug(wait4))
- printf(ARGS(wait4, "%d, %p, %d, %p"),
- args->pid, (void *)args->status, args->options,
- (void *)args->rusage);
-#endif
if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG |
LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL))
return (EINVAL);
@@ -1122,12 +1018,6 @@
LCONVPATHCREAT(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(mknod))
- printf(ARGS(mknod, "%s, %d, %ju"), path, args->mode,
- (uintmax_t)args->dev);
-#endif
-
switch (args->mode & S_IFMT) {
case S_IFIFO:
case S_IFSOCK:
@@ -1173,11 +1063,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHCREAT_AT(td, args->filename, &path, dfd);
-#ifdef DEBUG
- if (ldebug(mknodat))
- printf(ARGS(mknodat, "%s, %d, %d"), path, args->mode, args->dev);
-#endif
-
switch (args->mode & S_IFMT) {
case S_IFIFO:
case S_IFSOCK:
@@ -1222,11 +1107,6 @@
struct proc *p = td->td_proc;
uint32_t old;
-#ifdef DEBUG
- if (ldebug(personality))
- printf(ARGS(personality, "%u"), args->per);
-#endif
-
PROC_LOCK(p);
pem = pem_find(p);
old = pem->persona;
@@ -1256,12 +1136,6 @@
struct l_itimerval ls;
struct itimerval aitv, oitv;
-#ifdef DEBUG
- if (ldebug(setitimer))
- printf(ARGS(setitimer, "%p, %p"),
- (void *)uap->itv, (void *)uap->oitv);
-#endif
-
if (uap->itv == NULL) {
uap->itv = uap->oitv;
return (linux_getitimer(td, (struct linux_getitimer_args *)uap));
@@ -1271,14 +1145,6 @@
if (error != 0)
return (error);
B2L_ITIMERVAL(&aitv, &ls);
-#ifdef DEBUG
- if (ldebug(setitimer)) {
- printf("setitimer: value: sec: %jd, usec: %ld\n",
- (intmax_t)aitv.it_value.tv_sec, aitv.it_value.tv_usec);
- printf("setitimer: interval: sec: %jd, usec: %ld\n",
- (intmax_t)aitv.it_interval.tv_sec, aitv.it_interval.tv_usec);
- }
-#endif
error = kern_setitimer(td, uap->which, &aitv, &oitv);
if (error != 0 || uap->oitv == NULL)
return (error);
@@ -1294,10 +1160,6 @@
struct l_itimerval ls;
struct itimerval aitv;
-#ifdef DEBUG
- if (ldebug(getitimer))
- printf(ARGS(getitimer, "%p"), (void *)uap->itv);
-#endif
error = kern_getitimer(td, uap->which, &aitv);
if (error != 0)
return (error);
@@ -1426,12 +1288,6 @@
u_int which;
int error;
-#ifdef DEBUG
- if (ldebug(setrlimit))
- printf(ARGS(setrlimit, "%d, %p"),
- args->resource, (void *)args->rlim);
-#endif
-
if (args->resource >= LINUX_RLIM_NLIMITS)
return (EINVAL);
@@ -1456,12 +1312,6 @@
struct rlimit bsd_rlim;
u_int which;
-#ifdef DEBUG
- if (ldebug(old_getrlimit))
- printf(ARGS(old_getrlimit, "%d, %p"),
- args->resource, (void *)args->rlim);
-#endif
-
if (args->resource >= LINUX_RLIM_NLIMITS)
return (EINVAL);
@@ -1497,12 +1347,6 @@
struct rlimit bsd_rlim;
u_int which;
-#ifdef DEBUG
- if (ldebug(getrlimit))
- printf(ARGS(getrlimit, "%d, %p"),
- args->resource, (void *)args->rlim);
-#endif
-
if (args->resource >= LINUX_RLIM_NLIMITS)
return (EINVAL);
@@ -1525,12 +1369,6 @@
struct thread *tdt;
int error, policy;
-#ifdef DEBUG
- if (ldebug(sched_setscheduler))
- printf(ARGS(sched_setscheduler, "%d, %d, %p"),
- args->pid, args->policy, (const void *)args->param);
-#endif
-
switch (args->policy) {
case LINUX_SCHED_OTHER:
policy = SCHED_OTHER;
@@ -1565,11 +1403,6 @@
struct thread *tdt;
int error, policy;
-#ifdef DEBUG
- if (ldebug(sched_getscheduler))
- printf(ARGS(sched_getscheduler, "%d"), args->pid);
-#endif
-
tdt = linux_tdfind(td, args->pid, -1);
if (tdt == NULL)
return (ESRCH);
@@ -1597,11 +1430,6 @@
{
struct sched_get_priority_max_args bsd;
-#ifdef DEBUG
- if (ldebug(sched_get_priority_max))
- printf(ARGS(sched_get_priority_max, "%d"), args->policy);
-#endif
-
switch (args->policy) {
case LINUX_SCHED_OTHER:
bsd.policy = SCHED_OTHER;
@@ -1624,11 +1452,6 @@
{
struct sched_get_priority_min_args bsd;
-#ifdef DEBUG
- if (ldebug(sched_get_priority_min))
- printf(ARGS(sched_get_priority_min, "%d"), args->policy);
-#endif
-
switch (args->policy) {
case LINUX_SCHED_OTHER:
bsd.policy = SCHED_OTHER;
@@ -1661,11 +1484,6 @@
{
struct reboot_args bsd_args;
-#ifdef DEBUG
- if (ldebug(reboot))
- printf(ARGS(reboot, "0x%x"), args->cmd);
-#endif
-
if (args->magic1 != REBOOT_MAGIC1)
return (EINVAL);
@@ -1714,10 +1532,6 @@
linux_getpid(struct thread *td, struct linux_getpid_args *args)
{
-#ifdef DEBUG
- if (ldebug(getpid))
- printf(ARGS(getpid, ""));
-#endif
td->td_retval[0] = td->td_proc->p_pid;
return (0);
@@ -1728,11 +1542,6 @@
{
struct linux_emuldata *em;
-#ifdef DEBUG
- if (ldebug(gettid))
- printf(ARGS(gettid, ""));
-#endif
-
em = em_find(td);
KASSERT(em != NULL, ("gettid: emuldata not found.\n"));
@@ -1746,11 +1555,6 @@
linux_getppid(struct thread *td, struct linux_getppid_args *args)
{
-#ifdef DEBUG
- if (ldebug(getppid))
- printf(ARGS(getppid, ""));
-#endif
-
td->td_retval[0] = kern_getppid(td);
return (0);
}
@@ -1759,11 +1563,6 @@
linux_getgid(struct thread *td, struct linux_getgid_args *args)
{
-#ifdef DEBUG
- if (ldebug(getgid))
- printf(ARGS(getgid, ""));
-#endif
-
td->td_retval[0] = td->td_ucred->cr_rgid;
return (0);
}
@@ -1772,11 +1571,6 @@
linux_getuid(struct thread *td, struct linux_getuid_args *args)
{
-#ifdef DEBUG
- if (ldebug(getuid))
- printf(ARGS(getuid, ""));
-#endif
-
td->td_retval[0] = td->td_ucred->cr_ruid;
return (0);
}
@@ -1787,11 +1581,6 @@
{
struct getsid_args bsd;
-#ifdef DEBUG
- if (ldebug(getsid))
- printf(ARGS(getsid, "%i"), args->pid);
-#endif
-
bsd.pid = args->pid;
return (sys_getsid(td, &bsd));
}
@@ -1809,11 +1598,6 @@
struct getpriority_args bsd_args;
int error;
-#ifdef DEBUG
- if (ldebug(getpriority))
- printf(ARGS(getpriority, "%i, %i"), args->which, args->who);
-#endif
-
bsd_args.which = args->which;
bsd_args.who = args->who;
error = sys_getpriority(td, &bsd_args);
@@ -1826,11 +1610,6 @@
{
int name[2];
-#ifdef DEBUG
- if (ldebug(sethostname))
- printf(ARGS(sethostname, "*, %i"), args->len);
-#endif
-
name[0] = CTL_KERN;
name[1] = KERN_HOSTNAME;
return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname,
@@ -1842,11 +1621,6 @@
{
int name[2];
-#ifdef DEBUG
- if (ldebug(setdomainname))
- printf(ARGS(setdomainname, "*, %i"), args->len);
-#endif
-
name[0] = CTL_KERN;
name[1] = KERN_NISDOMAINNAME;
return (userland_sysctl(td, name, 2, 0, 0, 0, args->name,
@@ -1857,11 +1631,6 @@
linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
{
-#ifdef DEBUG
- if (ldebug(exit_group))
- printf(ARGS(exit_group, "%i"), args->error_code);
-#endif
-
LINUX_CTR2(exit_group, "thread(%d) (%d)", td->td_tid,
args->error_code);
@@ -1912,11 +1681,6 @@
u32s = 2;
break;
default:
-#ifdef DEBUG
- if (ldebug(capget))
- printf(LMSG("invalid capget capability version 0x%x"),
- luch.version);
-#endif
luch.version = _LINUX_CAPABILITY_VERSION_1;
error = copyout(&luch, uap->hdrp, sizeof(luch));
if (error)
@@ -1964,11 +1728,6 @@
u32s = 2;
break;
default:
-#ifdef DEBUG
- if (ldebug(capset))
- printf(LMSG("invalid capset capability version 0x%x"),
- luch.version);
-#endif
luch.version = _LINUX_CAPABILITY_VERSION_1;
error = copyout(&luch, uap->hdrp, sizeof(luch));
if (error)
@@ -2007,13 +1766,6 @@
char comm[LINUX_MAX_COMM_LEN];
int pdeath_signal;
-#ifdef DEBUG
- if (ldebug(prctl))
- printf(ARGS(prctl, "%d, %ju, %ju, %ju, %ju"), args->option,
- (uintmax_t)args->arg2, (uintmax_t)args->arg3,
- (uintmax_t)args->arg4, (uintmax_t)args->arg5);
-#endif
-
switch (args->option) {
case LINUX_PR_SET_PDEATHSIG:
if (!LINUX_SIG_VALID(args->arg2))
@@ -2099,11 +1851,6 @@
struct thread *tdt;
int error;
-#ifdef DEBUG
- if (ldebug(sched_setparam))
- printf(ARGS(sched_setparam, "%d, *"), uap->pid);
-#endif
-
error = copyin(uap->param, &sched_param, sizeof(sched_param));
if (error)
return (error);
@@ -2125,11 +1872,6 @@
struct thread *tdt;
int error;
-#ifdef DEBUG
- if (ldebug(sched_getparam))
- printf(ARGS(sched_getparam, "%d, *"), uap->pid);
-#endif
-
tdt = linux_tdfind(td, uap->pid, -1);
if (tdt == NULL)
return (ESRCH);
@@ -2152,11 +1894,6 @@
int error;
struct thread *tdt;
-#ifdef DEBUG
- if (ldebug(sched_getaffinity))
- printf(ARGS(sched_getaffinity, "%d, %d, *"), args->pid,
- args->len);
-#endif
if (args->len < sizeof(cpuset_t))
return (EINVAL);
@@ -2183,11 +1920,6 @@
{
struct thread *tdt;
-#ifdef DEBUG
- if (ldebug(sched_setaffinity))
- printf(ARGS(sched_setaffinity, "%d, %d, *"), args->pid,
- args->len);
-#endif
if (args->len < sizeof(cpuset_t))
return (EINVAL);
@@ -2216,12 +1948,6 @@
int flags;
int error;
-#ifdef DEBUG
- if (ldebug(prlimit64))
- printf(ARGS(prlimit64, "%d, %d, %p, %p"), args->pid,
- args->resource, (void *)args->new, (void *)args->old);
-#endif
-
if (args->resource >= LINUX_RLIM_NLIMITS)
return (EINVAL);
@@ -2408,70 +2134,6 @@
return (error);
}
-#if defined(DEBUG) || defined(KTR)
-/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */
-
-#ifdef COMPAT_LINUX32
-#define L_MAXSYSCALL LINUX32_SYS_MAXSYSCALL
-#else
-#define L_MAXSYSCALL LINUX_SYS_MAXSYSCALL
-#endif
-
-u_char linux_debug_map[howmany(L_MAXSYSCALL, sizeof(u_char))];
-
-static int
-linux_debug(int syscall, int toggle, int global)
-{
-
- if (global) {
- char c = toggle ? 0 : 0xff;
-
- memset(linux_debug_map, c, sizeof(linux_debug_map));
- return (0);
- }
- if (syscall < 0 || syscall >= L_MAXSYSCALL)
- return (EINVAL);
- if (toggle)
- clrbit(linux_debug_map, syscall);
- else
- setbit(linux_debug_map, syscall);
- return (0);
-}
-#undef L_MAXSYSCALL
-
-/*
- * Usage: sysctl linux.debug=<syscall_nr>.<0/1>
- *
- * E.g.: sysctl linux.debug=21.0
- *
- * As a special case, syscall "all" will apply to all syscalls globally.
- */
-#define LINUX_MAX_DEBUGSTR 16
-int
-linux_sysctl_debug(SYSCTL_HANDLER_ARGS)
-{
- char value[LINUX_MAX_DEBUGSTR], *p;
- int error, sysc, toggle;
- int global = 0;
-
- value[0] = '\0';
- error = sysctl_handle_string(oidp, value, LINUX_MAX_DEBUGSTR, req);
- if (error || req->newptr == NULL)
- return (error);
- for (p = value; *p != '\0' && *p != '.'; p++);
- if (*p == '\0')
- return (EINVAL);
- *p++ = '\0';
- sysc = strtol(value, NULL, 0);
- toggle = strtol(p, NULL, 0);
- if (strcmp(value, "all") == 0)
- global = 1;
- error = linux_debug(sysc, toggle, global);
- return (error);
-}
-
-#endif /* DEBUG || KTR */
-
int
linux_sched_rr_get_interval(struct thread *td,
struct linux_sched_rr_get_interval_args *uap)
Index: sys/compat/linux/linux_signal.c
===================================================================
--- sys/compat/linux/linux_signal.c
+++ sys/compat/linux/linux_signal.c
@@ -146,12 +146,6 @@
l_sigaction_t nsa, osa;
int error;
-#ifdef DEBUG
- if (ldebug(signal))
- printf(ARGS(signal, "%d, %p"),
- args->sig, (void *)(uintptr_t)args->handler);
-#endif
-
nsa.lsa_handler = args->handler;
nsa.lsa_flags = LINUX_SA_ONESHOT | LINUX_SA_NOMASK;
LINUX_SIGEMPTYSET(nsa.lsa_mask);
@@ -169,13 +163,6 @@
l_sigaction_t nsa, osa;
int error;
-#ifdef DEBUG
- if (ldebug(rt_sigaction))
- printf(ARGS(rt_sigaction, "%ld, %p, %p, %ld"),
- (long)args->sig, (void *)args->act,
- (void *)args->oact, (long)args->sigsetsize);
-#endif
-
if (args->sigsetsize != sizeof(l_sigset_t))
return (EINVAL);
@@ -239,11 +226,6 @@
l_sigset_t set, oset;
int error;
-#ifdef DEBUG
- if (ldebug(sigprocmask))
- printf(ARGS(sigprocmask, "%d, *, *"), args->how);
-#endif
-
if (args->mask != NULL) {
error = copyin(args->mask, &mask, sizeof(l_osigset_t));
if (error)
@@ -271,13 +253,6 @@
l_sigset_t set, oset;
int error;
-#ifdef DEBUG
- if (ldebug(rt_sigprocmask))
- printf(ARGS(rt_sigprocmask, "%d, %p, %p, %ld"),
- args->how, (void *)args->mask,
- (void *)args->omask, (long)args->sigsetsize);
-#endif
-
if (args->sigsetsize != sizeof(l_sigset_t))
return (EINVAL);
@@ -305,11 +280,6 @@
struct proc *p = td->td_proc;
l_sigset_t mask;
-#ifdef DEBUG
- if (ldebug(sgetmask))
- printf(ARGS(sgetmask, ""));
-#endif
-
PROC_LOCK(p);
bsd_to_linux_sigset(&td->td_sigmask, &mask);
PROC_UNLOCK(p);
@@ -324,11 +294,6 @@
l_sigset_t lset;
sigset_t bset;
-#ifdef DEBUG
- if (ldebug(ssetmask))
- printf(ARGS(ssetmask, "%08lx"), (unsigned long)args->mask);
-#endif
-
PROC_LOCK(p);
bsd_to_linux_sigset(&td->td_sigmask, &lset);
td->td_retval[0] = lset.__mask;
@@ -350,11 +315,6 @@
l_sigset_t lset;
l_osigset_t mask;
-#ifdef DEBUG
- if (ldebug(sigpending))
- printf(ARGS(sigpending, "*"));
-#endif
-
PROC_LOCK(p);
bset = p->p_siglist;
SIGSETOR(bset, td->td_siglist);
@@ -380,11 +340,6 @@
return (EINVAL);
/* NOT REACHED */
-#ifdef DEBUG
- if (ldebug(rt_sigpending))
- printf(ARGS(rt_sigpending, "*"));
-#endif
-
PROC_LOCK(p);
bset = p->p_siglist;
SIGSETOR(bset, td->td_siglist);
@@ -410,10 +365,6 @@
l_siginfo_t linfo;
ksiginfo_t info;
-#ifdef DEBUG
- if (ldebug(rt_sigtimedwait))
- printf(ARGS(rt_sigtimedwait, "*"));
-#endif
if (args->sigsetsize != sizeof(l_sigset_t))
return (EINVAL);
@@ -425,12 +376,6 @@
if (args->timeout) {
if ((error = copyin(args->timeout, <v, sizeof(ltv))))
return (error);
-#ifdef DEBUG
- if (ldebug(rt_sigtimedwait))
- printf(LMSG("linux_rt_sigtimedwait: "
- "incoming timeout (%jd/%jd)\n"),
- (intmax_t)ltv.tv_sec, (intmax_t)ltv.tv_usec);
-#endif
tv.tv_sec = (long)ltv.tv_sec;
tv.tv_usec = (suseconds_t)ltv.tv_usec;
if (itimerfix(&tv)) {
@@ -446,22 +391,11 @@
}
if (tv.tv_sec < 0)
timevalclear(&tv);
-#ifdef DEBUG
- if (ldebug(rt_sigtimedwait))
- printf(LMSG("linux_rt_sigtimedwait: "
- "converted timeout (%jd/%ld)\n"),
- (intmax_t)tv.tv_sec, tv.tv_usec);
-#endif
}
TIMEVAL_TO_TIMESPEC(&tv, &ts);
tsa = &ts;
}
error = kern_sigtimedwait(td, bset, &info, tsa);
-#ifdef DEBUG
- if (ldebug(rt_sigtimedwait))
- printf(LMSG("linux_rt_sigtimedwait: "
- "sigtimedwait returning (%d)\n"), error);
-#endif
if (error)
return (error);
@@ -486,11 +420,6 @@
int signum;
} */ tmp;
-#ifdef DEBUG
- if (ldebug(kill))
- printf(ARGS(kill, "%d, %d"), args->pid, args->signum);
-#endif
-
/*
* Allow signal 0 as a means to check for privileges
*/
@@ -535,12 +464,6 @@
ksiginfo_t ksi;
int sig;
-#ifdef DEBUG
- if (ldebug(tgkill))
- printf(ARGS(tgkill, "%d, %d, %d"),
- args->tgid, args->pid, args->sig);
-#endif
-
if (args->pid <= 0 || args->tgid <=0)
return (EINVAL);
@@ -578,10 +501,6 @@
ksiginfo_t ksi;
int sig;
-#ifdef DEBUG
- if (ldebug(tkill))
- printf(ARGS(tkill, "%i, %i"), args->tid, args->sig);
-#endif
if (args->tid <= 0)
return (EINVAL);
Index: sys/compat/linux/linux_stats.c
===================================================================
--- sys/compat/linux/linux_stats.c
+++ sys/compat/linux/linux_stats.c
@@ -185,11 +185,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(newstat))
- printf(ARGS(newstat, "%s, *"), path);
-#endif
-
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
LFREEPATH(path);
if (error)
@@ -206,11 +201,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(newlstat))
- printf(ARGS(newlstat, "%s, *"), path);
-#endif
-
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &sb);
LFREEPATH(path);
if (error)
@@ -225,11 +215,6 @@
struct stat buf;
int error;
-#ifdef DEBUG
- if (ldebug(newfstat))
- printf(ARGS(newfstat, "%d, *"), args->fd);
-#endif
-
error = kern_fstat(td, args->fd, &buf);
translate_fd_major_minor(td, args->fd, &buf);
if (!error)
@@ -276,10 +261,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(stat))
- printf(ARGS(stat, "%s, *"), path);
-#endif
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
if (error) {
LFREEPATH(path);
@@ -298,10 +279,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(lstat))
- printf(ARGS(lstat, "%s, *"), path);
-#endif
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &buf);
if (error) {
LFREEPATH(path);
@@ -411,10 +388,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(statfs))
- printf(ARGS(statfs, "%s, *"), path);
-#endif
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
LFREEPATH(path);
@@ -459,10 +432,6 @@
LCONVPATHEXIST(td, args->path, &path);
-#ifdef DEBUG
- if (ldebug(statfs64))
- printf(ARGS(statfs64, "%s, *"), path);
-#endif
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
LFREEPATH(path);
@@ -481,10 +450,6 @@
struct statfs *bsd_statfs;
int error;
-#ifdef DEBUG
- if (ldebug(fstatfs64))
- printf(ARGS(fstatfs64, "%d, *"), args->fd);
-#endif
if (args->bufsize != sizeof(struct l_statfs64))
return (EINVAL);
@@ -506,10 +471,6 @@
struct statfs *bsd_statfs;
int error;
-#ifdef DEBUG
- if (ldebug(fstatfs))
- printf(ARGS(fstatfs, "%d, *"), args->fd);
-#endif
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
error = kern_fstatfs(td, args->fd, bsd_statfs);
if (error == 0)
@@ -532,10 +493,6 @@
int
linux_ustat(struct thread *td, struct linux_ustat_args *args)
{
-#ifdef DEBUG
- if (ldebug(ustat))
- printf(ARGS(ustat, "%ju, *"), (uintmax_t)args->dev);
-#endif
return (EOPNOTSUPP);
}
@@ -586,11 +543,6 @@
LCONVPATHEXIST(td, args->filename, &filename);
-#ifdef DEBUG
- if (ldebug(stat64))
- printf(ARGS(stat64, "%s, *"), filename);
-#endif
-
error = linux_kern_stat(td, filename, UIO_SYSSPACE, &buf);
LFREEPATH(filename);
if (error)
@@ -607,11 +559,6 @@
LCONVPATHEXIST(td, args->filename, &filename);
-#ifdef DEBUG
- if (ldebug(lstat64))
- printf(ARGS(lstat64, "%s, *"), args->filename);
-#endif
-
error = linux_kern_lstat(td, filename, UIO_SYSSPACE, &sb);
LFREEPATH(filename);
if (error)
@@ -625,11 +572,6 @@
struct stat buf;
int error;
-#ifdef DEBUG
- if (ldebug(fstat64))
- printf(ARGS(fstat64, "%d, *"), args->fd);
-#endif
-
error = kern_fstat(td, args->fd, &buf);
translate_fd_major_minor(td, args->fd, &buf);
if (!error)
@@ -653,11 +595,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
-#ifdef DEBUG
- if (ldebug(fstatat64))
- printf(ARGS(fstatat64, "%i, %s, %i"), args->dfd, path, args->flag);
-#endif
-
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
if (!error)
error = stat64_copyout(&buf, args->statbuf);
@@ -683,11 +620,6 @@
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
-#ifdef DEBUG
- if (ldebug(newfstatat))
- printf(ARGS(newfstatat, "%i, %s, %i"), args->dfd, path, args->flag);
-#endif
-
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
if (error == 0)
error = newstat_copyout(&buf, args->statbuf);
Index: sys/i386/linux/linux.h
===================================================================
--- sys/i386/linux/linux.h
+++ sys/i386/linux/linux.h
@@ -37,15 +37,6 @@
#define LINUX_LEGACY_SYSCALLS
-/*
- * debugging support
- */
-extern u_char linux_debug_map[];
-#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
-#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
- (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator
#define LINUX_SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE)
Index: sys/i386/linux/linux_machdep.c
===================================================================
--- sys/i386/linux/linux_machdep.c
+++ sys/i386/linux/linux_machdep.c
@@ -106,11 +106,6 @@
LCONVPATHEXIST(td, args->path, &newpath);
-#ifdef DEBUG
- if (ldebug(execve))
- printf(ARGS(execve, "%s"), newpath);
-#endif
-
error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE,
args->argp, args->envp);
free(newpath, M_TEMP);
@@ -256,11 +251,6 @@
struct linux_select_args newsel;
int error;
-#ifdef DEBUG
- if (ldebug(old_select))
- printf(ARGS(old_select, "%p"), args->ptr);
-#endif
-
error = copyin(args->ptr, &linux_args, sizeof(linux_args));
if (error)
return (error);
@@ -283,7 +273,7 @@
error = copyin(desc, &info, sizeof(struct l_user_desc));
if (error) {
- printf(LMSG("copyin failed!"));
+ linux_msg(td, "set_cloned_tls copyin failed!");
} else {
idx = info.entry_number;
@@ -292,7 +282,7 @@
* in the set_thread_area() syscall
*/
if (idx != 6 && idx != 3) {
- printf(LMSG("resetting idx!"));
+ linux_msg(td, "set_cloned_tls resetting idx!");
idx = 3;
}
@@ -302,25 +292,13 @@
info.entry_number = 3;
error = copyout(&info, desc, sizeof(struct l_user_desc));
if (error)
- printf(LMSG("copyout failed!"));
+ linux_msg(td, "set_cloned_tls copyout failed!");
}
a[0] = LINUX_LDT_entry_a(&info);
a[1] = LINUX_LDT_entry_b(&info);
memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
- if (ldebug(clone))
- printf("Segment created in clone with "
- "CLONE_SETTLS: lobase: %x, hibase: %x, "
- "lolimit: %x, hilimit: %x, type: %i, "
- "dpl: %i, p: %i, xx: %i, def32: %i, "
- "gran: %i\n", sd.sd_lobase, sd.sd_hibase,
- sd.sd_lolimit, sd.sd_hilimit, sd.sd_type,
- sd.sd_dpl, sd.sd_p, sd.sd_xx,
- sd.sd_def32, sd.sd_gran);
-#endif
-
/* set %gs */
td->td_pcb->pcb_gsd = sd;
td->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
@@ -348,13 +326,6 @@
linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
{
-#ifdef DEBUG
- if (ldebug(mmap2))
- printf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"),
- (void *)args->addr, args->len, args->prot,
- args->flags, args->fd, args->pgoff);
-#endif
-
return (linux_mmap_common(td, args->addr, args->len, args->prot,
args->flags, args->fd, (uint64_t)(uint32_t)args->pgoff *
PAGE_SIZE));
@@ -370,13 +341,6 @@
if (error)
return (error);
-#ifdef DEBUG
- if (ldebug(mmap))
- printf(ARGS(mmap, "%p, %d, %d, 0x%08x, %d, %d"),
- (void *)linux_args.addr, linux_args.len, linux_args.prot,
- linux_args.flags, linux_args.fd, linux_args.pgoff);
-#endif
-
return (linux_mmap_common(td, linux_args.addr, linux_args.len,
linux_args.prot, linux_args.flags, linux_args.fd,
(uint32_t)linux_args.pgoff));
@@ -474,7 +438,7 @@
}
if (error == EOPNOTSUPP) {
- printf("linux: modify_ldt needs kernel option USER_LDT\n");
+ linux_msg(td, "modify_ldt needs kernel option USER_LDT");
error = ENOSYS;
}
@@ -488,12 +452,6 @@
l_sigaction_t act, oact;
int error;
-#ifdef DEBUG
- if (ldebug(sigaction))
- printf(ARGS(sigaction, "%d, %p, %p"),
- args->sig, (void *)args->nsa, (void *)args->osa);
-#endif
-
if (args->nsa != NULL) {
error = copyin(args->nsa, &osa, sizeof(l_osigaction_t));
if (error)
@@ -530,11 +488,6 @@
sigset_t sigmask;
l_sigset_t mask;
-#ifdef DEBUG
- if (ldebug(sigsuspend))
- printf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask);
-#endif
-
LINUX_SIGEMPTYSET(mask);
mask.__mask = args->mask;
linux_to_bsd_sigset(&mask, &sigmask);
@@ -548,12 +501,6 @@
sigset_t sigmask;
int error;
-#ifdef DEBUG
- if (ldebug(rt_sigsuspend))
- printf(ARGS(rt_sigsuspend, "%p, %d"),
- (void *)uap->newset, uap->sigsetsize);
-#endif
-
if (uap->sigsetsize != sizeof(l_sigset_t))
return (EINVAL);
@@ -571,11 +518,6 @@
struct proc *p = td->td_proc;
sigset_t sigmask;
-#ifdef DEBUG
- if (ldebug(pause))
- printf(ARGS(pause, ""));
-#endif
-
PROC_LOCK(p);
sigmask = td->td_sigmask;
PROC_UNLOCK(p);
@@ -589,11 +531,6 @@
l_stack_t lss;
int error;
-#ifdef DEBUG
- if (ldebug(sigaltstack))
- printf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss);
-#endif
-
if (uap->uss != NULL) {
error = copyin(uap->uss, &lss, sizeof(l_stack_t));
if (error)
@@ -619,12 +556,6 @@
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
{
-#ifdef DEBUG
- if (ldebug(ftruncate64))
- printf(ARGS(ftruncate64, "%u, %jd"), args->fd,
- (intmax_t)args->length);
-#endif
-
return (kern_ftruncate(td, args->fd, args->length));
}
@@ -641,20 +572,6 @@
if (error)
return (error);
-#ifdef DEBUG
- if (ldebug(set_thread_area))
- printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"),
- info.entry_number,
- info.base_addr,
- info.limit,
- info.seg_32bit,
- info.contents,
- info.read_exec_only,
- info.limit_in_pages,
- info.seg_not_present,
- info.useable);
-#endif
-
idx = info.entry_number;
/*
* Semantics of Linux version: every thread in the system has array of
@@ -703,20 +620,6 @@
}
memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
- if (ldebug(set_thread_area))
- printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase,
- sd.sd_hibase,
- sd.sd_lolimit,
- sd.sd_hilimit,
- sd.sd_type,
- sd.sd_dpl,
- sd.sd_p,
- sd.sd_xx,
- sd.sd_def32,
- sd.sd_gran);
-#endif
-
/* this is taken from i386 version of cpu_set_user_tls() */
critical_enter();
/* set %gs */
@@ -738,11 +641,6 @@
struct l_desc_struct desc;
struct segment_descriptor sd;
-#ifdef DEBUG
- if (ldebug(get_thread_area))
- printf(ARGS(get_thread_area, "%p"), args->desc);
-#endif
-
error = copyin(args->desc, &info, sizeof(struct l_user_desc));
if (error)
return (error);
Index: sys/i386/linux/linux_sysvec.c
===================================================================
--- sys/i386/linux/linux_sysvec.c
+++ sys/i386/linux/linux_sysvec.c
@@ -77,19 +77,6 @@
MODULE_VERSION(linux, 1);
-#if defined(DEBUG)
-SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
- linux_sysctl_debug, "A", "Linux debugging control");
-#endif
-
-/*
- * Allow the sendsig functions to use the ldebug() facility even though they
- * are not syscalls themselves. Map them to syscall 0. This is slightly less
- * bogus than using ldebug(sigreturn).
- */
-#define LINUX_SYS_linux_rt_sendsig 0
-#define LINUX_SYS_linux_sendsig 0
-
#define LINUX_PS_STRINGS (LINUX_USRSTACK - sizeof(struct ps_strings))
static int linux_szsigcode;
@@ -395,11 +382,6 @@
regs = td->td_frame;
oonstack = sigonstack(regs->tf_esp);
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(ARGS(rt_sendsig, "%p, %d, %p, %u"),
- catcher, sig, (void*)mask, code);
-#endif
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
@@ -456,23 +438,11 @@
frame.sf_sc.uc_mcontext.sc_cr2 = (register_t)ksi->ksi_addr;
frame.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(LMSG("rt_sendsig flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"),
- frame.sf_sc.uc_stack.ss_flags, td->td_sigstk.ss_sp,
- td->td_sigstk.ss_size, frame.sf_sc.uc_mcontext.sc_mask);
-#endif
-
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
* Process has trashed its stack; give it an illegal
* instruction to halt it in its tracks.
*/
-#ifdef DEBUG
- if (ldebug(rt_sendsig))
- printf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"),
- fp, oonstack);
-#endif
PROC_LOCK(p);
sigexit(td, SIGILL);
}
@@ -526,12 +496,6 @@
regs = td->td_frame;
oonstack = sigonstack(regs->tf_esp);
-#ifdef DEBUG
- if (ldebug(sendsig))
- printf(ARGS(sendsig, "%p, %d, %p, %u"),
- catcher, sig, (void*)mask, code);
-#endif
-
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
@@ -621,10 +585,6 @@
regs = td->td_frame;
-#ifdef DEBUG
- if (ldebug(sigreturn))
- printf(ARGS(sigreturn, "%p"), (void *)args->sfp);
-#endif
/*
* The trampoline code hands us the sigframe.
* It is unsafe to keep track of it ourselves, in the event that a
@@ -704,10 +664,6 @@
regs = td->td_frame;
-#ifdef DEBUG
- if (ldebug(rt_sigreturn))
- printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp);
-#endif
/*
* The trampoline code hands us the ucontext.
* It is unsafe to keep track of it ourselves, in the event that a
@@ -767,11 +723,6 @@
ss.ss_size = lss->ss_size;
ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
-#ifdef DEBUG
- if (ldebug(rt_sigreturn))
- printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"),
- ss.ss_flags, ss.ss_sp, ss.ss_size, context->sc_mask);
-#endif
(void)kern_sigaltstack(td, &ss, NULL);
return (EJUSTRETURN);
Index: sys/modules/linux/Makefile
===================================================================
--- sys/modules/linux/Makefile
+++ sys/modules/linux/Makefile
@@ -80,13 +80,4 @@
linux${SFX}_genassym.o: offset.inc
${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
-.if !defined(KERNBUILDDIR)
-.if defined(KTR)
-CFLAGS+= -DKTR
-.endif
-.if defined(DEBUG)
-CFLAGS+= -DDEBUG
-.endif
-.endif
-
.include <bsd.kmod.mk>
Index: sys/modules/linux64/Makefile
===================================================================
--- sys/modules/linux64/Makefile
+++ sys/modules/linux64/Makefile
@@ -55,13 +55,4 @@
linux_genassym.o: offset.inc
${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
-.if !defined(KERNBUILDDIR)
-.if defined(DEBUG)
-CFLAGS+=-DDEBUG
-.endif
-.if defined(KTR)
-CFLAGS+=-DKTR
-.endif
-.endif
-
.include <bsd.kmod.mk>
Index: sys/modules/linux_common/Makefile
===================================================================
--- sys/modules/linux_common/Makefile
+++ sys/modules/linux_common/Makefile
@@ -15,13 +15,4 @@
EXPORT_SYMS+= linux_get_osname
EXPORT_SYMS+= linux_get_osrelease
-.if !defined(KERNBUILDDIR)
-.if defined(DEBUG)
-CFLAGS+=-DDEBUG
-.endif
-.if defined(KTR)
-CFLAGS+=-DKTR
-.endif
-.endif
-
.include <bsd.kmod.mk>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 2:03 PM (19 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25768863
Default Alt Text
D20178.id57124.diff (64 KB)
Attached To
Mode
D20178: Prevent users from building obviously defective Linuxulator modules.
Attached
Detach File
Event Timeline
Log In to Comment