OLD | NEW |
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* XRay -- a simple profiler for Native Client */ | 6 /* XRay -- a simple profiler for Native Client */ |
7 | 7 |
8 | 8 |
9 #ifndef LIBRARIES_XRAY_XRAY_H_ | 9 #ifndef LIBRARIES_XRAY_XRAY_H_ |
10 #define LIBRARIES_XRAY_XRAY_H_ | 10 #define LIBRARIES_XRAY_XRAY_H_ |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
| 14 #ifndef XRAY_DISABLE_BROWSER_INTEGRATION |
| 15 #include "ppapi/c/ppb.h" |
| 16 #endif |
| 17 |
14 #if defined(__arm__) | 18 #if defined(__arm__) |
15 #undef XRAY | 19 #undef XRAY |
16 #endif | 20 #endif |
17 | 21 |
18 #ifdef __cplusplus | 22 #ifdef __cplusplus |
19 extern "C" { | 23 extern "C" { |
20 #endif | 24 #endif |
21 | 25 |
22 #define XRAY_NO_INSTRUMENT __attribute__((no_instrument_function)) | 26 #define XRAY_NO_INSTRUMENT __attribute__((no_instrument_function)) |
23 #define XRAY_INLINE __attribute__((always_inline, no_instrument_function)) | 27 #define XRAY_INLINE __attribute__((always_inline, no_instrument_function)) |
(...skipping 22 matching lines...) Expand all Loading... |
46 XRAY_NO_INSTRUMENT void XRaySetAnnotationFilter( | 50 XRAY_NO_INSTRUMENT void XRaySetAnnotationFilter( |
47 struct XRayTraceCapture* capture, uint32_t filter); | 51 struct XRayTraceCapture* capture, uint32_t filter); |
48 XRAY_NO_INSTRUMENT void XRaySaveReport(struct XRayTraceCapture* capture, | 52 XRAY_NO_INSTRUMENT void XRaySaveReport(struct XRayTraceCapture* capture, |
49 const char* filename, | 53 const char* filename, |
50 float percent_cutoff, | 54 float percent_cutoff, |
51 int cycle_cutoff); | 55 int cycle_cutoff); |
52 XRAY_NO_INSTRUMENT void XRayReport(struct XRayTraceCapture* capture, | 56 XRAY_NO_INSTRUMENT void XRayReport(struct XRayTraceCapture* capture, |
53 FILE* f, | 57 FILE* f, |
54 float percent_cutoff, | 58 float percent_cutoff, |
55 int ticks_cutoff); | 59 int ticks_cutoff); |
| 60 |
| 61 #ifndef XRAY_DISABLE_BROWSER_INTEGRATION |
| 62 XRAY_NO_INSTRUMENT void XRayBrowserTraceReport( |
| 63 struct XRayTraceCapture* capture); |
| 64 XRAY_NO_INSTRUMENT void XRayRegisterBrowserInterface( |
| 65 PPB_GetInterface get_browser_interface); |
| 66 #endif /* XRAY_DISABLE_BROWSER_INTEGRATION */ |
| 67 |
| 68 |
56 #if defined(XRAY_ANNOTATE) | 69 #if defined(XRAY_ANNOTATE) |
57 #define XRayAnnotate(...) __XRayAnnotate(__VA_ARGS__) | 70 #define XRayAnnotate(...) __XRayAnnotate(__VA_ARGS__) |
58 #define XRayAnnotateFiltered(...) __XRayAnnotateFiltered(__VA_ARGS__) | 71 #define XRayAnnotateFiltered(...) __XRayAnnotateFiltered(__VA_ARGS__) |
59 #else | 72 #else |
60 #define XRayAnnotate(...) | 73 #define XRayAnnotate(...) |
61 #define XRayAnnotateFiltered(...) | 74 #define XRayAnnotateFiltered(...) |
62 #endif | 75 #endif |
63 /* This is the end of the public XRay API */ | 76 /* This is the end of the public XRay API */ |
64 | 77 |
65 #else /* defined(XRAY) */ | 78 #else /* defined(XRAY) */ |
(...skipping 13 matching lines...) Expand all Loading... |
79 inline void XRaySetAnnotationFilter(struct XRayTraceCapture* capture, | 92 inline void XRaySetAnnotationFilter(struct XRayTraceCapture* capture, |
80 uint32_t filter) {} | 93 uint32_t filter) {} |
81 inline void XRaySaveReport(struct XRayTraceCapture* capture, | 94 inline void XRaySaveReport(struct XRayTraceCapture* capture, |
82 const char* filename, | 95 const char* filename, |
83 float percent_cutoff, | 96 float percent_cutoff, |
84 int cycle_cutoff) {} | 97 int cycle_cutoff) {} |
85 inline void XRayReport(struct XRayTraceCapture* capture, | 98 inline void XRayReport(struct XRayTraceCapture* capture, |
86 FILE* f, | 99 FILE* f, |
87 float percent_cutoff, | 100 float percent_cutoff, |
88 int ticks_cutoff); | 101 int ticks_cutoff); |
| 102 |
| 103 #ifndef XRAY_DISABLE_BROWSER_INTEGRATION |
| 104 inline void XRayBrowserTraceReport(struct XRayTraceCapture* capture) {} |
| 105 inline void XRayRegisterBrowserInterface( |
| 106 PPB_GetInterface get_browser_interface) {} |
| 107 #endif /* XRAY_DISABLE_BROWSER_INTEGRATION */ |
| 108 |
| 109 |
89 #endif /* defined(XRAY) */ | 110 #endif /* defined(XRAY) */ |
90 | 111 |
91 #ifdef __cplusplus | 112 #ifdef __cplusplus |
92 } | 113 } |
93 #endif | 114 #endif |
94 | 115 |
95 #endif /* LIBRARIES_XRAY_XRAY_H_ */ | 116 #endif /* LIBRARIES_XRAY_XRAY_H_ */ |
OLD | NEW |