MFC r283460:

Print out unsupported futex operation message only once for the process.
This commit is contained in:
dchagin 2016-01-09 17:07:17 +00:00
parent a72b15cf79
commit cb583c148b
2 changed files with 46 additions and 23 deletions

View File

@ -61,6 +61,7 @@ int linux_common_execve(struct thread *, struct image_args *);
#define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated
futex REQUEUE op*/
#define LINUX_XUNSUP_EPOLL 0x00000002 /* unsupported epoll events */
#define LINUX_XUNSUP_FUTEXPIOP 0x00000004 /* uses unsupported pi futex */
struct linux_pemuldata {
uint32_t flags; /* process emuldata flags */

View File

@ -937,29 +937,43 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_LOCK_PI:
/* not yet implemented */
linux_msg(td,
"linux_sys_futex: "
"op LINUX_FUTEX_LOCK_PI not implemented\n");
LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_lock_pi);
pem = pem_find(td->td_proc);
if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_pi op\n");
pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_lock_pi);
}
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_UNLOCK_PI:
/* not yet implemented */
linux_msg(td,
"linux_sys_futex: "
"op LINUX_FUTEX_UNLOCK_PI not implemented\n");
LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_unlock_pi);
pem = pem_find(td->td_proc);
if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_pi op\n");
pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_unlock_pi);
}
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_TRYLOCK_PI:
/* not yet implemented */
linux_msg(td,
"linux_sys_futex: "
"op LINUX_FUTEX_TRYLOCK_PI not implemented\n");
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_trylock_pi);
pem = pem_find(td->td_proc);
if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_pi op\n");
pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_trylock_pi);
}
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
@ -986,21 +1000,29 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_WAIT_REQUEUE_PI:
/* not yet implemented */
linux_msg(td,
"linux_sys_futex: "
"op FUTEX_WAIT_REQUEUE_PI not implemented\n");
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_wait_requeue_pi);
pem = pem_find(td->td_proc);
if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_pi op\n");
pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_wait_requeue_pi);
}
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_CMP_REQUEUE_PI:
/* not yet implemented */
linux_msg(td,
"linux_sys_futex: "
"op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n");
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_cmp_requeue_pi);
pem = pem_find(td->td_proc);
if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_pi op\n");
pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
unimplemented_cmp_requeue_pi);
}
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);