X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..HEAD:/osfmk/ipc/mig_log.c diff --git a/osfmk/ipc/mig_log.c b/osfmk/ipc/mig_log.c index 86b8ae672..3ede23f98 100644 --- a/osfmk/ipc/mig_log.c +++ b/osfmk/ipc/mig_log.c @@ -2,7 +2,7 @@ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* @@ -30,7 +30,7 @@ */ /* * HISTORY - * + * * Revision 1.1.1.1 1998/09/22 21:05:29 wsanchez * Import of Mac OS X kernel (~semeria) * @@ -38,26 +38,26 @@ * Import of OSF Mach kernel (~mburg) * * Revision 1.2.6.1 1994/09/23 02:14:23 ezf - * change marker to not FREE - * [1994/09/22 21:31:33 ezf] + * change marker to not FREE + * [1994/09/22 21:31:33 ezf] * * Revision 1.2.2.4 1993/08/03 18:29:18 gm - * CR9596: Change KERNEL to MACH_KERNEL. - * [1993/08/02 16:11:07 gm] - * + * CR9596: Change KERNEL to MACH_KERNEL. + * [1993/08/02 16:11:07 gm] + * * Revision 1.2.2.3 1993/07/22 16:18:15 rod - * Add ANSI prototypes. CR #9523. - * [1993/07/22 13:34:22 rod] - * + * Add ANSI prototypes. CR #9523. + * [1993/07/22 13:34:22 rod] + * * Revision 1.2.2.2 1993/06/09 02:33:38 gm - * Added to OSF/1 R1.3 from NMK15.0. - * [1993/06/02 21:11:41 jeffc] - * + * Added to OSF/1 R1.3 from NMK15.0. + * [1993/06/02 21:11:41 jeffc] + * * Revision 1.2 1993/04/19 16:23:26 devrcs - * Untyped ipc merge: - * Support for logging and tracing within the MIG stubs - * [1993/02/24 14:49:29 travos] - * + * Untyped ipc merge: + * Support for logging and tracing within the MIG stubs + * [1993/02/24 14:49:29 travos] + * * $EndLog$ */ @@ -75,51 +75,53 @@ int mig_tracing, mig_errors, mig_full_tracing; * * At the moment, there is only a printf, which is * activated through the runtime switch: - * mig_tracing to call MigEventTracer - * mig_errors to call MigEventErrors - * For this to work, MIG has to run with the -L option, + * mig_tracing to call MigEventTracer + * mig_errors to call MigEventErrors + * For this to work, MIG has to run with the -L option, * and the mig_debug flags has to be selected * * In the future, it will be possible to collect infos * on the use of MACH IPC with an application similar * to netstat. - * + * * A new option will be generated accordingly to the * kernel configuration rules, e.g * #include - */ + */ void MigEventTracer( - mig_who_t who, - mig_which_event_t what, - mach_msg_id_t msgh_id, - unsigned int size, - unsigned int kpd, - unsigned int retcode, - unsigned int ports, - unsigned int oolports, - unsigned int ool, - char *file, - unsigned int line) + mig_who_t who, + mig_which_event_t what, + mach_msg_id_t msgh_id, + unsigned int size, + unsigned int kpd, + unsigned int retcode, + unsigned int ports, + unsigned int oolports, + unsigned int ool, + char *file, + unsigned int line) { - printf("%d|%d|%d", who, what, msgh_id); - if (mig_full_tracing) - printf(" -- sz%d|kpd%d|ret(0x%x)|p%d|o%d|op%d|%s, %d", - size, kpd, retcode, ports, oolports, ool, file, line); - printf("\n"); + printf("%d|%d|%d", who, what, msgh_id); + if (mig_full_tracing) { + printf(" -- sz%d|kpd%d|ret(0x%x)|p%d|o%d|op%d|%s, %d", + size, kpd, retcode, ports, oolports, ool, file, line); + } + printf("\n"); } void MigEventErrors( - mig_who_t who, - mig_which_error_t what, - void *par, - char *file, - unsigned int line) + mig_who_t who, + mig_which_error_t what, + void *par, + char *file, + unsigned int line) { - if (what == MACH_MSG_ERROR_UNKNOWN_ID) - printf("%d|%d|%d -- %s %d\n", who, what, *(int *)par, file, line); - else - printf("%d|%d|%s -- %s %d\n", who, what, (char *)par, file, line); + if (what == MACH_MSG_ERROR_UNKNOWN_ID) { + printf("%d|%d|%d -- %s %d\n", who, what, *(int *)par, file, line); + } else { + printf("%d|%d|%s -- %s %d\n", who, what, (char *)par, file, line); + } }