xref: /freebsd/sys/compat/linux/check_error.d (revision 81338031)
119e252baSAlexander Leidinger #!/usr/sbin/dtrace -qs
219e252baSAlexander Leidinger 
319e252baSAlexander Leidinger /*-
419e252baSAlexander Leidinger  * Copyright (c) 2008-2012 Alexander Leidinger <netchild@FreeBSD.org>
519e252baSAlexander Leidinger  * All rights reserved.
619e252baSAlexander Leidinger  *
719e252baSAlexander Leidinger  * Redistribution and use in source and binary forms, with or without
819e252baSAlexander Leidinger  * modification, are permitted provided that the following conditions
919e252baSAlexander Leidinger  * are met:
1019e252baSAlexander Leidinger  * 1. Redistributions of source code must retain the above copyright
1119e252baSAlexander Leidinger  *    notice, this list of conditions and the following disclaimer
1219e252baSAlexander Leidinger  *    in this position and unchanged.
1319e252baSAlexander Leidinger  * 2. Redistributions in binary form must reproduce the above copyright
1419e252baSAlexander Leidinger  *    notice, this list of conditions and the following disclaimer in the
1519e252baSAlexander Leidinger  *    documentation and/or other materials provided with the distribution.
1619e252baSAlexander Leidinger  *
1719e252baSAlexander Leidinger  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1819e252baSAlexander Leidinger  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1919e252baSAlexander Leidinger  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2019e252baSAlexander Leidinger  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2119e252baSAlexander Leidinger  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2219e252baSAlexander Leidinger  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2319e252baSAlexander Leidinger  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2419e252baSAlexander Leidinger  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2519e252baSAlexander Leidinger  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2619e252baSAlexander Leidinger  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2719e252baSAlexander Leidinger  *
2819e252baSAlexander Leidinger  * $FreeBSD$
2919e252baSAlexander Leidinger  */
3019e252baSAlexander Leidinger 
3119e252baSAlexander Leidinger /*
3219e252baSAlexander Leidinger  * Report error conditions:
3319e252baSAlexander Leidinger  *  - emulation errors (unsupportet stuff, unknown stuff, ...)
3419e252baSAlexander Leidinger  *  - kernel errors (resource shortage, ...)
3519e252baSAlexander Leidinger  *  - programming errors (errors which can happen, but should not happen)
3619e252baSAlexander Leidinger  */
3719e252baSAlexander Leidinger 
3819e252baSAlexander Leidinger linuxulator*:dummy::not_implemented,
3981338031SDmitry Chagin linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
4081338031SDmitry Chagin linuxulator*:emul:linux_thread_detach:futex_failed,
4119e252baSAlexander Leidinger linuxulator*:emul:linux_schedtail:copyout_error,
4219e252baSAlexander Leidinger linuxulator*:futex:futex_get:error,
4319e252baSAlexander Leidinger linuxulator*:futex:futex_sleep:requeue_error,
4419e252baSAlexander Leidinger linuxulator*:futex:futex_sleep:sleep_error,
4519e252baSAlexander Leidinger linuxulator*:futex:futex_wait:copyin_error,
4619e252baSAlexander Leidinger linuxulator*:futex:futex_wait:itimerfix_error,
4719e252baSAlexander Leidinger linuxulator*:futex:futex_wait:sleep_error,
4819e252baSAlexander Leidinger linuxulator*:futex:futex_atomic_op:missing_access_check,
4919e252baSAlexander Leidinger linuxulator*:futex:futex_atomic_op:unimplemented_op,
5019e252baSAlexander Leidinger linuxulator*:futex:futex_atomic_op:unimplemented_cmp,
5119e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_clockswitch,
5219e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:copyin_error,
5319e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unhandled_efault,
5419e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_lock_pi,
5519e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_unlock_pi,
5619e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_trylock_pi,
5719e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_wait_requeue_pi,
5819e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unimplemented_cmp_requeue_pi,
5919e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:unknown_operation,
6019e252baSAlexander Leidinger linuxulator*:futex:linux_get_robust_list:copyout_error,
6119e252baSAlexander Leidinger linuxulator*:futex:handle_futex_death:copyin_error,
6219e252baSAlexander Leidinger linuxulator*:futex:fetch_robust_entry:copyin_error,
6319e252baSAlexander Leidinger linuxulator*:futex:release_futexes:copyin_error,
6419e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:conversion_error,
6519e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:gettime_error,
6619e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:copyout_error,
6719e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:conversion_error,
6819e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:settime_error,
6919e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:copyin_error,
7019e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:conversion_error,
7119e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:getres_error,
7219e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:copyout_error,
7319e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:conversion_error,
7419e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:nanosleep_error,
7519e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:copyout_error,
7619e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:copyin_error,
7719e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:copyin_error,
7819e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:conversion_error,
7919e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:copyout_error,
8019e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:nanosleep_error,
8119e252baSAlexander Leidinger linuxulator*:sysctl:handle_string:copyout_error,
8219e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:copyin_error,
8319e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_osname:sysctl_string_error,
8419e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error,
8519e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error,
8619e252baSAlexander Leidinger linuxulator*:mib:linux_prison_create:vfs_copyopt_error,
8719e252baSAlexander Leidinger linuxulator*:mib:linux_prison_check:vfs_copyopt_error,
8819e252baSAlexander Leidinger linuxulator*:mib:linux_prison_check:vfs_getopt_error,
8919e252baSAlexander Leidinger linuxulator*:mib:linux_prison_set:vfs_copyopt_error,
9019e252baSAlexander Leidinger linuxulator*:mib:linux_prison_set:vfs_getopt_error,
9119e252baSAlexander Leidinger linuxulator*:mib:linux_prison_get:vfs_setopt_error,
9219e252baSAlexander Leidinger linuxulator*:mib:linux_prison_get:vfs_setopts_error
9319e252baSAlexander Leidinger {
9419e252baSAlexander Leidinger 	printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc);
9519e252baSAlexander Leidinger 	stack();
9619e252baSAlexander Leidinger 	ustack();
9719e252baSAlexander Leidinger }
9819e252baSAlexander Leidinger 
9919e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_name_dev:nullcall,
10019e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_major_minor:nullcall,
10119e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:invalid_cmp_requeue_use,
10219e252baSAlexander Leidinger linuxulator*:futex:linux_sys_futex:deprecated_requeue,
10319e252baSAlexander Leidinger linuxulator*:futex:linux_set_robust_list:size_error,
10419e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:nullcall
10519e252baSAlexander Leidinger {
10619e252baSAlexander Leidinger 	printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname);
10719e252baSAlexander Leidinger 	stack();
10819e252baSAlexander Leidinger 	ustack();
10919e252baSAlexander Leidinger }
11019e252baSAlexander Leidinger 
11119e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_major_minor:notfound
11219e252baSAlexander Leidinger {
11319e252baSAlexander Leidinger 	printf("WARNING: Application %s failed to find %s in %s:%s:%s, this may or may not be a problem.\n", execname, stringof(args[0]), probename, probeprov, probemod);
11419e252baSAlexander Leidinger 	stack();
11519e252baSAlexander Leidinger 	ustack();
11619e252baSAlexander Leidinger }
11719e252baSAlexander Leidinger 
11819e252baSAlexander Leidinger linuxulator*:time:linux_to_native_clockid:unknown_clockid
11919e252baSAlexander Leidinger {
12019e252baSAlexander Leidinger 	printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0);
12119e252baSAlexander Leidinger }
12219e252baSAlexander Leidinger 
12319e252baSAlexander Leidinger linuxulator*:time:linux_to_native_clockid:unsupported_clockid,
12419e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:unsupported_clockid
12519e252baSAlexander Leidinger {
12619e252baSAlexander Leidinger 	printf("WARNING: Application %s tried to use unsupported clockid (%d), this may or may not be a problem for the application.\nPatches to support this clockid are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0);
12719e252baSAlexander Leidinger }
12819e252baSAlexander Leidinger 
12919e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:unsupported_flags
13019e252baSAlexander Leidinger {
13119e252baSAlexander Leidinger 	printf("WARNING: Application %s tried to use unsupported flags (%d), this may or may not be a problem for the application.\nPatches to support those flags are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0);
13219e252baSAlexander Leidinger }
13319e252baSAlexander Leidinger 
13419e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:wrong_length
13519e252baSAlexander Leidinger {
13619e252baSAlexander Leidinger 	printf("ERROR: Application %s issued a sysctl which failed the length restrictions.\nThe length passed is %d, the min length supported is 1 and the max length supported is %d.\n", execname, arg0, arg1);
13719e252baSAlexander Leidinger 	stack();
13819e252baSAlexander Leidinger 	ustack();
13919e252baSAlexander Leidinger }
14019e252baSAlexander Leidinger 
14119e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:unsupported_sysctl
14219e252baSAlexander Leidinger {
14319e252baSAlexander Leidinger 	printf("ERROR: Application %s issued an unsupported sysctl (%s).\nPatches to support this sysctl are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, stringof(args[0]));
14419e252baSAlexander Leidinger }
145