xref: /freebsd/sys/compat/linux/check_error.d (revision 77013d11e6483b970af25e13c9b892075742f7e5)
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  * $FreeBSD$
29  */
30 
31 /*
32  * Report error conditions:
33  *  - emulation errors (unsupportet stuff, unknown stuff, ...)
34  *  - kernel errors (resource shortage, ...)
35  *  - programming errors (errors which can happen, but should not happen)
36  */
37 
38 linuxulator*:dummy::not_implemented,
39 linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
40 linuxulator*:emul:linux_thread_detach:futex_failed,
41 linuxulator*:emul:linux_schedtail:copyout_error,
42 linuxulator*:time:linux_clock_gettime:conversion_error,
43 linuxulator*:time:linux_clock_gettime:gettime_error,
44 linuxulator*:time:linux_clock_gettime:copyout_error,
45 linuxulator*:time:linux_clock_settime:conversion_error,
46 linuxulator*:time:linux_clock_settime:settime_error,
47 linuxulator*:time:linux_clock_settime:copyin_error,
48 linuxulator*:time:linux_clock_getres:conversion_error,
49 linuxulator*:time:linux_clock_getres:getres_error,
50 linuxulator*:time:linux_clock_getres:copyout_error,
51 linuxulator*:time:linux_nanosleep:conversion_error,
52 linuxulator*:time:linux_nanosleep:nanosleep_error,
53 linuxulator*:time:linux_nanosleep:copyout_error,
54 linuxulator*:time:linux_nanosleep:copyin_error,
55 linuxulator*:time:linux_clock_nanosleep:copyin_error,
56 linuxulator*:time:linux_clock_nanosleep:conversion_error,
57 linuxulator*:time:linux_clock_nanosleep:copyout_error,
58 linuxulator*:time:linux_clock_nanosleep:nanosleep_error,
59 linuxulator*:sysctl:handle_string:copyout_error,
60 linuxulator*:sysctl:linux_sysctl:copyin_error,
61 linuxulator*:mib:linux_sysctl_osname:sysctl_string_error,
62 linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error,
63 linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error,
64 linuxulator*:mib:linux_prison_create:vfs_copyopt_error,
65 linuxulator*:mib:linux_prison_check:vfs_copyopt_error,
66 linuxulator*:mib:linux_prison_check:vfs_getopt_error,
67 linuxulator*:mib:linux_prison_set:vfs_copyopt_error,
68 linuxulator*:mib:linux_prison_set:vfs_getopt_error,
69 linuxulator*:mib:linux_prison_get:vfs_setopt_error,
70 linuxulator*:mib:linux_prison_get:vfs_setopts_error
71 {
72 	printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc);
73 	stack();
74 	ustack();
75 }
76 
77 linuxulator*:util:linux_driver_get_name_dev:nullcall,
78 linuxulator*:util:linux_driver_get_major_minor:nullcall,
79 linuxulator*:time:linux_clock_getres:nullcall
80 {
81 	printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname);
82 	stack();
83 	ustack();
84 }
85 
86 linuxulator*:util:linux_driver_get_major_minor:notfound
87 {
88 	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);
89 	stack();
90 	ustack();
91 }
92 
93 linuxulator*:time:linux_to_native_clockid:unknown_clockid
94 {
95 	printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0);
96 }
97 
98 linuxulator*:time:linux_to_native_clockid:unsupported_clockid,
99 linuxulator*:time:linux_clock_nanosleep:unsupported_clockid
100 {
101 	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);
102 }
103 
104 linuxulator*:time:linux_clock_nanosleep:unsupported_flags
105 {
106 	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);
107 }
108 
109 linuxulator*:sysctl:linux_sysctl:wrong_length
110 {
111 	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);
112 	stack();
113 	ustack();
114 }
115 
116 linuxulator*:sysctl:linux_sysctl:unsupported_sysctl
117 {
118 	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]));
119 }
120