]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mig_log.h
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / mach / mig_log.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
de355530
A
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
1c79356b 11 *
de355530
A
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
de355530
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_COPYRIGHT@
24 */
1c79356b
A
25
26#ifndef _mig_log_
27#define _mig_log_
28
9bccf70c
A
29#include <sys/appleapiopts.h>
30
31#ifdef __APPLE_API_OBSOLETE
32
1c79356b
A
33typedef enum {
34 MACH_MSG_LOG_USER,
35 MACH_MSG_LOG_SERVER
36} mig_who_t;
37
38typedef enum {
39 MACH_MSG_REQUEST_BEING_SENT,
40 MACH_MSG_REQUEST_BEING_RCVD,
41 MACH_MSG_REPLY_BEING_SENT,
42 MACH_MSG_REPLY_BEING_RCVD
43} mig_which_event_t;
44
45typedef enum {
46 MACH_MSG_ERROR_WHILE_PARSING,
47 MACH_MSG_ERROR_UNKNOWN_ID
48} mig_which_error_t;
49
50extern void MigEventTracer
51#if defined(__STDC__)
52(
53 mig_who_t who,
54 mig_which_event_t what,
55 mach_msg_id_t msgh_id,
56 unsigned int size,
57 unsigned int kpd,
58 unsigned int retcode,
59 unsigned int ports,
60 unsigned int oolports,
61 unsigned int ool,
62 char *file,
63 unsigned int line
64);
65#else /* !defined(__STDC__) */
66();
67#endif /* !defined(__STDC__) */
68
69extern void MigEventErrors
70#if defined(__STDC__)
71(
72 mig_who_t who,
73 mig_which_error_t what,
74 void *par,
75 char *file,
76 unsigned int line
77);
78#else /* !defined(__STDC__) */
79();
80#endif /* !defined(__STDC__) */
81
82extern int mig_errors;
83extern int mig_tracing;
84
85#define LOG_ERRORS if (mig_errors) MigEventErrors
86#define LOG_TRACE if (mig_tracing) MigEventTracer
87
9bccf70c
A
88#endif /* __APPLE_API_OBSOLETE */
89
1c79356b
A
90#endif /* _mach_log_ */
91