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
36linuxulator*:dummy::not_implemented,
37linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
38linuxulator*:emul:linux_thread_detach:futex_failed,
39linuxulator*:emul:linux_schedtail:copyout_error,
40linuxulator*:time:linux_clock_gettime:conversion_error,
41linuxulator*:time:linux_clock_gettime:gettime_error,
42linuxulator*:time:linux_clock_gettime:copyout_error,
43linuxulator*:time:linux_clock_settime:conversion_error,
44linuxulator*:time:linux_clock_settime:settime_error,
45linuxulator*:time:linux_clock_settime:copyin_error,
46linuxulator*:time:linux_clock_getres:conversion_error,
47linuxulator*:time:linux_clock_getres:getres_error,
48linuxulator*:time:linux_clock_getres:copyout_error,
49linuxulator*:time:linux_nanosleep:conversion_error,
50linuxulator*:time:linux_nanosleep:nanosleep_error,
51linuxulator*:time:linux_nanosleep:copyout_error,
52linuxulator*:time:linux_nanosleep:copyin_error,
53linuxulator*:time:linux_clock_nanosleep:copyin_error,
54linuxulator*:time:linux_clock_nanosleep:conversion_error,
55linuxulator*:time:linux_clock_nanosleep:copyout_error,
56linuxulator*:time:linux_clock_nanosleep:nanosleep_error,
57linuxulator*:sysctl:handle_string:copyout_error,
58linuxulator*:sysctl:linux_sysctl:copyin_error,
59linuxulator*:mib:linux_sysctl_osname:sysctl_string_error,
60linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error,
61linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error,
62linuxulator*:mib:linux_prison_create:vfs_copyopt_error,
63linuxulator*:mib:linux_prison_check:vfs_copyopt_error,
64linuxulator*:mib:linux_prison_check:vfs_getopt_error,
65linuxulator*:mib:linux_prison_set:vfs_copyopt_error,
66linuxulator*:mib:linux_prison_set:vfs_getopt_error,
67linuxulator*:mib:linux_prison_get:vfs_setopt_error,
68linuxulator*: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
75linuxulator*:util:linux_driver_get_name_dev:nullcall,
76linuxulator*:util:linux_driver_get_major_minor:nullcall,
77linuxulator*: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
84linuxulator*: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
91linuxulator*: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
96linuxulator*:time:linux_to_native_clockid:unsupported_clockid,
97linuxulator*: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
102linuxulator*: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
107linuxulator*: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
114linuxulator*: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