xref: /freebsd/sys/compat/linux/check_error.d (revision 95ee2897)
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 
2919e252baSAlexander Leidinger /*
3019e252baSAlexander Leidinger  * Report error conditions:
3119e252baSAlexander Leidinger  *  - emulation errors (unsupportet stuff, unknown stuff, ...)
3219e252baSAlexander Leidinger  *  - kernel errors (resource shortage, ...)
3319e252baSAlexander Leidinger  *  - programming errors (errors which can happen, but should not happen)
3419e252baSAlexander Leidinger  */
3519e252baSAlexander Leidinger 
3619e252baSAlexander Leidinger linuxulator*:dummy::not_implemented,
3781338031SDmitry Chagin linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
3881338031SDmitry Chagin linuxulator*:emul:linux_thread_detach:futex_failed,
3919e252baSAlexander Leidinger linuxulator*:emul:linux_schedtail:copyout_error,
4019e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:conversion_error,
4119e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:gettime_error,
4219e252baSAlexander Leidinger linuxulator*:time:linux_clock_gettime:copyout_error,
4319e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:conversion_error,
4419e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:settime_error,
4519e252baSAlexander Leidinger linuxulator*:time:linux_clock_settime:copyin_error,
4619e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:conversion_error,
4719e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:getres_error,
4819e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:copyout_error,
4919e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:conversion_error,
5019e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:nanosleep_error,
5119e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:copyout_error,
5219e252baSAlexander Leidinger linuxulator*:time:linux_nanosleep:copyin_error,
5319e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:copyin_error,
5419e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:conversion_error,
5519e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:copyout_error,
5619e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:nanosleep_error,
5719e252baSAlexander Leidinger linuxulator*:sysctl:handle_string:copyout_error,
5819e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:copyin_error,
5919e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_osname:sysctl_string_error,
6019e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error,
6119e252baSAlexander Leidinger linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error,
6219e252baSAlexander Leidinger linuxulator*:mib:linux_prison_create:vfs_copyopt_error,
6319e252baSAlexander Leidinger linuxulator*:mib:linux_prison_check:vfs_copyopt_error,
6419e252baSAlexander Leidinger linuxulator*:mib:linux_prison_check:vfs_getopt_error,
6519e252baSAlexander Leidinger linuxulator*:mib:linux_prison_set:vfs_copyopt_error,
6619e252baSAlexander Leidinger linuxulator*:mib:linux_prison_set:vfs_getopt_error,
6719e252baSAlexander Leidinger linuxulator*:mib:linux_prison_get:vfs_setopt_error,
6819e252baSAlexander Leidinger linuxulator*:mib:linux_prison_get:vfs_setopts_error
6919e252baSAlexander Leidinger {
7019e252baSAlexander Leidinger 	printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc);
7119e252baSAlexander Leidinger 	stack();
7219e252baSAlexander Leidinger 	ustack();
7319e252baSAlexander Leidinger }
7419e252baSAlexander Leidinger 
7519e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_name_dev:nullcall,
7619e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_major_minor:nullcall,
7719e252baSAlexander Leidinger linuxulator*:time:linux_clock_getres:nullcall
7819e252baSAlexander Leidinger {
7919e252baSAlexander Leidinger 	printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname);
8019e252baSAlexander Leidinger 	stack();
8119e252baSAlexander Leidinger 	ustack();
8219e252baSAlexander Leidinger }
8319e252baSAlexander Leidinger 
8419e252baSAlexander Leidinger linuxulator*:util:linux_driver_get_major_minor:notfound
8519e252baSAlexander Leidinger {
8619e252baSAlexander 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);
8719e252baSAlexander Leidinger 	stack();
8819e252baSAlexander Leidinger 	ustack();
8919e252baSAlexander Leidinger }
9019e252baSAlexander Leidinger 
9119e252baSAlexander Leidinger linuxulator*:time:linux_to_native_clockid:unknown_clockid
9219e252baSAlexander Leidinger {
9319e252baSAlexander Leidinger 	printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0);
9419e252baSAlexander Leidinger }
9519e252baSAlexander Leidinger 
9619e252baSAlexander Leidinger linuxulator*:time:linux_to_native_clockid:unsupported_clockid,
9719e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:unsupported_clockid
9819e252baSAlexander Leidinger {
9919e252baSAlexander 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);
10019e252baSAlexander Leidinger }
10119e252baSAlexander Leidinger 
10219e252baSAlexander Leidinger linuxulator*:time:linux_clock_nanosleep:unsupported_flags
10319e252baSAlexander Leidinger {
10419e252baSAlexander 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);
10519e252baSAlexander Leidinger }
10619e252baSAlexander Leidinger 
10719e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:wrong_length
10819e252baSAlexander Leidinger {
10919e252baSAlexander 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);
11019e252baSAlexander Leidinger 	stack();
11119e252baSAlexander Leidinger 	ustack();
11219e252baSAlexander Leidinger }
11319e252baSAlexander Leidinger 
11419e252baSAlexander Leidinger linuxulator*:sysctl:linux_sysctl:unsupported_sysctl
11519e252baSAlexander Leidinger {
11619e252baSAlexander 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]));
11719e252baSAlexander Leidinger }
118