xref: /freebsd/sys/compat/linux/check_error.d (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1 #!/usr/sbin/dtrace -qs
2 
3 /*-
4  * Copyright (c) 2008-2012 Alexander Leidinger <netchild@FreeBSD.org>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer
12  *    in this position and unchanged.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 /*
30  * Report error conditions:
31  *  - emulation errors (unsupportet stuff, unknown stuff, ...)
32  *  - kernel errors (resource shortage, ...)
33  *  - programming errors (errors which can happen, but should not happen)
34  */
35 
36 linuxulator*:dummy::not_implemented,
37 linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
38 linuxulator*:emul:linux_thread_detach:futex_failed,
39 linuxulator*:emul:linux_schedtail:copyout_error,
40 linuxulator*:time:linux_clock_gettime:conversion_error,
41 linuxulator*:time:linux_clock_gettime:gettime_error,
42 linuxulator*:time:linux_clock_gettime:copyout_error,
43 linuxulator*:time:linux_clock_settime:conversion_error,
44 linuxulator*:time:linux_clock_settime:settime_error,
45 linuxulator*:time:linux_clock_settime:copyin_error,
46 linuxulator*:time:linux_clock_getres:conversion_error,
47 linuxulator*:time:linux_clock_getres:getres_error,
48 linuxulator*:time:linux_clock_getres:copyout_error,
49 linuxulator*:time:linux_nanosleep:conversion_error,
50 linuxulator*:time:linux_nanosleep:nanosleep_error,
51 linuxulator*:time:linux_nanosleep:copyout_error,
52 linuxulator*:time:linux_nanosleep:copyin_error,
53 linuxulator*:time:linux_clock_nanosleep:copyin_error,
54 linuxulator*:time:linux_clock_nanosleep:conversion_error,
55 linuxulator*:time:linux_clock_nanosleep:copyout_error,
56 linuxulator*:time:linux_clock_nanosleep:nanosleep_error,
57 linuxulator*:sysctl:handle_string:copyout_error,
58 linuxulator*:sysctl:linux_sysctl:copyin_error,
59 linuxulator*:mib:linux_sysctl_osname:sysctl_string_error,
60 linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error,
61 linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error,
62 linuxulator*:mib:linux_prison_create:vfs_copyopt_error,
63 linuxulator*:mib:linux_prison_check:vfs_copyopt_error,
64 linuxulator*:mib:linux_prison_check:vfs_getopt_error,
65 linuxulator*:mib:linux_prison_set:vfs_copyopt_error,
66 linuxulator*:mib:linux_prison_set:vfs_getopt_error,
67 linuxulator*:mib:linux_prison_get:vfs_setopt_error,
68 linuxulator*:mib:linux_prison_get:vfs_setopts_error
69 {
70 	printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc);
71 	stack();
72 	ustack();
73 }
74 
75 linuxulator*:util:linux_driver_get_name_dev:nullcall,
76 linuxulator*:util:linux_driver_get_major_minor:nullcall,
77 linuxulator*:time:linux_clock_getres:nullcall
78 {
79 	printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname);
80 	stack();
81 	ustack();
82 }
83 
84 linuxulator*:util:linux_driver_get_major_minor:notfound
85 {
86 	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);
87 	stack();
88 	ustack();
89 }
90 
91 linuxulator*:time:linux_to_native_clockid:unknown_clockid
92 {
93 	printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0);
94 }
95 
96 linuxulator*:time:linux_to_native_clockid:unsupported_clockid,
97 linuxulator*:time:linux_clock_nanosleep:unsupported_clockid
98 {
99 	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);
100 }
101 
102 linuxulator*:time:linux_clock_nanosleep:unsupported_flags
103 {
104 	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);
105 }
106 
107 linuxulator*:sysctl:linux_sysctl:wrong_length
108 {
109 	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);
110 	stack();
111 	ustack();
112 }
113 
114 linuxulator*:sysctl:linux_sysctl:unsupported_sysctl
115 {
116 	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]));
117 }
118