]> git.saurik.com Git - apple/dyld.git/blob - dyld3/Tracing.h
dyld-519.2.2.tar.gz
[apple/dyld.git] / dyld3 / Tracing.h
1 /*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25 #ifndef Tracing_h
26 #define Tracing_h
27
28 #include <stdio.h>
29 #include <stdint.h>
30 #include <sys/stat.h>
31 #include <sys/param.h>
32 #include <sys/mount.h>
33 #include <uuid/uuid.h>
34 #include <mach-o/loader.h>
35 #include <System/sys/kdebug.h>
36
37 #ifndef DBG_DYLD_SIGNPOST
38 #define DBG_DYLD_SIGNPOST (6)
39 #endif
40
41 #ifndef DBG_DYLD_TIMING
42 #define DBG_DYLD_TIMING (7)
43 #endif
44
45 #ifndef DBG_DYLD_PRINT
46 #define DBG_DYLD_PRINT (8)
47 #endif
48
49 #ifndef DBG_DYLD_SIGNPOST_START_DYLD
50 #define DBG_DYLD_SIGNPOST_START_DYLD (0)
51 #endif
52
53 #ifndef DBG_DYLD_SIGNPOST_START_MAIN
54 #define DBG_DYLD_SIGNPOST_START_MAIN (1)
55 #endif
56
57 #ifndef DBG_DYLD_SIGNPOST_START_MAIN_DYLD2
58 #define DBG_DYLD_SIGNPOST_START_MAIN_DYLD2 (2)
59 #endif
60
61 #ifndef DBG_DYLD_TIMING_STATIC_INITIALIZER
62 #define DBG_DYLD_TIMING_STATIC_INITIALIZER (0)
63 #endif
64
65 #ifndef DBG_DYLD_PRINT_GENERIC
66 #define DBG_DYLD_PRINT_GENERIC (0)
67 #endif
68
69
70 #define VIS_HIDDEN __attribute__((visibility("hidden")))
71
72 namespace dyld3 {
73
74 VIS_HIDDEN
75 void kdebug_trace_dyld_image(const uint32_t code,
76 const uuid_t* uuid_bytes,
77 const fsobj_id_t fsobjid,
78 const fsid_t fsid,
79 const mach_header* load_addr);
80
81 VIS_HIDDEN
82 void kdebug_trace_dyld_signpost(const uint32_t code, uint64_t data1, uint64_t data2);
83
84 VIS_HIDDEN
85 void kdebug_trace_dyld_duration(const uint32_t code, uint64_t data1, uint64_t data2, void (^block)());
86
87 VIS_HIDDEN
88 void kdebug_trace_print(const uint32_t code, const char *string);
89 }
90
91 #endif /* Tracing_h */