2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:29 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:26:16 wsanchez
35 * Import of OSF Mach kernel (~mburg)
37 * Revision 1.2.6.1 1994/09/23 02:14:23 ezf
38 * change marker to not FREE
39 * [1994/09/22 21:31:33 ezf]
41 * Revision 1.2.2.4 1993/08/03 18:29:18 gm
42 * CR9596: Change KERNEL to MACH_KERNEL.
43 * [1993/08/02 16:11:07 gm]
45 * Revision 1.2.2.3 1993/07/22 16:18:15 rod
46 * Add ANSI prototypes. CR #9523.
47 * [1993/07/22 13:34:22 rod]
49 * Revision 1.2.2.2 1993/06/09 02:33:38 gm
50 * Added to OSF/1 R1.3 from NMK15.0.
51 * [1993/06/02 21:11:41 jeffc]
53 * Revision 1.2 1993/04/19 16:23:26 devrcs
55 * Support for logging and tracing within the MIG stubs
56 * [1993/02/24 14:49:29 travos]
62 #include <mig_debug.h>
65 #include <mach/message.h>
66 #include <mach/mig_log.h>
68 int mig_tracing
, mig_errors
, mig_full_tracing
;
71 * Tracing facilities for MIG generated stubs.
73 * At the moment, there is only a printf, which is
74 * activated through the runtime switch:
75 * mig_tracing to call MigEventTracer
76 * mig_errors to call MigEventErrors
77 * For this to work, MIG has to run with the -L option,
78 * and the mig_debug flags has to be selected
80 * In the future, it will be possible to collect infos
81 * on the use of MACH IPC with an application similar
84 * A new option will be generated accordingly to the
85 * kernel configuration rules, e.g
86 * #include <mig_log.h>
92 mig_which_event_t what
,
93 mach_msg_id_t msgh_id
,
98 unsigned int oolports
,
103 printf("%d|%d|%d", who
, what
, msgh_id
);
104 if (mig_full_tracing
)
105 printf(" -- sz%d|kpd%d|ret(0x%x)|p%d|o%d|op%d|%s, %d",
106 size
, kpd
, retcode
, ports
, oolports
, ool
, file
, line
);
113 mig_which_error_t what
,
118 if (what
== MACH_MSG_ERROR_UNKNOWN_ID
)
119 printf("%d|%d|%d -- %s %d\n", who
, what
, *(int *)par
, file
, line
);
121 printf("%d|%d|%s -- %s %d\n", who
, what
, (char *)par
, file
, line
);