From 995a28639de7f567cd6a8dffe7a96faefcabff2c Mon Sep 17 00:00:00 2001 From: Shi Lei Date: Tue, 22 Nov 2022 16:28:19 +0800 Subject: [PATCH] build,deps,src: fix Intel VTune profiling support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45248 Reviewed-By: Matteo Collina Reviewed-By: Michaël Zasso --- LICENSE | 12 + configure.py | 16 + deps/v8/.gitignore | 1 + deps/v8/third_party/ittapi/CMakeLists.txt | 93 + .../ittapi/LICENSES/BSD-3-Clause.txt | 8 + .../ittapi/LICENSES/GPL-2.0-only.txt | 103 + deps/v8/third_party/ittapi/README.md | 38 + deps/v8/third_party/ittapi/buildall.py | 169 + .../include/fortran/posix/ittnotify.f90 | 473 ++ .../include/fortran/win32/ittnotify.f90 | 522 ++ .../v8/third_party/ittapi/include/ittnotify.h | 4327 +++++++++++++++++ .../third_party/ittapi/include/jitprofiling.h | 642 +++ .../ittapi/include/legacy/ittnotify.h | 992 ++++ .../third_party/ittapi/include/libittnotify.h | 19 + .../third_party/ittapi/ittapi-rs/.gitignore | 3 + .../ittapi/ittapi-rs/CMakeLists.txt | 1 + .../third_party/ittapi/ittapi-rs/Cargo.toml | 22 + deps/v8/third_party/ittapi/ittapi-rs/LICENSES | 1 + .../v8/third_party/ittapi/ittapi-rs/README.md | 14 + deps/v8/third_party/ittapi/ittapi-rs/build.rs | 37 + deps/v8/third_party/ittapi/ittapi-rs/include | 1 + .../ittapi/ittapi-rs/src/ittnotify | 1 + .../ittapi-rs/src/ittnotify_bindings.rs | 2987 ++++++++++++ .../ittapi-rs/src/jitprofiling_bindings.rs | 1002 ++++ .../third_party/ittapi/ittapi-rs/src/lib.rs | 4 + .../ittapi-rs/tests/bindgen-up-to-date.rs | 68 + .../ittapi/src/ittnotify/disable_warnings.h | 25 + .../ittapi/src/ittnotify/ittnotify_config.h | 585 +++ .../ittapi/src/ittnotify/ittnotify_static.c | 1359 ++++++ .../ittapi/src/ittnotify/ittnotify_static.h | 346 ++ .../ittapi/src/ittnotify/ittnotify_types.h | 65 + .../ittapi/src/ittnotify/ittptmark32.S | 764 +++ .../ittapi/src/ittnotify/ittptmark32.asm | 255 + .../ittapi/src/ittnotify/ittptmark64.S | 766 +++ .../ittapi/src/ittnotify/ittptmark64.asm | 251 + .../ittapi/src/ittnotify/jitprofiling.c | 268 + .../ittapi/src/ittnotify_refcol/Makefile | 14 + .../ittapi/src/ittnotify_refcol/README.md | 26 + .../src/ittnotify_refcol/itt_refcol_impl.c | 277 ++ node.gyp | 1 + node.gypi | 8 + src/api/environment.cc | 8 +- src/node.cc | 4 + tools/license-builder.sh | 2 + tools/v8_gypfiles/d8.gyp | 7 + tools/v8_gypfiles/features.gypi | 6 + tools/v8_gypfiles/v8vtune.gyp | 39 + vcbuild.bat | 6 +- 48 files changed, 16636 insertions(+), 2 deletions(-) create mode 100644 deps/v8/third_party/ittapi/CMakeLists.txt create mode 100644 deps/v8/third_party/ittapi/LICENSES/BSD-3-Clause.txt create mode 100644 deps/v8/third_party/ittapi/LICENSES/GPL-2.0-only.txt create mode 100644 deps/v8/third_party/ittapi/README.md create mode 100755 deps/v8/third_party/ittapi/buildall.py create mode 100644 deps/v8/third_party/ittapi/include/fortran/posix/ittnotify.f90 create mode 100644 deps/v8/third_party/ittapi/include/fortran/win32/ittnotify.f90 create mode 100644 deps/v8/third_party/ittapi/include/ittnotify.h create mode 100644 deps/v8/third_party/ittapi/include/jitprofiling.h create mode 100644 deps/v8/third_party/ittapi/include/legacy/ittnotify.h create mode 100644 deps/v8/third_party/ittapi/include/libittnotify.h create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/.gitignore create mode 120000 deps/v8/third_party/ittapi/ittapi-rs/CMakeLists.txt create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/Cargo.toml create mode 120000 deps/v8/third_party/ittapi/ittapi-rs/LICENSES create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/README.md create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/build.rs create mode 120000 deps/v8/third_party/ittapi/ittapi-rs/include create mode 120000 deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify_bindings.rs create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/src/jitprofiling_bindings.rs create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/src/lib.rs create mode 100644 deps/v8/third_party/ittapi/ittapi-rs/tests/bindgen-up-to-date.rs create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/disable_warnings.h create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittnotify_config.h create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.c create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.h create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittnotify_types.h create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.S create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.asm create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.S create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.asm create mode 100644 deps/v8/third_party/ittapi/src/ittnotify/jitprofiling.c create mode 100644 deps/v8/third_party/ittapi/src/ittnotify_refcol/Makefile create mode 100644 deps/v8/third_party/ittapi/src/ittnotify_refcol/README.md create mode 100644 deps/v8/third_party/ittapi/src/ittnotify_refcol/itt_refcol_impl.c create mode 100644 tools/v8_gypfiles/v8vtune.gyp diff --git a/LICENSE b/LICENSE index ca39b2cd1fdfc4..cbcc28ce972135 100644 --- a/LICENSE +++ b/LICENSE @@ -107,6 +107,18 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ +- ittapi, located at deps/v8/third_party/ittapi, is licensed as follows: + """ + Copyright (c) 2019 Intel Corporation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ + - ICU, located at deps/icu-small, is licensed as follows: """ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE diff --git a/configure.py b/configure.py index c1ac3824b2aeef..bc21faef7d09de 100755 --- a/configure.py +++ b/configure.py @@ -160,6 +160,13 @@ help="Generate an executable with libgcc and libstdc++ libraries. This " "will not work on OSX when using the default compilation environment") +parser.add_argument("--enable-vtune-profiling", + action="store_true", + dest="enable_vtune_profiling", + help="Enable profiling support for Intel VTune profiler to profile " + "JavaScript code executed in Node.js. This feature is only available " + "for x32, x86, and x64 architectures.") + parser.add_argument("--enable-pgo-generate", action="store_true", dest="enable_pgo_generate", @@ -1309,6 +1316,15 @@ def configure_node(o): if flavor == 'aix': o['variables']['node_target_type'] = 'static_library' + if target_arch in ('x86', 'x64', 'ia32', 'x32'): + o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling) + elif options.enable_vtune_profiling: + raise Exception( + 'The VTune profiler for JavaScript is only supported on x32, x86, and x64 ' + 'architectures.') + else: + o['variables']['node_enable_v8_vtunejit'] = 'false' + if flavor != 'linux' and (options.enable_pgo_generate or options.enable_pgo_use): raise Exception( 'The pgo option is supported only on linux.') diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index b8d1d934bcf610..b453d6ad33c4e1 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -121,3 +121,4 @@ bazel-v8 /third_party/zlib/contrib/bench /third_party/zlib/contrib/tests /third_party/zlib/google/test +!/third_party/ittapi diff --git a/deps/v8/third_party/ittapi/CMakeLists.txt b/deps/v8/third_party/ittapi/CMakeLists.txt new file mode 100644 index 00000000000000..0e3baac30511ef --- /dev/null +++ b/deps/v8/third_party/ittapi/CMakeLists.txt @@ -0,0 +1,93 @@ +# +# Copyright (C) 2005-2019 Intel Corporation +# +# SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +# + +cmake_minimum_required(VERSION 2.8.12) + +project(ittapi) + +OPTION(FORCE_32 "Force a 32bit compile on 64bit" OFF) +OPTION(ITT_API_IPT_SUPPORT "ptmarks support") + +IF(FORCE_32 AND UNIX) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") +ENDIF() + +if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE_32)) + set(ARCH_64 1) +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) + if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + endif() +else() + if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") + endif() + add_definitions(-DNDEBUG) +endif() + +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) + +foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) + string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG ) + set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${LIBRARY_OUTPUT_PATH} ) +endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) + +set(ITT_PUBLIC_HDRS + include/ittnotify.h + include/jitprofiling.h + include/libittnotify.h +) + +if (ITT_API_IPT_SUPPORT) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DITT_API_IPT_SUPPORT") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DITT_API_IPT_SUPPORT") + if (NOT WIN32) + enable_language(ASM) + if (ARCH_64) + set(ITT_PT src/ittnotify/ittptmark64.S) + else() + set(ASM_OPTIONS "-m32") + set(ITT_PT src/ittnotify/ittptmark32.S) + endif() + set(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS}" ) + else() + enable_language(ASM_MASM) + if (ARCH_64) + set(ITT_PT src/ittnotify/ittptmark64.asm) + else() + set(ITT_PT src/ittnotify/ittptmark32.asm) + endif() + endif() +endif() + +file(GLOB ITT_SRCS "src/ittnotify/*.c" "src/ittnotify/*.h") + +add_library(ittnotify STATIC ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PT}) + +if(WIN32) + SET_TARGET_PROPERTIES(ittnotify PROPERTIES OUTPUT_NAME libittnotify) +else() + SET_TARGET_PROPERTIES(ittnotify PROPERTIES OUTPUT_NAME ittnotify) +endif() + +if (NOT WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + TARGET_LINK_LIBRARIES(ittnotify dl) +endif() + +SET_TARGET_PROPERTIES(ittnotify PROPERTIES LINKER_LANGUAGE C) + +target_include_directories(ittnotify + PUBLIC include src/ittnotify +) + +set(CMAKE_SUPPRESS_REGENERATION true) diff --git a/deps/v8/third_party/ittapi/LICENSES/BSD-3-Clause.txt b/deps/v8/third_party/ittapi/LICENSES/BSD-3-Clause.txt new file mode 100644 index 00000000000000..37478a55f35f5a --- /dev/null +++ b/deps/v8/third_party/ittapi/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,8 @@ +Copyright (c) 2019 Intel Corporation. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/v8/third_party/ittapi/LICENSES/GPL-2.0-only.txt b/deps/v8/third_party/ittapi/LICENSES/GPL-2.0-only.txt new file mode 100644 index 00000000000000..be1e815450496e --- /dev/null +++ b/deps/v8/third_party/ittapi/LICENSES/GPL-2.0-only.txt @@ -0,0 +1,103 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) < yyyy> + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/deps/v8/third_party/ittapi/README.md b/deps/v8/third_party/ittapi/README.md new file mode 100644 index 00000000000000..4844f55651706a --- /dev/null +++ b/deps/v8/third_party/ittapi/README.md @@ -0,0 +1,38 @@ +Intel® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API +================================================================================== + +This ITT/JIT open source profiling API includes: + + - Instrumentation and Tracing Technology (ITT) API + - Just-In-Time (JIT) Profiling API + +The Instrumentation and Tracing Technology (ITT) API enables your application +to generate and control the collection of trace data during its execution +across different Intel tools. + +ITT API consists of two parts: a _static part_ and a _dynamic part_. The +_dynamic part_ is specific for a tool and distributed only with a particular +tool. The _static part_ is a common part shared between tools. Currently, the +static part of ITT API is distributed as a static library and released under +a BSD/GPLv2 dual license with every tool supporting ITT API. + +### Build + +To build the library: + - On Windows, Linux and OSX: requires [cmake](https://cmake.org) to be set in `PATH` + - Windows: requires Visual Studio installed or requires [Ninja](https://github.com/ninja-build/ninja/releases) to be set in `PATH` + - To list available build options execute: `python buildall.py -h` +``` +usage: buildall.py [-h] [-d] [-c] [-v] [-pt] [--force_bits] + +optional arguments: + -h, --help show this help message and exit + -d, --debug specify debug build configuration (release by default) + -c, --clean delete any intermediate and output files + -v, --verbose enable verbose output from build process + -pt, --ptmark enable anomaly detection support + --force_bits specify bit version for the target +``` +### License + +All code in the repo is dual licensed under GPLv2 and 3-Clause BSD licenses diff --git a/deps/v8/third_party/ittapi/buildall.py b/deps/v8/third_party/ittapi/buildall.py new file mode 100755 index 00000000000000..f03eafbe7c89ee --- /dev/null +++ b/deps/v8/third_party/ittapi/buildall.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python +# +# Copyright (C) 2005-2019 Intel Corporation +# +# SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +# + +from __future__ import print_function +import os +import sys +import shutil +import fnmatch +import subprocess + + +def run_shell(cmd): + print("\n>>", cmd) + os.system(cmd) + + +if sys.platform == 'win32': + def read_registry(path, depth=0xFFFFFFFF, statics={}): + try: + import _winreg + except ImportError: + import winreg as _winreg + parts = path.split('\\') + hub = parts[0] + path = '\\'.join(parts[1:]) + if not statics: + statics['hubs'] = {'HKLM': _winreg.HKEY_LOCAL_MACHINE, 'HKCL': _winreg.HKEY_CLASSES_ROOT} + + def enum_nodes(curpath, level): + if level < 1: + return {} + res = {} + try: + aKey = _winreg.OpenKey(statics['hubs'][hub], curpath, 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY) + except WindowsError: + return res + + try: + i = 0 + while True: + name, value, _ = _winreg.EnumValue(aKey, i) + i += 1 + res[name] = value + except WindowsError: + pass + + keys = [] + try: + i = 0 + while True: + key = _winreg.EnumKey(aKey, i) + i += 1 + keys.append(key) + except WindowsError: + pass + + _winreg.CloseKey(aKey) + + for key in keys: + res[key] = enum_nodes(curpath + '\\' + key, level - 1) + + return res + + return enum_nodes(path, depth) + + +def get_vs_versions(): # https://www.mztools.com/articles/2008/MZ2008003.aspx + if sys.platform != 'win32': + return [] + versions = [] + + hkcl = read_registry(r'HKCL', 1) + for key in hkcl: + if 'VisualStudio.DTE.' in key: + version = key.split('.')[2] + if int(version) >= 12: + versions.append(version) + + if not versions: + print("No Visual Studio version found") + return sorted(versions) + + +def detect_cmake(): + if sys.platform == 'darwin': + path, err = subprocess.Popen("which cmake", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + if not path.strip(): + path, err = subprocess.Popen("which xcrun", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + if not path.strip(): + print("No cmake and no XCode found...") + return None + return 'xcrun cmake' + return 'cmake' + + +def main(): + import argparse + parser = argparse.ArgumentParser() + vs_versions = get_vs_versions() + parser.add_argument("-d", "--debug", help="specify debug build configuration (release by default)", action="store_true") + parser.add_argument("-c", "--clean", help="delete any intermediate and output files", action="store_true") + parser.add_argument("-v", "--verbose", help="enable verbose output from build process", action="store_true") + parser.add_argument("-pt", "--ptmark", help="enable anomaly detection support", action="store_true") + parser.add_argument("--force_bits", choices=["32", "64"], help="specify bit version for the target") + if sys.platform == 'win32' and vs_versions: + parser.add_argument("--vs", help="specify visual studio version {default}", choices=vs_versions, default=vs_versions[0]) + args = parser.parse_args() + + if args.force_bits: + target_bits = [args.force_bits] + else: + target_bits = ['64'] + if (sys.platform != 'darwin'): # on MAC OSX we produce FAT library including both 32 and 64 bits + target_bits.append('32') + + print("target_bits", target_bits) + work_dir = os.getcwd() + if args.clean: + bin_dir = os.path.join(work_dir, 'bin') + if os.path.exists(bin_dir): + shutil.rmtree(bin_dir) + for bits in target_bits: + work_folder = os.path.join(work_dir, "build_" + (sys.platform.replace('32', "")), bits) + already_there = os.path.exists(work_folder) + if already_there and args.clean: + shutil.rmtree(work_folder) + already_there = False + if not already_there: + os.makedirs(work_folder) + print("work_folder: ", work_folder) + os.chdir(work_folder) + if args.clean: + continue + + cmake = detect_cmake() + if not cmake: + print("Error: cmake is not found") + return + + if sys.platform == 'win32': + if vs_versions: + generator = ('Visual Studio %s' % args.vs) + (' Win64' if bits == '64' else '') + else: + generator = 'Ninja' + else: + generator = 'Unix Makefiles' + run_shell('%s "%s" -G"%s" %s' % (cmake, work_dir, generator, " ".join([ + ("-DFORCE_32=ON" if bits == '32' else ""), + ("-DCMAKE_BUILD_TYPE=Debug" if args.debug else ""), + ('-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' if args.verbose else ''), + ("-DITT_API_IPT_SUPPORT=1" if args.ptmark else "") + ]))) + if sys.platform == 'win32': + target_project = 'ALL_BUILD' + run_shell('%s --build . --config %s --target %s' % (cmake, ('Debug' if args.debug else 'Release'), target_project)) + else: + import glob + run_shell('%s --build . --config %s' % (cmake, ('Debug' if args.debug else 'Release'))) + if ('linux' in sys.platform and bits == '64'): + continue + run_shell('%s --build . --config %s --target' % (cmake, ('Debug' if args.debug else 'Release'))) + +if __name__== "__main__": + main() + diff --git a/deps/v8/third_party/ittapi/include/fortran/posix/ittnotify.f90 b/deps/v8/third_party/ittapi/include/fortran/posix/ittnotify.f90 new file mode 100644 index 00000000000000..9a9aa2c2bc9af0 --- /dev/null +++ b/deps/v8/third_party/ittapi/include/fortran/posix/ittnotify.f90 @@ -0,0 +1,473 @@ +! ======================================================================== +! +! This file is provided under a dual BSD/GPLv2 license. When using or +! redistributing this file, you may do so under either license. +! +! GPL LICENSE SUMMARY +! +! Copyright (c) 2005-2017 Intel Corporation. All rights reserved. +! +! This program is free software; you can redistribute it and/or modify +! it under the terms of version 2 of the GNU General Public License as +! published by the Free Software Foundation. +! +! This program is distributed in the hope that it will be useful, but +! WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +! General Public License for more details. +! +! You should have received a copy of the GNU General Public License +! along with this program; if not, write to the Free Software +! Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +! The full GNU General Public License is included in this distribution +! in the file called LICENSE.GPL. +! +! Contact Information: +! http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ +! +! BSD LICENSE +! +! Copyright (c) 2005-2017 Intel Corporation. All rights reserved. +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! * Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in +! the documentation and/or other materials provided with the +! distribution. +! * Neither the name of Intel Corporation nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +! A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +! OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +! +! ======================================================================== +! + +!-------- +! +! This file defines functions used by Intel(R) Parallel Inspector and +! Amplifier. +! +! Version of ittnotify that was used to generate this file. +! This is not Fortran code that can be used to check but rather a comment +! that only serves to identify the interface. +! INTEL_ITT_FORTRAN_API_VERSION 3.0 +!-------- + +module ittnotify + use, intrinsic :: iso_c_binding, only: C_PTR, C_FUNPTR, C_INT, C_CHAR, C_NULL_CHAR, C_F_PROCPOINTER, C_LOC, C_ASSOCIATED + implicit none + + !-------- + ! + ! Public interface + ! + !-------- + integer, parameter :: itt_ptr = int_ptr_kind() + public :: itt_pause + public :: itt_resume + public :: itt_thread_ignore + public :: itt_suppress_push + public :: itt_suppress_pop + public :: itt_suppress_mark_range + public :: itt_suppress_clear_range + public :: itt_sync_prepare + public :: itt_sync_cancel + public :: itt_sync_acquired + public :: itt_sync_releasing + public :: itt_fsync_prepare + public :: itt_fsync_cancel + public :: itt_fsync_acquired + public :: itt_fsync_releasing + public :: itt_sync_destroy + public :: itt_sync_create + public :: itt_sync_rename + public :: itt_thread_set_name + public :: itt_heap_record_memory_growth_begin + public :: itt_heap_record_memory_growth_end + public :: itt_heap_reset_detection + public :: itt_heap_record + + integer, parameter, public :: itt_attr_barrier = 1 + integer, parameter, public :: itt_attr_mutex = 2 + integer, parameter, public :: itt_suppress_threading_errors = 255 + integer, parameter, public :: itt_suppress_memory_errors = 65280 + integer, parameter, public :: itt_suppress_all_errors = 2147483647 + integer, parameter, public :: itt_unsuppress_range = 0 + integer, parameter, public :: itt_suppress_range = 1 + integer, parameter, public :: itt_heap_leaks = 1 + integer, parameter, public :: itt_heap_growth = 2 + + private + + abstract interface + + subroutine itt_proc_none() bind(C) + import + end subroutine itt_proc_none + + subroutine itt_proc_sup_push(mask) bind(C) + import + integer, intent(in), value :: mask + end subroutine itt_proc_sup_push + + subroutine itt_proc_sup_range(action, mask, addr, size) bind(C) + import + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + end subroutine itt_proc_sup_range + + subroutine itt_proc_address(addr) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + end subroutine itt_proc_address + + subroutine itt_proc_create(addr, objname, attribute) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + character(kind=C_CHAR), dimension(*), intent(in) :: objname + integer, intent(in), value :: attribute + end subroutine itt_proc_create + + subroutine itt_proc_name(name) bind(C) + import + character(kind=C_CHAR), dimension(*), intent(in) :: name + end subroutine itt_proc_name + + subroutine itt_proc_rename(addr, objname) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + character(kind=C_CHAR), dimension(*), intent(in) :: objname + end subroutine itt_proc_rename + + subroutine itt_proc_heapmask(heapmask) bind(C) + import + integer, intent(in), value :: heapmask + end subroutine itt_proc_heapmask + + end interface + + type(C_FUNPTR) :: itt_pause_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_pause_ptr__3_0' :: itt_pause_fort_ptr + type(C_FUNPTR) :: itt_resume_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_resume_ptr__3_0' :: itt_resume_fort_ptr + type(C_FUNPTR) :: itt_thread_ignore_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_thread_ignore_ptr__3_0' :: itt_thread_ignore_fort_ptr + type(C_FUNPTR) :: itt_suppress_push_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_push_ptr__3_0' :: itt_suppress_push_fort_ptr + type(C_FUNPTR) :: itt_suppress_pop_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_pop_ptr__3_0' :: itt_suppress_pop_fort_ptr + type(C_FUNPTR) :: itt_suppress_mark_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_mark_range_ptr__3_0' :: itt_suppress_mark_range_fort_ptr + type(C_FUNPTR) :: itt_suppress_clear_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_clear_range_ptr__3_0' :: itt_suppress_clear_range_fort_ptr + type(C_FUNPTR) :: itt_sync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_prepare_ptr__3_0' :: itt_sync_prepare_fort_ptr + type(C_FUNPTR) :: itt_sync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_cancel_ptr__3_0' :: itt_sync_cancel_fort_ptr + type(C_FUNPTR) :: itt_sync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_acquired_ptr__3_0' :: itt_sync_acquired_fort_ptr + type(C_FUNPTR) :: itt_sync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_releasing_ptr__3_0' :: itt_sync_releasing_fort_ptr + type(C_FUNPTR) :: itt_fsync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_prepare_ptr__3_0' :: itt_fsync_prepare_fort_ptr + type(C_FUNPTR) :: itt_fsync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_cancel_ptr__3_0' :: itt_fsync_cancel_fort_ptr + type(C_FUNPTR) :: itt_fsync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_acquired_ptr__3_0' :: itt_fsync_acquired_fort_ptr + type(C_FUNPTR) :: itt_fsync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_releasing_ptr__3_0' :: itt_fsync_releasing_fort_ptr + type(C_FUNPTR) :: itt_sync_destroy_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_destroy_ptr__3_0' :: itt_sync_destroy_fort_ptr + type(C_FUNPTR) :: itt_sync_create_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_create_ptr__3_0' :: itt_sync_create_fort_ptr + type(C_FUNPTR) :: itt_sync_rename_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_rename_ptr__3_0' :: itt_sync_rename_fort_ptr + type(C_FUNPTR) :: itt_thread_set_name_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_thread_set_name_ptr__3_0' :: itt_thread_set_name_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_begin_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_memory_growth_begin_ptr__3_0' :: itt_heap_record_memory_growth_begin_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_end_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_memory_growth_end_ptr__3_0' :: itt_heap_record_memory_growth_end_fort_ptr + type(C_FUNPTR) :: itt_heap_reset_detection_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_reset_detection_ptr__3_0' :: itt_heap_reset_detection_fort_ptr + type(C_FUNPTR) :: itt_heap_record_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_ptr__3_0' :: itt_heap_record_fort_ptr + + contains + + subroutine itt_pause() + procedure(itt_proc_none), pointer :: pause_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_pause + if (C_ASSOCIATED(itt_pause_fort_ptr)) then + call C_F_PROCPOINTER(itt_pause_fort_ptr, pause_ptr) + call pause_ptr() + end if + end subroutine itt_pause + + subroutine itt_resume() + procedure(itt_proc_none), pointer :: resume_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_resume + if (C_ASSOCIATED(itt_resume_fort_ptr)) then + call C_F_PROCPOINTER(itt_resume_fort_ptr, resume_ptr) + call resume_ptr() + end if + end subroutine itt_resume + + subroutine itt_thread_ignore() + procedure(itt_proc_none), pointer :: thread_ignore_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_thread_ignore + if (C_ASSOCIATED(itt_thread_ignore_fort_ptr)) then + call C_F_PROCPOINTER(itt_thread_ignore_fort_ptr, thread_ignore_ptr) + call thread_ignore_ptr() + end if + end subroutine itt_thread_ignore + + subroutine itt_suppress_push(mask) + procedure(itt_proc_sup_push), pointer :: suppress_push_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_push + integer, intent(in), value :: mask + if (C_ASSOCIATED(itt_suppress_push_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_push_fort_ptr, suppress_push_ptr) + call suppress_push_ptr(mask) + end if + end subroutine itt_suppress_push + + subroutine itt_suppress_pop() + procedure(itt_proc_none), pointer :: suppress_pop_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_pop + if (C_ASSOCIATED(itt_suppress_pop_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_pop_fort_ptr, suppress_pop_ptr) + call suppress_pop_ptr() + end if + end subroutine itt_suppress_pop + + subroutine itt_suppress_mark_range(action, mask, addr, size) + procedure(itt_proc_sup_range), pointer :: suppress_mark_range_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_mark_range + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + if (C_ASSOCIATED(itt_suppress_mark_range_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_mark_range_fort_ptr, suppress_mark_range_ptr) + call suppress_mark_range_ptr(action, mask, addr, size) + end if + end subroutine itt_suppress_mark_range + + subroutine itt_suppress_clear_range(action, mask, addr, size) + procedure(itt_proc_sup_range), pointer :: suppress_clear_range_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_clear_range + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + if (C_ASSOCIATED(itt_suppress_clear_range_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_clear_range_fort_ptr, suppress_clear_range_ptr) + call suppress_clear_range_ptr(action, mask, addr, size) + end if + end subroutine itt_suppress_clear_range + + subroutine itt_sync_prepare(addr) + procedure(itt_proc_address), pointer :: sync_prepare_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_prepare + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_prepare_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_prepare_fort_ptr, sync_prepare_ptr) + call sync_prepare_ptr(addr) + end if + end subroutine itt_sync_prepare + + subroutine itt_sync_cancel(addr) + procedure(itt_proc_address), pointer :: sync_cancel_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_cancel + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_cancel_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_cancel_fort_ptr, sync_cancel_ptr) + call sync_cancel_ptr(addr) + end if + end subroutine itt_sync_cancel + + subroutine itt_sync_acquired(addr) + procedure(itt_proc_address), pointer :: sync_acquired_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_acquired + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_acquired_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_acquired_fort_ptr, sync_acquired_ptr) + call sync_acquired_ptr(addr) + end if + end subroutine itt_sync_acquired + + subroutine itt_sync_releasing(addr) + procedure(itt_proc_address), pointer :: sync_releasing_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_releasing + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_releasing_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_releasing_fort_ptr, sync_releasing_ptr) + call sync_releasing_ptr(addr) + end if + end subroutine itt_sync_releasing + + subroutine itt_fsync_prepare(addr) + procedure(itt_proc_address), pointer :: fsync_prepare_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_prepare + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_prepare_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_prepare_fort_ptr, fsync_prepare_ptr) + call fsync_prepare_ptr(addr) + end if + end subroutine itt_fsync_prepare + + subroutine itt_fsync_cancel(addr) + procedure(itt_proc_address), pointer :: fsync_cancel_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_cancel + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_cancel_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_cancel_fort_ptr, fsync_cancel_ptr) + call fsync_cancel_ptr(addr) + end if + end subroutine itt_fsync_cancel + + subroutine itt_fsync_acquired(addr) + procedure(itt_proc_address), pointer :: fsync_acquired_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_acquired + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_acquired_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_acquired_fort_ptr, fsync_acquired_ptr) + call fsync_acquired_ptr(addr) + end if + end subroutine itt_fsync_acquired + + subroutine itt_fsync_releasing(addr) + procedure(itt_proc_address), pointer :: fsync_releasing_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_releasing + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_releasing_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_releasing_fort_ptr, fsync_releasing_ptr) + call fsync_releasing_ptr(addr) + end if + end subroutine itt_fsync_releasing + + subroutine itt_sync_destroy(addr) + procedure(itt_proc_address), pointer :: sync_destroy_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_destroy + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_destroy_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_destroy_fort_ptr, sync_destroy_ptr) + call sync_destroy_ptr(addr) + end if + end subroutine itt_sync_destroy + + subroutine itt_sync_create(addr, objname, attribute) + procedure(itt_proc_create), pointer :: sync_create_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_create + integer(kind=itt_ptr), intent(in), value :: addr + character(len=*), intent(in) :: objname + integer, intent(in), value :: attribute + CHARACTER(LEN=1,KIND=C_CHAR) :: objnametmp(LEN_TRIM(objname)+1) + INTEGER :: iobjname, nobjname + if (C_ASSOCIATED(itt_sync_create_fort_ptr)) then + nobjname = LEN_TRIM(objname) + DO iobjname = 1, nobjname + objnametmp(iobjname) = objname(iobjname:iobjname) + END DO + objnametmp(nobjname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_sync_create_fort_ptr, sync_create_ptr) + call sync_create_ptr(addr, objnametmp, attribute) + end if + end subroutine itt_sync_create + + subroutine itt_sync_rename(addr, objname) + procedure(itt_proc_rename), pointer :: sync_rename_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_rename + integer(kind=itt_ptr), intent(in), value :: addr + character(len=*), intent(in) :: objname + CHARACTER(LEN=1,KIND=C_CHAR) :: objnametmp(LEN_TRIM(objname)+1) + INTEGER :: iobjname, nobjname + if (C_ASSOCIATED(itt_sync_rename_fort_ptr)) then + nobjname = LEN_TRIM(objname) + DO iobjname = 1, nobjname + objnametmp(iobjname) = objname(iobjname:iobjname) + END DO + objnametmp(nobjname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_sync_rename_fort_ptr, sync_rename_ptr) + call sync_rename_ptr(addr, objnametmp) + end if + end subroutine itt_sync_rename + + subroutine itt_thread_set_name(name) + procedure(itt_proc_name), pointer :: thread_set_name_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_thread_set_name + character(len=*), intent(in) :: name + CHARACTER(LEN=1,KIND=C_CHAR) :: nametmp(LEN_TRIM(name)+1) + INTEGER :: iname, nname + if (C_ASSOCIATED(itt_thread_set_name_fort_ptr)) then + nname = LEN_TRIM(name) + DO iname = 1, nname + nametmp(iname) = name(iname:iname) + END DO + nametmp(nname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_thread_set_name_fort_ptr, thread_set_name_ptr) + call thread_set_name_ptr(nametmp) + end if + end subroutine itt_thread_set_name + + subroutine itt_heap_record_memory_growth_begin() + procedure(itt_proc_none), pointer :: heap_record_memory_growth_begin_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record_memory_growth_begin + if (C_ASSOCIATED(itt_heap_record_memory_growth_begin_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_memory_growth_begin_fort_ptr, heap_record_memory_growth_begin_ptr) + call heap_record_memory_growth_begin_ptr() + end if + end subroutine itt_heap_record_memory_growth_begin + + subroutine itt_heap_record_memory_growth_end() + procedure(itt_proc_none), pointer :: heap_record_memory_growth_end_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record_memory_growth_end + if (C_ASSOCIATED(itt_heap_record_memory_growth_end_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_memory_growth_end_fort_ptr, heap_record_memory_growth_end_ptr) + call heap_record_memory_growth_end_ptr() + end if + end subroutine itt_heap_record_memory_growth_end + + subroutine itt_heap_reset_detection(heapmask) + procedure(itt_proc_heapmask), pointer :: heap_reset_detection_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_reset_detection + integer, intent(in), value :: heapmask + if (C_ASSOCIATED(itt_heap_reset_detection_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_reset_detection_fort_ptr, heap_reset_detection_ptr) + call heap_reset_detection_ptr(heapmask) + end if + end subroutine itt_heap_reset_detection + + subroutine itt_heap_record(heapmask) + procedure(itt_proc_heapmask), pointer :: heap_record_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record + integer, intent(in), value :: heapmask + if (C_ASSOCIATED(itt_heap_record_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_fort_ptr, heap_record_ptr) + call heap_record_ptr(heapmask) + end if + end subroutine itt_heap_record + + + end module ittnotify + diff --git a/deps/v8/third_party/ittapi/include/fortran/win32/ittnotify.f90 b/deps/v8/third_party/ittapi/include/fortran/win32/ittnotify.f90 new file mode 100644 index 00000000000000..ebbcd3d3100035 --- /dev/null +++ b/deps/v8/third_party/ittapi/include/fortran/win32/ittnotify.f90 @@ -0,0 +1,522 @@ +! ======================================================================== +! +! This file is provided under a dual BSD/GPLv2 license. When using or +! redistributing this file, you may do so under either license. +! +! GPL LICENSE SUMMARY +! +! Copyright (c) 2005-2017 Intel Corporation. All rights reserved. +! +! This program is free software; you can redistribute it and/or modify +! it under the terms of version 2 of the GNU General Public License as +! published by the Free Software Foundation. +! +! This program is distributed in the hope that it will be useful, but +! WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +! General Public License for more details. +! +! You should have received a copy of the GNU General Public License +! along with this program; if not, write to the Free Software +! Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +! The full GNU General Public License is included in this distribution +! in the file called LICENSE.GPL. +! +! Contact Information: +! http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ +! +! BSD LICENSE +! +! Copyright (c) 2005-2017 Intel Corporation. All rights reserved. +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! * Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in +! the documentation and/or other materials provided with the +! distribution. +! * Neither the name of Intel Corporation nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +! A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +! OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +! +! ======================================================================== +! + +!-------- +! +! This file defines functions used by Intel(R) Parallel Inspector and +! Amplifier. +! +! Version of ittnotify that was used to generate this file. +! This is not Fortran code that can be used to check but rather a comment +! that only serves to identify the interface. +! INTEL_ITT_FORTRAN_API_VERSION 3.0 +!-------- + +module ittnotify + use, intrinsic :: iso_c_binding, only: C_PTR, C_FUNPTR, C_INT, C_CHAR, C_NULL_CHAR, C_F_PROCPOINTER, C_LOC, C_ASSOCIATED + implicit none + + !-------- + ! + ! Public interface + ! + !-------- + integer, parameter :: itt_ptr = int_ptr_kind() + public :: itt_pause + public :: itt_resume + public :: itt_thread_ignore + public :: itt_suppress_push + public :: itt_suppress_pop + public :: itt_suppress_mark_range + public :: itt_suppress_clear_range + public :: itt_sync_prepare + public :: itt_sync_cancel + public :: itt_sync_acquired + public :: itt_sync_releasing + public :: itt_fsync_prepare + public :: itt_fsync_cancel + public :: itt_fsync_acquired + public :: itt_fsync_releasing + public :: itt_sync_destroy + public :: itt_sync_create + public :: itt_sync_rename + public :: itt_thread_set_name + public :: itt_heap_record_memory_growth_begin + public :: itt_heap_record_memory_growth_end + public :: itt_heap_reset_detection + public :: itt_heap_record + + integer, parameter, public :: itt_attr_barrier = 1 + integer, parameter, public :: itt_attr_mutex = 2 + integer, parameter, public :: itt_suppress_threading_errors = 255 + integer, parameter, public :: itt_suppress_memory_errors = 65280 + integer, parameter, public :: itt_suppress_all_errors = 2147483647 + integer, parameter, public :: itt_unsuppress_range = 0 + integer, parameter, public :: itt_suppress_range = 1 + integer, parameter, public :: itt_heap_leaks = 1 + integer, parameter, public :: itt_heap_growth = 2 + + private + + abstract interface + + subroutine itt_proc_none() bind(C) + import + end subroutine itt_proc_none + + subroutine itt_proc_sup_push(mask) bind(C) + import + integer, intent(in), value :: mask + end subroutine itt_proc_sup_push + + subroutine itt_proc_sup_range(action, mask, addr, size) bind(C) + import + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + end subroutine itt_proc_sup_range + + subroutine itt_proc_address(addr) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + end subroutine itt_proc_address + + subroutine itt_proc_create(addr, objname, attribute) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + character(kind=C_CHAR), dimension(*), intent(in) :: objname + integer, intent(in), value :: attribute + end subroutine itt_proc_create + + subroutine itt_proc_name(name) bind(C) + import + character(kind=C_CHAR), dimension(*), intent(in) :: name + end subroutine itt_proc_name + + subroutine itt_proc_rename(addr, objname) bind(C) + import + integer(kind=itt_ptr), intent(in), value :: addr + character(kind=C_CHAR), dimension(*), intent(in) :: objname + end subroutine itt_proc_rename + + subroutine itt_proc_heapmask(heapmask) bind(C) + import + integer, intent(in), value :: heapmask + end subroutine itt_proc_heapmask + + end interface + + !DEC$IF DEFINED(intel64) + type(C_FUNPTR) :: itt_pause_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_pause_ptr__3_0' :: itt_pause_fort_ptr + type(C_FUNPTR) :: itt_resume_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_resume_ptr__3_0' :: itt_resume_fort_ptr + type(C_FUNPTR) :: itt_thread_ignore_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_thread_ignore_ptr__3_0' :: itt_thread_ignore_fort_ptr + type(C_FUNPTR) :: itt_suppress_push_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_push_ptr__3_0' :: itt_suppress_push_fort_ptr + type(C_FUNPTR) :: itt_suppress_pop_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_pop_ptr__3_0' :: itt_suppress_pop_fort_ptr + type(C_FUNPTR) :: itt_suppress_mark_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_mark_range_ptr__3_0' :: itt_suppress_mark_range_fort_ptr + type(C_FUNPTR) :: itt_suppress_clear_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_suppress_clear_range_ptr__3_0' :: itt_suppress_clear_range_fort_ptr + type(C_FUNPTR) :: itt_sync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_prepare_ptr__3_0' :: itt_sync_prepare_fort_ptr + type(C_FUNPTR) :: itt_sync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_cancel_ptr__3_0' :: itt_sync_cancel_fort_ptr + type(C_FUNPTR) :: itt_sync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_acquired_ptr__3_0' :: itt_sync_acquired_fort_ptr + type(C_FUNPTR) :: itt_sync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_releasing_ptr__3_0' :: itt_sync_releasing_fort_ptr + type(C_FUNPTR) :: itt_fsync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_prepare_ptr__3_0' :: itt_fsync_prepare_fort_ptr + type(C_FUNPTR) :: itt_fsync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_cancel_ptr__3_0' :: itt_fsync_cancel_fort_ptr + type(C_FUNPTR) :: itt_fsync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_acquired_ptr__3_0' :: itt_fsync_acquired_fort_ptr + type(C_FUNPTR) :: itt_fsync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_fsync_releasing_ptr__3_0' :: itt_fsync_releasing_fort_ptr + type(C_FUNPTR) :: itt_sync_destroy_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_destroy_ptr__3_0' :: itt_sync_destroy_fort_ptr + type(C_FUNPTR) :: itt_sync_create_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_createA_ptr__3_0' :: itt_sync_create_fort_ptr + type(C_FUNPTR) :: itt_sync_rename_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_sync_renameA_ptr__3_0' :: itt_sync_rename_fort_ptr + type(C_FUNPTR) :: itt_thread_set_name_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_thread_set_nameA_ptr__3_0' :: itt_thread_set_name_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_begin_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_memory_growth_begin_ptr__3_0' :: itt_heap_record_memory_growth_begin_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_end_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_memory_growth_end_ptr__3_0' :: itt_heap_record_memory_growth_end_fort_ptr + type(C_FUNPTR) :: itt_heap_reset_detection_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_reset_detection_ptr__3_0' :: itt_heap_reset_detection_fort_ptr + type(C_FUNPTR) :: itt_heap_record_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'__itt_heap_record_ptr__3_0' :: itt_heap_record_fort_ptr + !DEC$ELSE + type(C_FUNPTR) :: itt_pause_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_pause_ptr__3_0' :: itt_pause_fort_ptr + type(C_FUNPTR) :: itt_resume_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_resume_ptr__3_0' :: itt_resume_fort_ptr + type(C_FUNPTR) :: itt_thread_ignore_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_thread_ignore_ptr__3_0' :: itt_thread_ignore_fort_ptr + type(C_FUNPTR) :: itt_suppress_push_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_suppress_push_ptr__3_0' :: itt_suppress_push_fort_ptr + type(C_FUNPTR) :: itt_suppress_pop_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_suppress_pop_ptr__3_0' :: itt_suppress_pop_fort_ptr + type(C_FUNPTR) :: itt_suppress_mark_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_suppress_mark_range_ptr__3_0' :: itt_suppress_mark_range_fort_ptr + type(C_FUNPTR) :: itt_suppress_clear_range_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_suppress_clear_range_ptr__3_0' :: itt_suppress_clear_range_fort_ptr + type(C_FUNPTR) :: itt_sync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_prepare_ptr__3_0' :: itt_sync_prepare_fort_ptr + type(C_FUNPTR) :: itt_sync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_cancel_ptr__3_0' :: itt_sync_cancel_fort_ptr + type(C_FUNPTR) :: itt_sync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_acquired_ptr__3_0' :: itt_sync_acquired_fort_ptr + type(C_FUNPTR) :: itt_sync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_releasing_ptr__3_0' :: itt_sync_releasing_fort_ptr + type(C_FUNPTR) :: itt_fsync_prepare_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_fsync_prepare_ptr__3_0' :: itt_fsync_prepare_fort_ptr + type(C_FUNPTR) :: itt_fsync_cancel_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_fsync_cancel_ptr__3_0' :: itt_fsync_cancel_fort_ptr + type(C_FUNPTR) :: itt_fsync_acquired_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_fsync_acquired_ptr__3_0' :: itt_fsync_acquired_fort_ptr + type(C_FUNPTR) :: itt_fsync_releasing_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_fsync_releasing_ptr__3_0' :: itt_fsync_releasing_fort_ptr + type(C_FUNPTR) :: itt_sync_destroy_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_destroy_ptr__3_0' :: itt_sync_destroy_fort_ptr + type(C_FUNPTR) :: itt_sync_create_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_createA_ptr__3_0' :: itt_sync_create_fort_ptr + type(C_FUNPTR) :: itt_sync_rename_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_sync_renameA_ptr__3_0' :: itt_sync_rename_fort_ptr + type(C_FUNPTR) :: itt_thread_set_name_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_thread_set_nameA_ptr__3_0' :: itt_thread_set_name_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_begin_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_heap_record_memory_growth_begin_ptr__3_0' :: itt_heap_record_memory_growth_begin_fort_ptr + type(C_FUNPTR) :: itt_heap_record_memory_growth_end_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_heap_record_memory_growth_end_ptr__3_0' :: itt_heap_record_memory_growth_end_fort_ptr + type(C_FUNPTR) :: itt_heap_reset_detection_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_heap_reset_detection_ptr__3_0' :: itt_heap_reset_detection_fort_ptr + type(C_FUNPTR) :: itt_heap_record_fort_ptr + !DEC$ ATTRIBUTES C, EXTERN, ALIAS:'___itt_heap_record_ptr__3_0' :: itt_heap_record_fort_ptr + !DEC$ENDIF + + contains + + subroutine itt_pause() + procedure(itt_proc_none), pointer :: pause_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_pause + if (C_ASSOCIATED(itt_pause_fort_ptr)) then + call C_F_PROCPOINTER(itt_pause_fort_ptr, pause_ptr) + call pause_ptr() + end if + end subroutine itt_pause + + subroutine itt_resume() + procedure(itt_proc_none), pointer :: resume_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_resume + if (C_ASSOCIATED(itt_resume_fort_ptr)) then + call C_F_PROCPOINTER(itt_resume_fort_ptr, resume_ptr) + call resume_ptr() + end if + end subroutine itt_resume + + subroutine itt_thread_ignore() + procedure(itt_proc_none), pointer :: thread_ignore_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_thread_ignore + if (C_ASSOCIATED(itt_thread_ignore_fort_ptr)) then + call C_F_PROCPOINTER(itt_thread_ignore_fort_ptr, thread_ignore_ptr) + call thread_ignore_ptr() + end if + end subroutine itt_thread_ignore + + subroutine itt_suppress_push(mask) + procedure(itt_proc_sup_push), pointer :: suppress_push_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_push + integer, intent(in), value :: mask + if (C_ASSOCIATED(itt_suppress_push_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_push_fort_ptr, suppress_push_ptr) + call suppress_push_ptr(mask) + end if + end subroutine itt_suppress_push + + subroutine itt_suppress_pop() + procedure(itt_proc_none), pointer :: suppress_pop_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_pop + if (C_ASSOCIATED(itt_suppress_pop_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_pop_fort_ptr, suppress_pop_ptr) + call suppress_pop_ptr() + end if + end subroutine itt_suppress_pop + + subroutine itt_suppress_mark_range(action, mask, addr, size) + procedure(itt_proc_sup_range), pointer :: suppress_mark_range_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_mark_range + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + if (C_ASSOCIATED(itt_suppress_mark_range_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_mark_range_fort_ptr, suppress_mark_range_ptr) + call suppress_mark_range_ptr(action, mask, addr, size) + end if + end subroutine itt_suppress_mark_range + + subroutine itt_suppress_clear_range(action, mask, addr, size) + procedure(itt_proc_sup_range), pointer :: suppress_clear_range_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_suppress_clear_range + integer, intent(in), value :: action + integer, intent(in), value :: mask + integer(kind=itt_ptr), intent(in), value :: addr + integer(kind=itt_ptr), intent(in), value :: size + if (C_ASSOCIATED(itt_suppress_clear_range_fort_ptr)) then + call C_F_PROCPOINTER(itt_suppress_clear_range_fort_ptr, suppress_clear_range_ptr) + call suppress_clear_range_ptr(action, mask, addr, size) + end if + end subroutine itt_suppress_clear_range + + subroutine itt_sync_prepare(addr) + procedure(itt_proc_address), pointer :: sync_prepare_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_prepare + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_prepare_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_prepare_fort_ptr, sync_prepare_ptr) + call sync_prepare_ptr(addr) + end if + end subroutine itt_sync_prepare + + subroutine itt_sync_cancel(addr) + procedure(itt_proc_address), pointer :: sync_cancel_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_cancel + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_cancel_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_cancel_fort_ptr, sync_cancel_ptr) + call sync_cancel_ptr(addr) + end if + end subroutine itt_sync_cancel + + subroutine itt_sync_acquired(addr) + procedure(itt_proc_address), pointer :: sync_acquired_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_acquired + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_acquired_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_acquired_fort_ptr, sync_acquired_ptr) + call sync_acquired_ptr(addr) + end if + end subroutine itt_sync_acquired + + subroutine itt_sync_releasing(addr) + procedure(itt_proc_address), pointer :: sync_releasing_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_releasing + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_releasing_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_releasing_fort_ptr, sync_releasing_ptr) + call sync_releasing_ptr(addr) + end if + end subroutine itt_sync_releasing + + subroutine itt_fsync_prepare(addr) + procedure(itt_proc_address), pointer :: fsync_prepare_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_prepare + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_prepare_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_prepare_fort_ptr, fsync_prepare_ptr) + call fsync_prepare_ptr(addr) + end if + end subroutine itt_fsync_prepare + + subroutine itt_fsync_cancel(addr) + procedure(itt_proc_address), pointer :: fsync_cancel_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_cancel + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_cancel_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_cancel_fort_ptr, fsync_cancel_ptr) + call fsync_cancel_ptr(addr) + end if + end subroutine itt_fsync_cancel + + subroutine itt_fsync_acquired(addr) + procedure(itt_proc_address), pointer :: fsync_acquired_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_acquired + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_acquired_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_acquired_fort_ptr, fsync_acquired_ptr) + call fsync_acquired_ptr(addr) + end if + end subroutine itt_fsync_acquired + + subroutine itt_fsync_releasing(addr) + procedure(itt_proc_address), pointer :: fsync_releasing_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_fsync_releasing + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_fsync_releasing_fort_ptr)) then + call C_F_PROCPOINTER(itt_fsync_releasing_fort_ptr, fsync_releasing_ptr) + call fsync_releasing_ptr(addr) + end if + end subroutine itt_fsync_releasing + + subroutine itt_sync_destroy(addr) + procedure(itt_proc_address), pointer :: sync_destroy_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_destroy + integer(kind=itt_ptr), intent(in), value :: addr + if (C_ASSOCIATED(itt_sync_destroy_fort_ptr)) then + call C_F_PROCPOINTER(itt_sync_destroy_fort_ptr, sync_destroy_ptr) + call sync_destroy_ptr(addr) + end if + end subroutine itt_sync_destroy + + subroutine itt_sync_create(addr, objname, attribute) + procedure(itt_proc_create), pointer :: sync_create_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_create + integer(kind=itt_ptr), intent(in), value :: addr + character(len=*), intent(in) :: objname + integer, intent(in), value :: attribute + CHARACTER(LEN=1,KIND=C_CHAR) :: objnametmp(LEN_TRIM(objname)+1) + INTEGER :: iobjname, nobjname + if (C_ASSOCIATED(itt_sync_create_fort_ptr)) then + nobjname = LEN_TRIM(objname) + DO iobjname = 1, nobjname + objnametmp(iobjname) = objname(iobjname:iobjname) + END DO + objnametmp(nobjname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_sync_create_fort_ptr, sync_create_ptr) + call sync_create_ptr(addr, objnametmp, attribute) + end if + end subroutine itt_sync_create + + subroutine itt_sync_rename(addr, objname) + procedure(itt_proc_rename), pointer :: sync_rename_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_sync_rename + integer(kind=itt_ptr), intent(in), value :: addr + character(len=*), intent(in) :: objname + CHARACTER(LEN=1,KIND=C_CHAR) :: objnametmp(LEN_TRIM(objname)+1) + INTEGER :: iobjname, nobjname + if (C_ASSOCIATED(itt_sync_rename_fort_ptr)) then + nobjname = LEN_TRIM(objname) + DO iobjname = 1, nobjname + objnametmp(iobjname) = objname(iobjname:iobjname) + END DO + objnametmp(nobjname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_sync_rename_fort_ptr, sync_rename_ptr) + call sync_rename_ptr(addr, objnametmp) + end if + end subroutine itt_sync_rename + + subroutine itt_thread_set_name(name) + procedure(itt_proc_name), pointer :: thread_set_name_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_thread_set_name + character(len=*), intent(in) :: name + CHARACTER(LEN=1,KIND=C_CHAR) :: nametmp(LEN_TRIM(name)+1) + INTEGER :: iname, nname + if (C_ASSOCIATED(itt_thread_set_name_fort_ptr)) then + nname = LEN_TRIM(name) + DO iname = 1, nname + nametmp(iname) = name(iname:iname) + END DO + nametmp(nname + 1) = C_NULL_CHAR + call C_F_PROCPOINTER(itt_thread_set_name_fort_ptr, thread_set_name_ptr) + call thread_set_name_ptr(nametmp) + end if + end subroutine itt_thread_set_name + + subroutine itt_heap_record_memory_growth_begin() + procedure(itt_proc_none), pointer :: heap_record_memory_growth_begin_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record_memory_growth_begin + if (C_ASSOCIATED(itt_heap_record_memory_growth_begin_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_memory_growth_begin_fort_ptr, heap_record_memory_growth_begin_ptr) + call heap_record_memory_growth_begin_ptr() + end if + end subroutine itt_heap_record_memory_growth_begin + + subroutine itt_heap_record_memory_growth_end() + procedure(itt_proc_none), pointer :: heap_record_memory_growth_end_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record_memory_growth_end + if (C_ASSOCIATED(itt_heap_record_memory_growth_end_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_memory_growth_end_fort_ptr, heap_record_memory_growth_end_ptr) + call heap_record_memory_growth_end_ptr() + end if + end subroutine itt_heap_record_memory_growth_end + + subroutine itt_heap_reset_detection(heapmask) + procedure(itt_proc_heapmask), pointer :: heap_reset_detection_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_reset_detection + integer, intent(in), value :: heapmask + if (C_ASSOCIATED(itt_heap_reset_detection_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_reset_detection_fort_ptr, heap_reset_detection_ptr) + call heap_reset_detection_ptr(heapmask) + end if + end subroutine itt_heap_reset_detection + + subroutine itt_heap_record(heapmask) + procedure(itt_proc_heapmask), pointer :: heap_record_ptr + !DEC$ ATTRIBUTES DEFAULT :: itt_heap_record + integer, intent(in), value :: heapmask + if (C_ASSOCIATED(itt_heap_record_fort_ptr)) then + call C_F_PROCPOINTER(itt_heap_record_fort_ptr, heap_record_ptr) + call heap_record_ptr(heapmask) + end if + end subroutine itt_heap_record + + + end module ittnotify + diff --git a/deps/v8/third_party/ittapi/include/ittnotify.h b/deps/v8/third_party/ittapi/include/ittnotify.h new file mode 100644 index 00000000000000..0a9e007b701d9e --- /dev/null +++ b/deps/v8/third_party/ittapi/include/ittnotify.h @@ -0,0 +1,4327 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ +#ifndef _ITTNOTIFY_H_ +#define _ITTNOTIFY_H_ + +/** +@file +@brief Public User API functions and types +@mainpage + +The ITT API is used to annotate a user's program with additional information +that can be used by correctness and performance tools. The user inserts +calls in their program. Those calls generate information that is collected +at runtime, and used by Intel(R) Threading Tools. + +@section API Concepts +The following general concepts are used throughout the API. + +@subsection Unicode Support +Many API functions take character string arguments. On Windows, there +are two versions of each such function. The function name is suffixed +by W if Unicode support is enabled, and by A otherwise. Any API function +that takes a character string argument adheres to this convention. + +@subsection Conditional Compilation +Many users prefer having an option to modify ITT API code when linking it +inside their runtimes. ITT API header file provides a mechanism to replace +ITT API function names inside your code with empty strings. To do this, +define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the +static library from the linker script. + +@subsection Domains +[see domains] +Domains provide a way to separate notification for different modules or +libraries in a program. Domains are specified by dotted character strings, +e.g. TBB.Internal.Control. + +A mechanism (to be specified) is provided to enable and disable +domains. By default, all domains are enabled. +@subsection Named Entities and Instances +Named entities (frames, regions, tasks, and markers) communicate +information about the program to the analysis tools. A named entity often +refers to a section of program code, or to some set of logical concepts +that the programmer wants to group together. + +Named entities relate to the programmer's static view of the program. When +the program actually executes, many instances of a given named entity +may be created. + +The API annotations denote instances of named entities. The actual +named entities are displayed using the analysis tools. In other words, +the named entities come into existence when instances are created. + +Instances of named entities may have instance identifiers (IDs). Some +API calls use instance identifiers to create relationships between +different instances of named entities. Other API calls associate data +with instances of named entities. + +Some named entities must always have instance IDs. In particular, regions +and frames always have IDs. Task and markers need IDs only if the ID is +needed in another API call (such as adding a relation or metadata). + +The lifetime of instance IDs is distinct from the lifetime of +instances. This allows various relationships to be specified separate +from the actual execution of instances. This flexibility comes at the +expense of extra API calls. + +The same ID may not be reused for different instances, unless a previous +[ref] __itt_id_destroy call for that ID has been issued. +*/ + +/** @cond exclude_from_documentation */ +#ifndef ITT_OS_WIN +# define ITT_OS_WIN 1 +#endif /* ITT_OS_WIN */ + +#ifndef ITT_OS_LINUX +# define ITT_OS_LINUX 2 +#endif /* ITT_OS_LINUX */ + +#ifndef ITT_OS_MAC +# define ITT_OS_MAC 3 +#endif /* ITT_OS_MAC */ + +#ifndef ITT_OS_FREEBSD +# define ITT_OS_FREEBSD 4 +#endif /* ITT_OS_FREEBSD */ + +#ifndef ITT_OS +# if defined WIN32 || defined _WIN32 +# define ITT_OS ITT_OS_WIN +# elif defined( __APPLE__ ) && defined( __MACH__ ) +# define ITT_OS ITT_OS_MAC +# elif defined( __FreeBSD__ ) +# define ITT_OS ITT_OS_FREEBSD +# else +# define ITT_OS ITT_OS_LINUX +# endif +#endif /* ITT_OS */ + +#ifndef ITT_PLATFORM_WIN +# define ITT_PLATFORM_WIN 1 +#endif /* ITT_PLATFORM_WIN */ + +#ifndef ITT_PLATFORM_POSIX +# define ITT_PLATFORM_POSIX 2 +#endif /* ITT_PLATFORM_POSIX */ + +#ifndef ITT_PLATFORM_MAC +# define ITT_PLATFORM_MAC 3 +#endif /* ITT_PLATFORM_MAC */ + +#ifndef ITT_PLATFORM_FREEBSD +# define ITT_PLATFORM_FREEBSD 4 +#endif /* ITT_PLATFORM_FREEBSD */ + +#ifndef ITT_PLATFORM +# if ITT_OS==ITT_OS_WIN +# define ITT_PLATFORM ITT_PLATFORM_WIN +# elif ITT_OS==ITT_OS_MAC +# define ITT_PLATFORM ITT_PLATFORM_MAC +# elif ITT_OS==ITT_OS_FREEBSD +# define ITT_PLATFORM ITT_PLATFORM_FREEBSD +# else +# define ITT_PLATFORM ITT_PLATFORM_POSIX +# endif +#endif /* ITT_PLATFORM */ + +#if defined(_UNICODE) && !defined(UNICODE) +#define UNICODE +#endif + +#include +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#include +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#include +#if defined(UNICODE) || defined(_UNICODE) +#include +#endif /* UNICODE || _UNICODE */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#ifndef ITTAPI_CDECL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define ITTAPI_CDECL __cdecl +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define ITTAPI_CDECL __attribute__ ((cdecl)) +# else /* _M_IX86 || __i386__ */ +# define ITTAPI_CDECL /* actual only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* ITTAPI_CDECL */ + +#ifndef STDCALL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define STDCALL __stdcall +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define STDCALL __attribute__ ((stdcall)) +# else /* _M_IX86 || __i386__ */ +# define STDCALL /* supported only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* STDCALL */ + +#define ITTAPI ITTAPI_CDECL +#define LIBITTAPI ITTAPI_CDECL + +/* TODO: Temporary for compatibility! */ +#define ITTAPI_CALL ITTAPI_CDECL +#define LIBITTAPI_CALL ITTAPI_CDECL + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +/* use __forceinline (VC++ specific) */ +#if defined(__MINGW32__) && !defined(__cplusplus) +#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#else +#define ITT_INLINE static __forceinline +#endif /* __MINGW32__ */ + +#define ITT_INLINE_ATTRIBUTE /* nothing */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/* + * Generally, functions are not inlined unless optimization is specified. + * For functions declared inline, this attribute inlines the function even + * if no optimization level was specified. + */ +#ifdef __STRICT_ANSI__ +#define ITT_INLINE static +#define ITT_INLINE_ATTRIBUTE __attribute__((unused)) +#else /* __STRICT_ANSI__ */ +#define ITT_INLINE static inline +#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) +#endif /* __STRICT_ANSI__ */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/** @endcond */ + +#ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# pragma message("WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro") +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# warning "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro" +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# include "legacy/ittnotify.h" +#endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */ + +/** @cond exclude_from_documentation */ +/* Helper macro for joining tokens */ +#define ITT_JOIN_AUX(p,n) p##n +#define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n) + +#ifdef ITT_MAJOR +#undef ITT_MAJOR +#endif +#ifdef ITT_MINOR +#undef ITT_MINOR +#endif +#define ITT_MAJOR 3 +#define ITT_MINOR 0 + +/* Standard versioning of a token with major and minor version numbers */ +#define ITT_VERSIONIZE(x) \ + ITT_JOIN(x, \ + ITT_JOIN(_, \ + ITT_JOIN(ITT_MAJOR, \ + ITT_JOIN(_, ITT_MINOR)))) + +#ifndef INTEL_ITTNOTIFY_PREFIX +# define INTEL_ITTNOTIFY_PREFIX __itt_ +#endif /* INTEL_ITTNOTIFY_PREFIX */ +#ifndef INTEL_ITTNOTIFY_POSTFIX +# define INTEL_ITTNOTIFY_POSTFIX _ptr_ +#endif /* INTEL_ITTNOTIFY_POSTFIX */ + +#define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n) +#define ITTNOTIFY_NAME(n) ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX))) + +#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n) +#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n) + +#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d) +#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x) +#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y) +#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z) +#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) +#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) +#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) +#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d) +#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x) +#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y) +#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z) +#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) +#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) +#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) + +#ifdef ITT_STUB +#undef ITT_STUB +#endif +#ifdef ITT_STUBV +#undef ITT_STUBV +#endif +#define ITT_STUBV(api,type,name,args) \ + typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args; \ + extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name); +#define ITT_STUB ITT_STUBV +/** @endcond */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** @cond exclude_from_gpa_documentation */ +/** + * @defgroup public Public API + * @{ + * @} + */ + +/** + * @defgroup control Collection Control + * @ingroup public + * General behavior: application continues to run, but no profiling information is being collected + * + * Pausing occurs not only for the current thread but for all process as well as spawned processes + * - Intel(R) Parallel Inspector and Intel(R) Inspector XE: + * - Does not analyze or report errors that involve memory access. + * - Other errors are reported as usual. Pausing data collection in + * Intel(R) Parallel Inspector and Intel(R) Inspector XE + * only pauses tracing and analyzing memory access. + * It does not pause tracing or analyzing threading APIs. + * . + * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE: + * - Does continue to record when new threads are started. + * . + * - Other effects: + * - Possible reduction of runtime overhead. + * . + * @{ + */ +/** @brief Pause collection */ +void ITTAPI __itt_pause(void); +/** @brief Resume collection */ +void ITTAPI __itt_resume(void); +/** @brief Detach collection */ +void ITTAPI __itt_detach(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, pause, (void)) +ITT_STUBV(ITTAPI, void, resume, (void)) +ITT_STUBV(ITTAPI, void, detach, (void)) +#define __itt_pause ITTNOTIFY_VOID(pause) +#define __itt_pause_ptr ITTNOTIFY_NAME(pause) +#define __itt_resume ITTNOTIFY_VOID(resume) +#define __itt_resume_ptr ITTNOTIFY_NAME(resume) +#define __itt_detach ITTNOTIFY_VOID(detach) +#define __itt_detach_ptr ITTNOTIFY_NAME(detach) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_pause() +#define __itt_pause_ptr 0 +#define __itt_resume() +#define __itt_resume_ptr 0 +#define __itt_detach() +#define __itt_detach_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_pause_ptr 0 +#define __itt_resume_ptr 0 +#define __itt_detach_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} control group */ +/** @endcond */ + +/** + * @defgroup Intel Processor Trace control + * API from this group provides control over collection and analysis of Intel Processor Trace (Intel PT) data + * Information about Intel Processor Trace technology can be found here (Volume 3 chapter 35): + * https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf + * Use this API to mark particular code regions for loading detailed performance statistics. + * This mode makes your analysis faster and more accurate. + * @{ +*/ +typedef unsigned char __itt_pt_region; + +/** + * @brief function saves a region name marked with Intel PT API and returns a region id. + * Only 7 names can be registered. Attempts to register more names will be ignored and a region id with auto names will be returned. + * For automatic naming of regions pass NULL as function parameter +*/ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_pt_region ITTAPI __itt_pt_region_createA(const char *name); +__itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_pt_region_create __itt_pt_region_createW +#else /* UNICODE */ +# define __itt_pt_region_create __itt_pt_region_createA +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_pt_region ITTAPI __itt_pt_region_create(const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name)) +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA) +#define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA) +#define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW) +#define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create) +#define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_pt_region_createA(name) (__itt_pt_region)0 +#define __itt_pt_region_createA_ptr 0 +#define __itt_pt_region_createW(name) (__itt_pt_region)0 +#define __itt_pt_region_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_pt_region_create(name) (__itt_pt_region)0 +#define __itt_pt_region_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_pt_region_createA_ptr 0 +#define __itt_pt_region_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_pt_region_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief function contains a special code pattern identified on the post-processing stage and + * marks the beginning of a code region targeted for Intel PT analysis + * @param[in] region - region id, 0 <= region < 8 +*/ +void __itt_mark_pt_region_begin(__itt_pt_region region); +/** + * @brief function contains a special code pattern identified on the post-processing stage and + * marks the end of a code region targeted for Intel PT analysis + * @param[in] region - region id, 0 <= region < 8 +*/ +void __itt_mark_pt_region_end(__itt_pt_region region); +/** @} Intel PT control group*/ + +/** + * @defgroup threads Threads + * @ingroup public + * Give names to threads + * @{ + */ +/** + * @brief Sets thread name of calling thread + * @param[in] name - name of thread + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_thread_set_nameA(const char *name); +void ITTAPI __itt_thread_set_nameW(const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_thread_set_name __itt_thread_set_nameW +# define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr +#else /* UNICODE */ +# define __itt_thread_set_name __itt_thread_set_nameA +# define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_thread_set_name(const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name)) +ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thread_set_nameA ITTNOTIFY_VOID(thread_set_nameA) +#define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA) +#define __itt_thread_set_nameW ITTNOTIFY_VOID(thread_set_nameW) +#define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thread_set_name ITTNOTIFY_VOID(thread_set_name) +#define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thread_set_nameA(name) +#define __itt_thread_set_nameA_ptr 0 +#define __itt_thread_set_nameW(name) +#define __itt_thread_set_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thread_set_name(name) +#define __itt_thread_set_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thread_set_nameA_ptr 0 +#define __itt_thread_set_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thread_set_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @cond exclude_from_gpa_documentation */ + +/** + * @brief Mark current thread as ignored from this point on, for the duration of its existence. + */ +void ITTAPI __itt_thread_ignore(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, thread_ignore, (void)) +#define __itt_thread_ignore ITTNOTIFY_VOID(thread_ignore) +#define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_thread_ignore() +#define __itt_thread_ignore_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_thread_ignore_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} threads group */ + +/** + * @defgroup suppress Error suppression + * @ingroup public + * General behavior: application continues to run, but errors are suppressed + * + * @{ + */ + +/*****************************************************************//** + * @name group of functions used for error suppression in correctness tools + *********************************************************************/ +/** @{ */ +/** + * @hideinitializer + * @brief possible value for suppression mask + */ +#define __itt_suppress_all_errors 0x7fffffff + +/** + * @hideinitializer + * @brief possible value for suppression mask (suppresses errors from threading analysis) + */ +#define __itt_suppress_threading_errors 0x000000ff + +/** + * @hideinitializer + * @brief possible value for suppression mask (suppresses errors from memory analysis) + */ +#define __itt_suppress_memory_errors 0x0000ff00 + +/** + * @brief Start suppressing errors identified in mask on this thread + */ +void ITTAPI __itt_suppress_push(unsigned int mask); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask)) +#define __itt_suppress_push ITTNOTIFY_VOID(suppress_push) +#define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_suppress_push(mask) +#define __itt_suppress_push_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_suppress_push_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Undo the effects of the matching call to __itt_suppress_push + */ +void ITTAPI __itt_suppress_pop(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, suppress_pop, (void)) +#define __itt_suppress_pop ITTNOTIFY_VOID(suppress_pop) +#define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_suppress_pop() +#define __itt_suppress_pop_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_suppress_pop_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @enum __itt_model_disable + * @brief Enumerator for the disable methods + */ +typedef enum __itt_suppress_mode { + __itt_unsuppress_range, + __itt_suppress_range +} __itt_suppress_mode_t; + +/** + * @brief Mark a range of memory for error suppression or unsuppression for error types included in mask + */ +void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size)) +#define __itt_suppress_mark_range ITTNOTIFY_VOID(suppress_mark_range) +#define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_suppress_mark_range(mask) +#define __itt_suppress_mark_range_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_suppress_mark_range_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Undo the effect of a matching call to __itt_suppress_mark_range. If not matching + * call is found, nothing is changed. + */ +void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, suppress_clear_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size)) +#define __itt_suppress_clear_range ITTNOTIFY_VOID(suppress_clear_range) +#define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_suppress_clear_range(mask) +#define __itt_suppress_clear_range_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_suppress_clear_range_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} */ +/** @} suppress group */ + +/** + * @defgroup sync Synchronization + * @ingroup public + * Indicate user-written synchronization code + * @{ + */ +/** + * @hideinitializer + * @brief possible value of attribute argument for sync object type + */ +#define __itt_attr_barrier 1 + +/** + * @hideinitializer + * @brief possible value of attribute argument for sync object type + */ +#define __itt_attr_mutex 2 + +/** +@brief Name a synchronization object +@param[in] addr Handle for the synchronization object. You should +use a real address to uniquely identify the synchronization object. +@param[in] objtype null-terminated object type string. If NULL is +passed, the name will be "User Synchronization". +@param[in] objname null-terminated object name string. If NULL, +no name will be assigned to the object. +@param[in] attribute one of [#__itt_attr_barrier, #__itt_attr_mutex] + */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_sync_createA(void *addr, const char *objtype, const char *objname, int attribute); +void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_sync_create __itt_sync_createW +# define __itt_sync_create_ptr __itt_sync_createW_ptr +#else /* UNICODE */ +# define __itt_sync_create __itt_sync_createA +# define __itt_sync_create_ptr __itt_sync_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_sync_create (void *addr, const char *objtype, const char *objname, int attribute); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char *objtype, const char *objname, int attribute)) +ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_create, (void *addr, const char* objtype, const char* objname, int attribute)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_createA ITTNOTIFY_VOID(sync_createA) +#define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA) +#define __itt_sync_createW ITTNOTIFY_VOID(sync_createW) +#define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_create ITTNOTIFY_VOID(sync_create) +#define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_createA(addr, objtype, objname, attribute) +#define __itt_sync_createA_ptr 0 +#define __itt_sync_createW(addr, objtype, objname, attribute) +#define __itt_sync_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_create(addr, objtype, objname, attribute) +#define __itt_sync_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_createA_ptr 0 +#define __itt_sync_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** +@brief Rename a synchronization object + +You can use the rename call to assign or reassign a name to a given +synchronization object. +@param[in] addr handle for the synchronization object. +@param[in] name null-terminated object name string. +*/ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_sync_renameA(void *addr, const char *name); +void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_sync_rename __itt_sync_renameW +# define __itt_sync_rename_ptr __itt_sync_renameW_ptr +#else /* UNICODE */ +# define __itt_sync_rename __itt_sync_renameA +# define __itt_sync_rename_ptr __itt_sync_renameA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_sync_rename(void *addr, const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name)) +ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_renameA ITTNOTIFY_VOID(sync_renameA) +#define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA) +#define __itt_sync_renameW ITTNOTIFY_VOID(sync_renameW) +#define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_rename ITTNOTIFY_VOID(sync_rename) +#define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_renameA(addr, name) +#define __itt_sync_renameA_ptr 0 +#define __itt_sync_renameW(addr, name) +#define __itt_sync_renameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_rename(addr, name) +#define __itt_sync_rename_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_renameA_ptr 0 +#define __itt_sync_renameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_rename_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + @brief Destroy a synchronization object. + @param addr Handle for the synchronization object. + */ +void ITTAPI __itt_sync_destroy(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr)) +#define __itt_sync_destroy ITTNOTIFY_VOID(sync_destroy) +#define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_sync_destroy(addr) +#define __itt_sync_destroy_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_sync_destroy_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/*****************************************************************//** + * @name group of functions is used for performance measurement tools + *********************************************************************/ +/** @{ */ +/** + * @brief Enter spin loop on user-defined sync object + */ +void ITTAPI __itt_sync_prepare(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr)) +#define __itt_sync_prepare ITTNOTIFY_VOID(sync_prepare) +#define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_sync_prepare(addr) +#define __itt_sync_prepare_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_sync_prepare_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Quit spin loop without acquiring spin object + */ +void ITTAPI __itt_sync_cancel(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr)) +#define __itt_sync_cancel ITTNOTIFY_VOID(sync_cancel) +#define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_sync_cancel(addr) +#define __itt_sync_cancel_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_sync_cancel_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Successful spin loop completion (sync object acquired) + */ +void ITTAPI __itt_sync_acquired(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr)) +#define __itt_sync_acquired ITTNOTIFY_VOID(sync_acquired) +#define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_sync_acquired(addr) +#define __itt_sync_acquired_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_sync_acquired_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Start sync object releasing code. Is called before the lock release call. + */ +void ITTAPI __itt_sync_releasing(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr)) +#define __itt_sync_releasing ITTNOTIFY_VOID(sync_releasing) +#define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_sync_releasing(addr) +#define __itt_sync_releasing_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_sync_releasing_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} */ + +/** @} sync group */ + +/**************************************************************//** + * @name group of functions is used for correctness checking tools + ******************************************************************/ +/** @{ */ +/** + * @ingroup legacy + * @deprecated Legacy API + * @brief Fast synchronization which does no require spinning. + * - This special function is to be used by TBB and OpenMP libraries only when they know + * there is no spin but they need to suppress TC warnings about shared variable modifications. + * - It only has corresponding pointers in static library and does not have corresponding function + * in dynamic library. + * @see void __itt_sync_prepare(void* addr); + */ +void ITTAPI __itt_fsync_prepare(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr)) +#define __itt_fsync_prepare ITTNOTIFY_VOID(fsync_prepare) +#define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_fsync_prepare(addr) +#define __itt_fsync_prepare_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_fsync_prepare_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup legacy + * @deprecated Legacy API + * @brief Fast synchronization which does no require spinning. + * - This special function is to be used by TBB and OpenMP libraries only when they know + * there is no spin but they need to suppress TC warnings about shared variable modifications. + * - It only has corresponding pointers in static library and does not have corresponding function + * in dynamic library. + * @see void __itt_sync_cancel(void *addr); + */ +void ITTAPI __itt_fsync_cancel(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr)) +#define __itt_fsync_cancel ITTNOTIFY_VOID(fsync_cancel) +#define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_fsync_cancel(addr) +#define __itt_fsync_cancel_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_fsync_cancel_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup legacy + * @deprecated Legacy API + * @brief Fast synchronization which does no require spinning. + * - This special function is to be used by TBB and OpenMP libraries only when they know + * there is no spin but they need to suppress TC warnings about shared variable modifications. + * - It only has corresponding pointers in static library and does not have corresponding function + * in dynamic library. + * @see void __itt_sync_acquired(void *addr); + */ +void ITTAPI __itt_fsync_acquired(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr)) +#define __itt_fsync_acquired ITTNOTIFY_VOID(fsync_acquired) +#define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_fsync_acquired(addr) +#define __itt_fsync_acquired_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_fsync_acquired_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup legacy + * @deprecated Legacy API + * @brief Fast synchronization which does no require spinning. + * - This special function is to be used by TBB and OpenMP libraries only when they know + * there is no spin but they need to suppress TC warnings about shared variable modifications. + * - It only has corresponding pointers in static library and does not have corresponding function + * in dynamic library. + * @see void __itt_sync_releasing(void* addr); + */ +void ITTAPI __itt_fsync_releasing(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr)) +#define __itt_fsync_releasing ITTNOTIFY_VOID(fsync_releasing) +#define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_fsync_releasing(addr) +#define __itt_fsync_releasing_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_fsync_releasing_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} */ + +/** + * @defgroup model Modeling by Intel(R) Parallel Advisor + * @ingroup public + * This is the subset of itt used for modeling by Intel(R) Parallel Advisor. + * This API is called ONLY using annotate.h, by "Annotation" macros + * the user places in their sources during the parallelism modeling steps. + * + * site_begin/end and task_begin/end take the address of handle variables, + * which are writeable by the API. Handles must be 0 initialized prior + * to the first call to begin, or may cause a run-time failure. + * The handles are initialized in a multi-thread safe way by the API if + * the handle is 0. The commonly expected idiom is one static handle to + * identify a site or task. If a site or task of the same name has already + * been started during this collection, the same handle MAY be returned, + * but is not required to be - it is unspecified if data merging is done + * based on name. These routines also take an instance variable. Like + * the lexical instance, these must be 0 initialized. Unlike the lexical + * instance, this is used to track a single dynamic instance. + * + * API used by the Intel(R) Parallel Advisor to describe potential concurrency + * and related activities. User-added source annotations expand to calls + * to these procedures to enable modeling of a hypothetical concurrent + * execution serially. + * @{ + */ +#if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL) + +typedef void* __itt_model_site; /*!< @brief handle for lexical site */ +typedef void* __itt_model_site_instance; /*!< @brief handle for dynamic instance */ +typedef void* __itt_model_task; /*!< @brief handle for lexical site */ +typedef void* __itt_model_task_instance; /*!< @brief handle for dynamic instance */ + +/** + * @enum __itt_model_disable + * @brief Enumerator for the disable methods + */ +typedef enum { + __itt_model_disable_observation, + __itt_model_disable_collection +} __itt_model_disable; + +#endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */ + +/** + * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support. + * + * site_begin/end model a potential concurrency site. + * site instances may be recursively nested with themselves. + * site_end exits the most recently started but unended site for the current + * thread. The handle passed to end may be used to validate structure. + * Instances of a site encountered on different threads concurrently + * are considered completely distinct. If the site name for two different + * lexical sites match, it is unspecified whether they are treated as the + * same or different for data presentation. + */ +void ITTAPI __itt_model_site_begin(__itt_model_site *site, __itt_model_site_instance *instance, const char *name); +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_model_site_beginW(const wchar_t *name); +#endif +void ITTAPI __itt_model_site_beginA(const char *name); +void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen); +void ITTAPI __itt_model_site_end (__itt_model_site *site, __itt_model_site_instance *instance); +void ITTAPI __itt_model_site_end_2(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_site_begin, (__itt_model_site *site, __itt_model_site_instance *instance, const char *name)) +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name)) +#endif +ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name)) +ITT_STUBV(ITTAPI, void, model_site_beginAL, (const char *name, size_t siteNameLen)) +ITT_STUBV(ITTAPI, void, model_site_end, (__itt_model_site *site, __itt_model_site_instance *instance)) +ITT_STUBV(ITTAPI, void, model_site_end_2, (void)) +#define __itt_model_site_begin ITTNOTIFY_VOID(model_site_begin) +#define __itt_model_site_begin_ptr ITTNOTIFY_NAME(model_site_begin) +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_site_beginW ITTNOTIFY_VOID(model_site_beginW) +#define __itt_model_site_beginW_ptr ITTNOTIFY_NAME(model_site_beginW) +#endif +#define __itt_model_site_beginA ITTNOTIFY_VOID(model_site_beginA) +#define __itt_model_site_beginA_ptr ITTNOTIFY_NAME(model_site_beginA) +#define __itt_model_site_beginAL ITTNOTIFY_VOID(model_site_beginAL) +#define __itt_model_site_beginAL_ptr ITTNOTIFY_NAME(model_site_beginAL) +#define __itt_model_site_end ITTNOTIFY_VOID(model_site_end) +#define __itt_model_site_end_ptr ITTNOTIFY_NAME(model_site_end) +#define __itt_model_site_end_2 ITTNOTIFY_VOID(model_site_end_2) +#define __itt_model_site_end_2_ptr ITTNOTIFY_NAME(model_site_end_2) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_site_begin(site, instance, name) +#define __itt_model_site_begin_ptr 0 +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_site_beginW(name) +#define __itt_model_site_beginW_ptr 0 +#endif +#define __itt_model_site_beginA(name) +#define __itt_model_site_beginA_ptr 0 +#define __itt_model_site_beginAL(name, siteNameLen) +#define __itt_model_site_beginAL_ptr 0 +#define __itt_model_site_end(site, instance) +#define __itt_model_site_end_ptr 0 +#define __itt_model_site_end_2() +#define __itt_model_site_end_2_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_site_begin_ptr 0 +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_site_beginW_ptr 0 +#endif +#define __itt_model_site_beginA_ptr 0 +#define __itt_model_site_beginAL_ptr 0 +#define __itt_model_site_end_ptr 0 +#define __itt_model_site_end_2_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support + * + * task_begin/end model a potential task, which is contained within the most + * closely enclosing dynamic site. task_end exits the most recently started + * but unended task. The handle passed to end may be used to validate + * structure. It is unspecified if bad dynamic nesting is detected. If it + * is, it should be encoded in the resulting data collection. The collector + * should not fail due to construct nesting issues, nor attempt to directly + * indicate the problem. + */ +void ITTAPI __itt_model_task_begin(__itt_model_task *task, __itt_model_task_instance *instance, const char *name); +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_model_task_beginW(const wchar_t *name); +void ITTAPI __itt_model_iteration_taskW(const wchar_t *name); +#endif +void ITTAPI __itt_model_task_beginA(const char *name); +void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen); +void ITTAPI __itt_model_iteration_taskA(const char *name); +void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen); +void ITTAPI __itt_model_task_end (__itt_model_task *task, __itt_model_task_instance *instance); +void ITTAPI __itt_model_task_end_2(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_task_begin, (__itt_model_task *task, __itt_model_task_instance *instance, const char *name)) +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name)) +ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name)) +#endif +ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name)) +ITT_STUBV(ITTAPI, void, model_task_beginAL, (const char *name, size_t taskNameLen)) +ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name)) +ITT_STUBV(ITTAPI, void, model_iteration_taskAL, (const char *name, size_t taskNameLen)) +ITT_STUBV(ITTAPI, void, model_task_end, (__itt_model_task *task, __itt_model_task_instance *instance)) +ITT_STUBV(ITTAPI, void, model_task_end_2, (void)) +#define __itt_model_task_begin ITTNOTIFY_VOID(model_task_begin) +#define __itt_model_task_begin_ptr ITTNOTIFY_NAME(model_task_begin) +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_task_beginW ITTNOTIFY_VOID(model_task_beginW) +#define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW) +#define __itt_model_iteration_taskW ITTNOTIFY_VOID(model_iteration_taskW) +#define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW) +#endif +#define __itt_model_task_beginA ITTNOTIFY_VOID(model_task_beginA) +#define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA) +#define __itt_model_task_beginAL ITTNOTIFY_VOID(model_task_beginAL) +#define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL) +#define __itt_model_iteration_taskA ITTNOTIFY_VOID(model_iteration_taskA) +#define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA) +#define __itt_model_iteration_taskAL ITTNOTIFY_VOID(model_iteration_taskAL) +#define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL) +#define __itt_model_task_end ITTNOTIFY_VOID(model_task_end) +#define __itt_model_task_end_ptr ITTNOTIFY_NAME(model_task_end) +#define __itt_model_task_end_2 ITTNOTIFY_VOID(model_task_end_2) +#define __itt_model_task_end_2_ptr ITTNOTIFY_NAME(model_task_end_2) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_task_begin(task, instance, name) +#define __itt_model_task_begin_ptr 0 +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_task_beginW(name) +#define __itt_model_task_beginW_ptr 0 +#endif +#define __itt_model_task_beginA(name) +#define __itt_model_task_beginA_ptr 0 +#define __itt_model_task_beginAL(name, siteNameLen) +#define __itt_model_task_beginAL_ptr 0 +#define __itt_model_iteration_taskA(name) +#define __itt_model_iteration_taskA_ptr 0 +#define __itt_model_iteration_taskAL(name, siteNameLen) +#define __itt_model_iteration_taskAL_ptr 0 +#define __itt_model_task_end(task, instance) +#define __itt_model_task_end_ptr 0 +#define __itt_model_task_end_2() +#define __itt_model_task_end_2_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_task_begin_ptr 0 +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_model_task_beginW_ptr 0 +#endif +#define __itt_model_task_beginA_ptr 0 +#define __itt_model_task_beginAL_ptr 0 +#define __itt_model_iteration_taskA_ptr 0 +#define __itt_model_iteration_taskAL_ptr 0 +#define __itt_model_task_end_ptr 0 +#define __itt_model_task_end_2_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support + * + * lock_acquire/release model a potential lock for both lockset and + * performance modeling. Each unique address is modeled as a separate + * lock, with invalid addresses being valid lock IDs. Specifically: + * no storage is accessed by the API at the specified address - it is only + * used for lock identification. Lock acquires may be self-nested and are + * unlocked by a corresponding number of releases. + * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing, + * but may not have identical semantics.) + */ +void ITTAPI __itt_model_lock_acquire(void *lock); +void ITTAPI __itt_model_lock_acquire_2(void *lock); +void ITTAPI __itt_model_lock_release(void *lock); +void ITTAPI __itt_model_lock_release_2(void *lock); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock)) +ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock)) +ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock)) +ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock)) +#define __itt_model_lock_acquire ITTNOTIFY_VOID(model_lock_acquire) +#define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire) +#define __itt_model_lock_acquire_2 ITTNOTIFY_VOID(model_lock_acquire_2) +#define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2) +#define __itt_model_lock_release ITTNOTIFY_VOID(model_lock_release) +#define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release) +#define __itt_model_lock_release_2 ITTNOTIFY_VOID(model_lock_release_2) +#define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_lock_acquire(lock) +#define __itt_model_lock_acquire_ptr 0 +#define __itt_model_lock_acquire_2(lock) +#define __itt_model_lock_acquire_2_ptr 0 +#define __itt_model_lock_release(lock) +#define __itt_model_lock_release_ptr 0 +#define __itt_model_lock_release_2(lock) +#define __itt_model_lock_release_2_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_lock_acquire_ptr 0 +#define __itt_model_lock_acquire_2_ptr 0 +#define __itt_model_lock_release_ptr 0 +#define __itt_model_lock_release_2_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support + * + * record_allocation/deallocation describe user-defined memory allocator + * behavior, which may be required for correctness modeling to understand + * when storage is not expected to be actually reused across threads. + */ +void ITTAPI __itt_model_record_allocation (void *addr, size_t size); +void ITTAPI __itt_model_record_deallocation(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size)) +ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr)) +#define __itt_model_record_allocation ITTNOTIFY_VOID(model_record_allocation) +#define __itt_model_record_allocation_ptr ITTNOTIFY_NAME(model_record_allocation) +#define __itt_model_record_deallocation ITTNOTIFY_VOID(model_record_deallocation) +#define __itt_model_record_deallocation_ptr ITTNOTIFY_NAME(model_record_deallocation) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_record_allocation(addr, size) +#define __itt_model_record_allocation_ptr 0 +#define __itt_model_record_deallocation(addr) +#define __itt_model_record_deallocation_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_record_allocation_ptr 0 +#define __itt_model_record_deallocation_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_INDUCTION_USES support + * + * Note particular storage is inductive through the end of the current site + */ +void ITTAPI __itt_model_induction_uses(void* addr, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size)) +#define __itt_model_induction_uses ITTNOTIFY_VOID(model_induction_uses) +#define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_induction_uses(addr, size) +#define __itt_model_induction_uses_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_induction_uses_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_REDUCTION_USES support + * + * Note particular storage is used for reduction through the end + * of the current site + */ +void ITTAPI __itt_model_reduction_uses(void* addr, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size)) +#define __itt_model_reduction_uses ITTNOTIFY_VOID(model_reduction_uses) +#define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_reduction_uses(addr, size) +#define __itt_model_reduction_uses_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_reduction_uses_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_OBSERVE_USES support + * + * Have correctness modeling record observations about uses of storage + * through the end of the current site + */ +void ITTAPI __itt_model_observe_uses(void* addr, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size)) +#define __itt_model_observe_uses ITTNOTIFY_VOID(model_observe_uses) +#define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_observe_uses(addr, size) +#define __itt_model_observe_uses_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_observe_uses_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_CLEAR_USES support + * + * Clear the special handling of a piece of storage related to induction, + * reduction or observe_uses + */ +void ITTAPI __itt_model_clear_uses(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr)) +#define __itt_model_clear_uses ITTNOTIFY_VOID(model_clear_uses) +#define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_clear_uses(addr) +#define __itt_model_clear_uses_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_clear_uses_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support + * + * disable_push/disable_pop push and pop disabling based on a parameter. + * Disabling observations stops processing of memory references during + * correctness modeling, and all annotations that occur in the disabled + * region. This allows description of code that is expected to be handled + * specially during conversion to parallelism or that is not recognized + * by tools (e.g. some kinds of synchronization operations.) + * This mechanism causes all annotations in the disabled region, other + * than disable_push and disable_pop, to be ignored. (For example, this + * might validly be used to disable an entire parallel site and the contained + * tasks and locking in it for data collection purposes.) + * The disable for collection is a more expensive operation, but reduces + * collector overhead significantly. This applies to BOTH correctness data + * collection and performance data collection. For example, a site + * containing a task might only enable data collection for the first 10 + * iterations. Both performance and correctness data should reflect this, + * and the program should run as close to full speed as possible when + * collection is disabled. + */ +void ITTAPI __itt_model_disable_push(__itt_model_disable x); +void ITTAPI __itt_model_disable_pop(void); +void ITTAPI __itt_model_aggregate_task(size_t x); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x)) +ITT_STUBV(ITTAPI, void, model_disable_pop, (void)) +ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x)) +#define __itt_model_disable_push ITTNOTIFY_VOID(model_disable_push) +#define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push) +#define __itt_model_disable_pop ITTNOTIFY_VOID(model_disable_pop) +#define __itt_model_disable_pop_ptr ITTNOTIFY_NAME(model_disable_pop) +#define __itt_model_aggregate_task ITTNOTIFY_VOID(model_aggregate_task) +#define __itt_model_aggregate_task_ptr ITTNOTIFY_NAME(model_aggregate_task) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_model_disable_push(x) +#define __itt_model_disable_push_ptr 0 +#define __itt_model_disable_pop() +#define __itt_model_disable_pop_ptr 0 +#define __itt_model_aggregate_task(x) +#define __itt_model_aggregate_task_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_model_disable_push_ptr 0 +#define __itt_model_disable_pop_ptr 0 +#define __itt_model_aggregate_task_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} model group */ + +/** + * @defgroup heap Heap + * @ingroup public + * Heap group + * @{ + */ + +typedef void* __itt_heap_function; + +/** + * @brief Create an identification for heap function + * @return non-zero identifier or NULL + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_heap_function ITTAPI __itt_heap_function_createA(const char* name, const char* domain); +__itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t* name, const wchar_t* domain); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_heap_function_create __itt_heap_function_createW +# define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr +#else +# define __itt_heap_function_create __itt_heap_function_createA +# define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_heap_function ITTAPI __itt_heap_function_create(const char* name, const char* domain); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char* name, const char* domain)) +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t* name, const wchar_t* domain)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create, (const char* name, const char* domain)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_heap_function_createA ITTNOTIFY_DATA(heap_function_createA) +#define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA) +#define __itt_heap_function_createW ITTNOTIFY_DATA(heap_function_createW) +#define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_heap_function_create ITTNOTIFY_DATA(heap_function_create) +#define __itt_heap_function_create_ptr ITTNOTIFY_NAME(heap_function_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_heap_function_createA(name, domain) (__itt_heap_function)0 +#define __itt_heap_function_createA_ptr 0 +#define __itt_heap_function_createW(name, domain) (__itt_heap_function)0 +#define __itt_heap_function_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_heap_function_create(name, domain) (__itt_heap_function)0 +#define __itt_heap_function_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_heap_function_createA_ptr 0 +#define __itt_heap_function_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_heap_function_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an allocation begin occurrence. + */ +void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size, int initialized); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized)) +#define __itt_heap_allocate_begin ITTNOTIFY_VOID(heap_allocate_begin) +#define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_allocate_begin(h, size, initialized) +#define __itt_heap_allocate_begin_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_allocate_begin_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an allocation end occurrence. + */ +void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void** addr, size_t size, int initialized); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized)) +#define __itt_heap_allocate_end ITTNOTIFY_VOID(heap_allocate_end) +#define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_allocate_end(h, addr, size, initialized) +#define __itt_heap_allocate_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_allocate_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record a free begin occurrence. + */ +void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr)) +#define __itt_heap_free_begin ITTNOTIFY_VOID(heap_free_begin) +#define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_free_begin(h, addr) +#define __itt_heap_free_begin_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_free_begin_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record a free end occurrence. + */ +void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr)) +#define __itt_heap_free_end ITTNOTIFY_VOID(heap_free_end) +#define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_free_end(h, addr) +#define __itt_heap_free_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_free_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record a reallocation begin occurrence. + */ +void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized)) +#define __itt_heap_reallocate_begin ITTNOTIFY_VOID(heap_reallocate_begin) +#define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_reallocate_begin(h, addr, new_size, initialized) +#define __itt_heap_reallocate_begin_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_reallocate_begin_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record a reallocation end occurrence. + */ +void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized)) +#define __itt_heap_reallocate_end ITTNOTIFY_VOID(heap_reallocate_end) +#define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized) +#define __itt_heap_reallocate_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_reallocate_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief internal access begin */ +void ITTAPI __itt_heap_internal_access_begin(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void)) +#define __itt_heap_internal_access_begin ITTNOTIFY_VOID(heap_internal_access_begin) +#define __itt_heap_internal_access_begin_ptr ITTNOTIFY_NAME(heap_internal_access_begin) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_internal_access_begin() +#define __itt_heap_internal_access_begin_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_internal_access_begin_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief internal access end */ +void ITTAPI __itt_heap_internal_access_end(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void)) +#define __itt_heap_internal_access_end ITTNOTIFY_VOID(heap_internal_access_end) +#define __itt_heap_internal_access_end_ptr ITTNOTIFY_NAME(heap_internal_access_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_internal_access_end() +#define __itt_heap_internal_access_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_internal_access_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief record memory growth begin */ +void ITTAPI __itt_heap_record_memory_growth_begin(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void)) +#define __itt_heap_record_memory_growth_begin ITTNOTIFY_VOID(heap_record_memory_growth_begin) +#define __itt_heap_record_memory_growth_begin_ptr ITTNOTIFY_NAME(heap_record_memory_growth_begin) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_record_memory_growth_begin() +#define __itt_heap_record_memory_growth_begin_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_record_memory_growth_begin_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief record memory growth end */ +void ITTAPI __itt_heap_record_memory_growth_end(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void)) +#define __itt_heap_record_memory_growth_end ITTNOTIFY_VOID(heap_record_memory_growth_end) +#define __itt_heap_record_memory_growth_end_ptr ITTNOTIFY_NAME(heap_record_memory_growth_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_record_memory_growth_end() +#define __itt_heap_record_memory_growth_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_record_memory_growth_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Specify the type of heap detection/reporting to modify. + */ +/** + * @hideinitializer + * @brief Report on memory leaks. + */ +#define __itt_heap_leaks 0x00000001 + +/** + * @hideinitializer + * @brief Report on memory growth. + */ +#define __itt_heap_growth 0x00000002 + + +/** @brief heap reset detection */ +void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask)) +#define __itt_heap_reset_detection ITTNOTIFY_VOID(heap_reset_detection) +#define __itt_heap_reset_detection_ptr ITTNOTIFY_NAME(heap_reset_detection) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_reset_detection() +#define __itt_heap_reset_detection_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_reset_detection_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief report */ +void ITTAPI __itt_heap_record(unsigned int record_mask); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask)) +#define __itt_heap_record ITTNOTIFY_VOID(heap_record) +#define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_heap_record() +#define __itt_heap_record_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_heap_record_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @} heap group */ +/** @endcond */ +/* ========================================================================== */ + +/** + * @defgroup domains Domains + * @ingroup public + * Domains group + * @{ + */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_domain +{ + volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of different non-zero values is reserved to the runtime */ + const char* nameA; /*!< Copy of original name in ASCII. */ +#if defined(UNICODE) || defined(_UNICODE) + const wchar_t* nameW; /*!< Copy of original name in UNICODE. */ +#else /* UNICODE || _UNICODE */ + void* nameW; +#endif /* UNICODE || _UNICODE */ + int extra1; /*!< Reserved to the runtime */ + void* extra2; /*!< Reserved to the runtime */ + struct ___itt_domain* next; +} __itt_domain; + +#pragma pack(pop) +/** @endcond */ + +/** + * @ingroup domains + * @brief Create a domain. + * Create domain using some domain name: the URI naming style is recommended. + * Because the set of domains is expected to be static over the application's + * execution time, there is no mechanism to destroy a domain. + * Any domain can be accessed by any thread in the process, regardless of + * which thread created the domain. This call is thread-safe. + * @param[in] name name of domain + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_domain* ITTAPI __itt_domain_createA(const char *name); +__itt_domain* ITTAPI __itt_domain_createW(const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_domain_create __itt_domain_createW +# define __itt_domain_create_ptr __itt_domain_createW_ptr +#else /* UNICODE */ +# define __itt_domain_create __itt_domain_createA +# define __itt_domain_create_ptr __itt_domain_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_domain* ITTAPI __itt_domain_create(const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char *name)) +ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_domain_createA ITTNOTIFY_DATA(domain_createA) +#define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA) +#define __itt_domain_createW ITTNOTIFY_DATA(domain_createW) +#define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_domain_create ITTNOTIFY_DATA(domain_create) +#define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_domain_createA(name) (__itt_domain*)0 +#define __itt_domain_createA_ptr 0 +#define __itt_domain_createW(name) (__itt_domain*)0 +#define __itt_domain_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_domain_create(name) (__itt_domain*)0 +#define __itt_domain_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_domain_createA_ptr 0 +#define __itt_domain_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_domain_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} domains group */ + +/** + * @defgroup ids IDs + * @ingroup public + * IDs group + * @{ + */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_id +{ + unsigned long long d1, d2, d3; +} __itt_id; + +#pragma pack(pop) +/** @endcond */ + +static const __itt_id __itt_null = { 0, 0, 0 }; + +/** + * @ingroup ids + * @brief A convenience function is provided to create an ID without domain control. + * @brief This is a convenience function to initialize an __itt_id structure. This function + * does not affect the collector runtime in any way. After you make the ID with this + * function, you still must create it with the __itt_id_create function before using the ID + * to identify a named entity. + * @param[in] addr The address of object; high QWORD of the ID value. + * @param[in] extra The extra data to unique identify object; low QWORD of the ID value. + */ + +ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) ITT_INLINE_ATTRIBUTE; +ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) +{ + __itt_id id = __itt_null; + id.d1 = (unsigned long long)((uintptr_t)addr); + id.d2 = (unsigned long long)extra; + id.d3 = (unsigned long long)0; /* Reserved. Must be zero */ + return id; +} + +/** + * @ingroup ids + * @brief Create an instance of identifier. + * This establishes the beginning of the lifetime of an instance of + * the given ID in the trace. Once this lifetime starts, the ID + * can be used to tag named entity instances in calls such as + * __itt_task_begin, and to specify relationships among + * identified named entity instances, using the \ref relations APIs. + * Instance IDs are not domain specific! + * @param[in] domain The domain controlling the execution of this call. + * @param[in] id The ID to create. + */ +void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id)) +#define __itt_id_create(d,x) ITTNOTIFY_VOID_D1(id_create,d,x) +#define __itt_id_create_ptr ITTNOTIFY_NAME(id_create) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_id_create(domain,id) +#define __itt_id_create_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_id_create_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup ids + * @brief Destroy an instance of identifier. + * This ends the lifetime of the current instance of the given ID value in the trace. + * Any relationships that are established after this lifetime ends are invalid. + * This call must be performed before the given ID value can be reused for a different + * named entity instance. + * @param[in] domain The domain controlling the execution of this call. + * @param[in] id The ID to destroy. + */ +void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id)) +#define __itt_id_destroy(d,x) ITTNOTIFY_VOID_D1(id_destroy,d,x) +#define __itt_id_destroy_ptr ITTNOTIFY_NAME(id_destroy) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_id_destroy(domain,id) +#define __itt_id_destroy_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_id_destroy_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} ids group */ + +/** + * @defgroup handless String Handles + * @ingroup public + * String Handles group + * @{ + */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_string_handle +{ + const char* strA; /*!< Copy of original string in ASCII. */ +#if defined(UNICODE) || defined(_UNICODE) + const wchar_t* strW; /*!< Copy of original string in UNICODE. */ +#else /* UNICODE || _UNICODE */ + void* strW; +#endif /* UNICODE || _UNICODE */ + int extra1; /*!< Reserved. Must be zero */ + void* extra2; /*!< Reserved. Must be zero */ + struct ___itt_string_handle* next; +} __itt_string_handle; + +#pragma pack(pop) +/** @endcond */ + +/** + * @ingroup handles + * @brief Create a string handle. + * Create and return handle value that can be associated with a string. + * Consecutive calls to __itt_string_handle_create with the same name + * return the same value. Because the set of string handles is expected to remain + * static during the application's execution time, there is no mechanism to destroy a string handle. + * Any string handle can be accessed by any thread in the process, regardless of which thread created + * the string handle. This call is thread-safe. + * @param[in] name The input string + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_string_handle* ITTAPI __itt_string_handle_createA(const char *name); +__itt_string_handle* ITTAPI __itt_string_handle_createW(const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_string_handle_create __itt_string_handle_createW +# define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr +#else /* UNICODE */ +# define __itt_string_handle_create __itt_string_handle_createA +# define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_string_handle* ITTAPI __itt_string_handle_create(const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name)) +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create, (const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_string_handle_createA ITTNOTIFY_DATA(string_handle_createA) +#define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA) +#define __itt_string_handle_createW ITTNOTIFY_DATA(string_handle_createW) +#define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_string_handle_create ITTNOTIFY_DATA(string_handle_create) +#define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_string_handle_createA(name) (__itt_string_handle*)0 +#define __itt_string_handle_createA_ptr 0 +#define __itt_string_handle_createW(name) (__itt_string_handle*)0 +#define __itt_string_handle_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_string_handle_create(name) (__itt_string_handle*)0 +#define __itt_string_handle_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_string_handle_createA_ptr 0 +#define __itt_string_handle_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_string_handle_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} handles group */ + +/** @cond exclude_from_documentation */ +typedef unsigned long long __itt_timestamp; +/** @endcond */ + +#define __itt_timestamp_none ((__itt_timestamp)-1LL) + +/** @cond exclude_from_gpa_documentation */ + +/** + * @ingroup timestamps + * @brief Return timestamp corresponding to the current moment. + * This returns the timestamp in the format that is the most relevant for the current + * host or platform (RDTSC, QPC, and others). You can use the "<" operator to + * compare __itt_timestamp values. + */ +__itt_timestamp ITTAPI __itt_get_timestamp(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void)) +#define __itt_get_timestamp ITTNOTIFY_DATA(get_timestamp) +#define __itt_get_timestamp_ptr ITTNOTIFY_NAME(get_timestamp) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_get_timestamp() +#define __itt_get_timestamp_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_get_timestamp_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} timestamps */ +/** @endcond */ + +/** @cond exclude_from_gpa_documentation */ + +/** + * @defgroup regions Regions + * @ingroup public + * Regions group + * @{ + */ +/** + * @ingroup regions + * @brief Begin of region instance. + * Successive calls to __itt_region_begin with the same ID are ignored + * until a call to __itt_region_end with the same ID + * @param[in] domain The domain for this region instance + * @param[in] id The instance ID for this region instance. Must not be __itt_null + * @param[in] parentid The instance ID for the parent of this region instance, or __itt_null + * @param[in] name The name of this region + */ +void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name); + +/** + * @ingroup regions + * @brief End of region instance. + * The first call to __itt_region_end with a given ID ends the + * region. Successive calls with the same ID are ignored, as are + * calls that do not have a matching __itt_region_begin call. + * @param[in] domain The domain for this region instance + * @param[in] id The instance ID for this region instance + */ +void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id)) +#define __itt_region_begin(d,x,y,z) ITTNOTIFY_VOID_D3(region_begin,d,x,y,z) +#define __itt_region_begin_ptr ITTNOTIFY_NAME(region_begin) +#define __itt_region_end(d,x) ITTNOTIFY_VOID_D1(region_end,d,x) +#define __itt_region_end_ptr ITTNOTIFY_NAME(region_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_region_begin(d,x,y,z) +#define __itt_region_begin_ptr 0 +#define __itt_region_end(d,x) +#define __itt_region_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_region_begin_ptr 0 +#define __itt_region_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} regions group */ + +/** + * @defgroup frames Frames + * @ingroup public + * Frames are similar to regions, but are intended to be easier to use and to implement. + * In particular: + * - Frames always represent periods of elapsed time + * - By default, frames have no nesting relationships + * @{ + */ + +/** + * @ingroup frames + * @brief Begin a frame instance. + * Successive calls to __itt_frame_begin with the + * same ID are ignored until a call to __itt_frame_end with the same ID. + * @param[in] domain The domain for this frame instance + * @param[in] id The instance ID for this frame instance or NULL + */ +void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id); + +/** + * @ingroup frames + * @brief End a frame instance. + * The first call to __itt_frame_end with a given ID + * ends the frame. Successive calls with the same ID are ignored, as are + * calls that do not have a matching __itt_frame_begin call. + * @param[in] domain The domain for this frame instance + * @param[in] id The instance ID for this frame instance or NULL for current + */ +void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id); + +/** + * @ingroup frames + * @brief Submits a frame instance. + * Successive calls to __itt_frame_begin or __itt_frame_submit with the + * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit + * with the same ID. + * Passing special __itt_timestamp_none value as "end" argument means + * take the current timestamp as the end timestamp. + * @param[in] domain The domain for this frame instance + * @param[in] id The instance ID for this frame instance or NULL + * @param[in] begin Timestamp of the beginning of the frame + * @param[in] end Timestamp of the end of the frame + */ +void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id, + __itt_timestamp begin, __itt_timestamp end); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, frame_begin_v3, (const __itt_domain *domain, __itt_id *id)) +ITT_STUBV(ITTAPI, void, frame_end_v3, (const __itt_domain *domain, __itt_id *id)) +ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end)) +#define __itt_frame_begin_v3(d,x) ITTNOTIFY_VOID_D1(frame_begin_v3,d,x) +#define __itt_frame_begin_v3_ptr ITTNOTIFY_NAME(frame_begin_v3) +#define __itt_frame_end_v3(d,x) ITTNOTIFY_VOID_D1(frame_end_v3,d,x) +#define __itt_frame_end_v3_ptr ITTNOTIFY_NAME(frame_end_v3) +#define __itt_frame_submit_v3(d,x,b,e) ITTNOTIFY_VOID_D3(frame_submit_v3,d,x,b,e) +#define __itt_frame_submit_v3_ptr ITTNOTIFY_NAME(frame_submit_v3) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_frame_begin_v3(domain,id) +#define __itt_frame_begin_v3_ptr 0 +#define __itt_frame_end_v3(domain,id) +#define __itt_frame_end_v3_ptr 0 +#define __itt_frame_submit_v3(domain,id,begin,end) +#define __itt_frame_submit_v3_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_frame_begin_v3_ptr 0 +#define __itt_frame_end_v3_ptr 0 +#define __itt_frame_submit_v3_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} frames group */ +/** @endcond */ + +/** + * @defgroup taskgroup Task Group + * @ingroup public + * Task Group + * @{ + */ +/** + * @ingroup task_groups + * @brief Denotes a task_group instance. + * Successive calls to __itt_task_group with the same ID are ignored. + * @param[in] domain The domain for this task_group instance + * @param[in] id The instance ID for this task_group instance. Must not be __itt_null. + * @param[in] parentid The instance ID for the parent of this task_group instance, or __itt_null. + * @param[in] name The name of this task_group + */ +void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name)) +#define __itt_task_group(d,x,y,z) ITTNOTIFY_VOID_D3(task_group,d,x,y,z) +#define __itt_task_group_ptr ITTNOTIFY_NAME(task_group) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_task_group(d,x,y,z) +#define __itt_task_group_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_task_group_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} taskgroup group */ + +/** + * @defgroup tasks Tasks + * @ingroup public + * A task instance represents a piece of work performed by a particular + * thread for a period of time. A call to __itt_task_begin creates a + * task instance. This becomes the current instance for that task on that + * thread. A following call to __itt_task_end on the same thread ends the + * instance. There may be multiple simultaneous instances of tasks with the + * same name on different threads. If an ID is specified, the task instance + * receives that ID. Nested tasks are allowed. + * + * Note: The task is defined by the bracketing of __itt_task_begin and + * __itt_task_end on the same thread. If some scheduling mechanism causes + * task switching (the thread executes a different user task) or task + * switching (the user task switches to a different thread) then this breaks + * the notion of current instance. Additional API calls are required to + * deal with that possibility. + * @{ + */ + +/** + * @ingroup tasks + * @brief Begin a task instance. + * @param[in] domain The domain for this task + * @param[in] taskid The instance ID for this task instance, or __itt_null + * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null + * @param[in] name The name of this task + */ +void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name); + +/** + * @ingroup tasks + * @brief Begin a task instance. + * @param[in] domain The domain for this task + * @param[in] taskid The identifier for this task instance (may be 0) + * @param[in] parentid The parent of this task (may be 0) + * @param[in] fn The pointer to the function you are tracing + */ +void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, void* fn); + +/** + * @ingroup tasks + * @brief End the current task instance. + * @param[in] domain The domain for this task + */ +void ITTAPI __itt_task_end(const __itt_domain *domain); + +/** + * @ingroup tasks + * @brief Begin an overlapped task instance. + * @param[in] domain The domain for this task. + * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null. + * @param[in] parentid The parent of this task, or __itt_null. + * @param[in] name The name of this task. + */ +void ITTAPI __itt_task_begin_overlapped(const __itt_domain* domain, __itt_id taskid, __itt_id parentid, __itt_string_handle* name); + +/** + * @ingroup tasks + * @brief End an overlapped task instance. + * @param[in] domain The domain for this task + * @param[in] taskid Explicit ID of finished task + */ +void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain, __itt_id taskid); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, task_begin, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parentid, void* fn)) +ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain)) +ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, task_end_overlapped, (const __itt_domain *domain, __itt_id taskid)) +#define __itt_task_begin(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin,d,x,y,z) +#define __itt_task_begin_ptr ITTNOTIFY_NAME(task_begin) +#define __itt_task_begin_fn(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_fn,d,x,y,z) +#define __itt_task_begin_fn_ptr ITTNOTIFY_NAME(task_begin_fn) +#define __itt_task_end(d) ITTNOTIFY_VOID_D0(task_end,d) +#define __itt_task_end_ptr ITTNOTIFY_NAME(task_end) +#define __itt_task_begin_overlapped(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_overlapped,d,x,y,z) +#define __itt_task_begin_overlapped_ptr ITTNOTIFY_NAME(task_begin_overlapped) +#define __itt_task_end_overlapped(d,x) ITTNOTIFY_VOID_D1(task_end_overlapped,d,x) +#define __itt_task_end_overlapped_ptr ITTNOTIFY_NAME(task_end_overlapped) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_task_begin(domain,id,parentid,name) +#define __itt_task_begin_ptr 0 +#define __itt_task_begin_fn(domain,id,parentid,fn) +#define __itt_task_begin_fn_ptr 0 +#define __itt_task_end(domain) +#define __itt_task_end_ptr 0 +#define __itt_task_begin_overlapped(domain,taskid,parentid,name) +#define __itt_task_begin_overlapped_ptr 0 +#define __itt_task_end_overlapped(domain,taskid) +#define __itt_task_end_overlapped_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_task_begin_ptr 0 +#define __itt_task_begin_fn_ptr 0 +#define __itt_task_end_ptr 0 +#define __itt_task_begin_overlapped_ptr 0 +#define __itt_task_end_overlapped_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} tasks group */ + + +/** + * @defgroup markers Markers + * Markers represent a single discreet event in time. Markers have a scope, + * described by an enumerated type __itt_scope. Markers are created by + * the API call __itt_marker. A marker instance can be given an ID for use in + * adding metadata. + * @{ + */ + +/** + * @brief Describes the scope of an event object in the trace. + */ +typedef enum +{ + __itt_scope_unknown = 0, + __itt_scope_global, + __itt_scope_track_group, + __itt_scope_track, + __itt_scope_task, + __itt_scope_marker +} __itt_scope; + +/** @cond exclude_from_documentation */ +#define __itt_marker_scope_unknown __itt_scope_unknown +#define __itt_marker_scope_global __itt_scope_global +#define __itt_marker_scope_process __itt_scope_track_group +#define __itt_marker_scope_thread __itt_scope_track +#define __itt_marker_scope_task __itt_scope_task +/** @endcond */ + +/** + * @ingroup markers + * @brief Create a marker instance + * @param[in] domain The domain for this marker + * @param[in] id The instance ID for this marker or __itt_null + * @param[in] name The name for this marker + * @param[in] scope The scope for this marker + */ +void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope)) +#define __itt_marker(d,x,y,z) ITTNOTIFY_VOID_D3(marker,d,x,y,z) +#define __itt_marker_ptr ITTNOTIFY_NAME(marker) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_marker(domain,id,name,scope) +#define __itt_marker_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_marker_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} markers group */ + +/** + * @defgroup metadata Metadata + * The metadata API is used to attach extra information to named + * entities. Metadata can be attached to an identified named entity by ID, + * or to the current entity (which is always a task). + * + * Conceptually metadata has a type (what kind of metadata), a key (the + * name of the metadata), and a value (the actual data). The encoding of + * the value depends on the type of the metadata. + * + * The type of metadata is specified by an enumerated type __itt_metdata_type. + * @{ + */ + +/** + * @ingroup parameters + * @brief describes the type of metadata + */ +typedef enum { + __itt_metadata_unknown = 0, + __itt_metadata_u64, /**< Unsigned 64-bit integer */ + __itt_metadata_s64, /**< Signed 64-bit integer */ + __itt_metadata_u32, /**< Unsigned 32-bit integer */ + __itt_metadata_s32, /**< Signed 32-bit integer */ + __itt_metadata_u16, /**< Unsigned 16-bit integer */ + __itt_metadata_s16, /**< Signed 16-bit integer */ + __itt_metadata_float, /**< Signed 32-bit floating-point */ + __itt_metadata_double /**< SIgned 64-bit floating-point */ +} __itt_metadata_type; + +/** + * @ingroup parameters + * @brief Add metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task + * @param[in] key The name of the metadata + * @param[in] type The type of the metadata + * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added. + * @param[in] data The metadata itself +*/ +void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data)) +#define __itt_metadata_add(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add,d,x,y,z,a,b) +#define __itt_metadata_add_ptr ITTNOTIFY_NAME(metadata_add) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_metadata_add(d,x,y,z,a,b) +#define __itt_metadata_add_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_metadata_add_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup parameters + * @brief Add string metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task + * @param[in] key The name of the metadata + * @param[in] data The metadata itself + * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated +*/ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length); +void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_metadata_str_add __itt_metadata_str_addW +# define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr +#else /* UNICODE */ +# define __itt_metadata_str_add __itt_metadata_str_addA +# define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length); +#endif + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length)) +ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_addA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addA,d,x,y,z,a) +#define __itt_metadata_str_addA_ptr ITTNOTIFY_NAME(metadata_str_addA) +#define __itt_metadata_str_addW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addW,d,x,y,z,a) +#define __itt_metadata_str_addW_ptr ITTNOTIFY_NAME(metadata_str_addW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add,d,x,y,z,a) +#define __itt_metadata_str_add_ptr ITTNOTIFY_NAME(metadata_str_add) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_addA(d,x,y,z,a) +#define __itt_metadata_str_addA_ptr 0 +#define __itt_metadata_str_addW(d,x,y,z,a) +#define __itt_metadata_str_addW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add(d,x,y,z,a) +#define __itt_metadata_str_add_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_addA_ptr 0 +#define __itt_metadata_str_addW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup parameters + * @brief Add metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] scope The scope of the instance to which the metadata is to be added + + * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task + + * @param[in] key The name of the metadata + * @param[in] type The type of the metadata + * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added. + * @param[in] data The metadata itself +*/ +void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data)) +#define __itt_metadata_add_with_scope(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add_with_scope,d,x,y,z,a,b) +#define __itt_metadata_add_with_scope_ptr ITTNOTIFY_NAME(metadata_add_with_scope) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_metadata_add_with_scope(d,x,y,z,a,b) +#define __itt_metadata_add_with_scope_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_metadata_add_with_scope_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup parameters + * @brief Add string metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] scope The scope of the instance to which the metadata is to be added + + * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task + + * @param[in] key The name of the metadata + * @param[in] data The metadata itself + * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated +*/ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length); +void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeW +# define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeW_ptr +#else /* UNICODE */ +# define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeA +# define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length); +#endif + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length)) +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_add_with_scopeA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA,d,x,y,z,a) +#define __itt_metadata_str_add_with_scopeA_ptr ITTNOTIFY_NAME(metadata_str_add_with_scopeA) +#define __itt_metadata_str_add_with_scopeW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW,d,x,y,z,a) +#define __itt_metadata_str_add_with_scopeW_ptr ITTNOTIFY_NAME(metadata_str_add_with_scopeW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add_with_scope(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scope,d,x,y,z,a) +#define __itt_metadata_str_add_with_scope_ptr ITTNOTIFY_NAME(metadata_str_add_with_scope) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_add_with_scopeA(d,x,y,z,a) +#define __itt_metadata_str_add_with_scopeA_ptr 0 +#define __itt_metadata_str_add_with_scopeW(d,x,y,z,a) +#define __itt_metadata_str_add_with_scopeW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add_with_scope(d,x,y,z,a) +#define __itt_metadata_str_add_with_scope_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_metadata_str_add_with_scopeA_ptr 0 +#define __itt_metadata_str_add_with_scopeW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_metadata_str_add_with_scope_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @} metadata group */ + +/** + * @defgroup relations Relations + * Instances of named entities can be explicitly associated with other + * instances using instance IDs and the relationship API calls. + * + * @{ + */ + +/** + * @ingroup relations + * @brief The kind of relation between two instances is specified by the enumerated type __itt_relation. + * Relations between instances can be added with an API call. The relation + * API uses instance IDs. Relations can be added before or after the actual + * instances are created and persist independently of the instances. This + * is the motivation for having different lifetimes for instance IDs and + * the actual instances. + */ +typedef enum +{ + __itt_relation_is_unknown = 0, + __itt_relation_is_dependent_on, /**< "A is dependent on B" means that A cannot start until B completes */ + __itt_relation_is_sibling_of, /**< "A is sibling of B" means that A and B were created as a group */ + __itt_relation_is_parent_of, /**< "A is parent of B" means that A created B */ + __itt_relation_is_continuation_of, /**< "A is continuation of B" means that A assumes the dependencies of B */ + __itt_relation_is_child_of, /**< "A is child of B" means that A was created by B (inverse of is_parent_of) */ + __itt_relation_is_continued_by, /**< "A is continued by B" means that B assumes the dependencies of A (inverse of is_continuation_of) */ + __itt_relation_is_predecessor_to /**< "A is predecessor to B" means that B cannot start until A completes (inverse of is_dependent_on) */ +} __itt_relation; + +/** + * @ingroup relations + * @brief Add a relation to the current task instance. + * The current task instance is the head of the relation. + * @param[in] domain The domain controlling this call + * @param[in] relation The kind of relation + * @param[in] tail The ID for the tail of the relation + */ +void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain, __itt_relation relation, __itt_id tail); + +/** + * @ingroup relations + * @brief Add a relation between two instance identifiers. + * @param[in] domain The domain controlling this call + * @param[in] head The ID for the head of the relation + * @param[in] relation The kind of relation + * @param[in] tail The ID for the tail of the relation + */ +void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail)) +ITT_STUBV(ITTAPI, void, relation_add, (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail)) +#define __itt_relation_add_to_current(d,x,y) ITTNOTIFY_VOID_D2(relation_add_to_current,d,x,y) +#define __itt_relation_add_to_current_ptr ITTNOTIFY_NAME(relation_add_to_current) +#define __itt_relation_add(d,x,y,z) ITTNOTIFY_VOID_D3(relation_add,d,x,y,z) +#define __itt_relation_add_ptr ITTNOTIFY_NAME(relation_add) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_relation_add_to_current(d,x,y) +#define __itt_relation_add_to_current_ptr 0 +#define __itt_relation_add(d,x,y,z) +#define __itt_relation_add_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_relation_add_to_current_ptr 0 +#define __itt_relation_add_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} relations group */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_clock_info +{ + unsigned long long clock_freq; /*!< Clock domain frequency */ + unsigned long long clock_base; /*!< Clock domain base timestamp */ +} __itt_clock_info; + +#pragma pack(pop) +/** @endcond */ + +/** @cond exclude_from_documentation */ +typedef void (ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info* clock_info, void* data); +/** @endcond */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_clock_domain +{ + __itt_clock_info info; /*!< Most recent clock domain info */ + __itt_get_clock_info_fn fn; /*!< Callback function pointer */ + void* fn_data; /*!< Input argument for the callback function */ + int extra1; /*!< Reserved. Must be zero */ + void* extra2; /*!< Reserved. Must be zero */ + struct ___itt_clock_domain* next; +} __itt_clock_domain; + +#pragma pack(pop) +/** @endcond */ + +/** + * @ingroup clockdomains + * @brief Create a clock domain. + * Certain applications require the capability to trace their application using + * a clock domain different than the CPU, for instance the instrumentation of events + * that occur on a GPU. + * Because the set of domains is expected to be static over the application's execution time, + * there is no mechanism to destroy a domain. + * Any domain can be accessed by any thread in the process, regardless of which thread created + * the domain. This call is thread-safe. + * @param[in] fn A pointer to a callback function which retrieves alternative CPU timestamps + * @param[in] fn_data Argument for a callback function; may be NULL + */ +__itt_clock_domain* ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn, void* fn_data); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data)) +#define __itt_clock_domain_create ITTNOTIFY_DATA(clock_domain_create) +#define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_clock_domain_create(fn,fn_data) (__itt_clock_domain*)0 +#define __itt_clock_domain_create_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_clock_domain_create_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup clockdomains + * @brief Recalculate clock domains frequencies and clock base timestamps. + */ +void ITTAPI __itt_clock_domain_reset(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, clock_domain_reset, (void)) +#define __itt_clock_domain_reset ITTNOTIFY_VOID(clock_domain_reset) +#define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_clock_domain_reset() +#define __itt_clock_domain_reset_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_clock_domain_reset_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup clockdomain + * @brief Create an instance of identifier. This establishes the beginning of the lifetime of + * an instance of the given ID in the trace. Once this lifetime starts, the ID can be used to + * tag named entity instances in calls such as __itt_task_begin, and to specify relationships among + * identified named entity instances, using the \ref relations APIs. + * @param[in] domain The domain controlling the execution of this call. + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] id The ID to create. + */ +void ITTAPI __itt_id_create_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id); + +/** + * @ingroup clockdomain + * @brief Destroy an instance of identifier. This ends the lifetime of the current instance of the + * given ID value in the trace. Any relationships that are established after this lifetime ends are + * invalid. This call must be performed before the given ID value can be reused for a different + * named entity instance. + * @param[in] domain The domain controlling the execution of this call. + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] id The ID to destroy. + */ +void ITTAPI __itt_id_destroy_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, id_create_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id)) +ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id)) +#define __itt_id_create_ex(d,x,y,z) ITTNOTIFY_VOID_D3(id_create_ex,d,x,y,z) +#define __itt_id_create_ex_ptr ITTNOTIFY_NAME(id_create_ex) +#define __itt_id_destroy_ex(d,x,y,z) ITTNOTIFY_VOID_D3(id_destroy_ex,d,x,y,z) +#define __itt_id_destroy_ex_ptr ITTNOTIFY_NAME(id_destroy_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_id_create_ex(domain,clock_domain,timestamp,id) +#define __itt_id_create_ex_ptr 0 +#define __itt_id_destroy_ex(domain,clock_domain,timestamp,id) +#define __itt_id_destroy_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_id_create_ex_ptr 0 +#define __itt_id_destroy_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup clockdomain + * @brief Begin a task instance. + * @param[in] domain The domain for this task + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] taskid The instance ID for this task instance, or __itt_null + * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null + * @param[in] name The name of this task + */ +void ITTAPI __itt_task_begin_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name); + +/** + * @ingroup clockdomain + * @brief Begin a task instance. + * @param[in] domain The domain for this task + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] taskid The identifier for this task instance, or __itt_null + * @param[in] parentid The parent of this task, or __itt_null + * @param[in] fn The pointer to the function you are tracing + */ +void ITTAPI __itt_task_begin_fn_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, void* fn); + +/** + * @ingroup clockdomain + * @brief End the current task instance. + * @param[in] domain The domain for this task + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + */ +void ITTAPI __itt_task_end_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, task_begin_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, task_begin_fn_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn)) +ITT_STUBV(ITTAPI, void, task_end_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp)) +#define __itt_task_begin_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_ex,d,x,y,z,a,b) +#define __itt_task_begin_ex_ptr ITTNOTIFY_NAME(task_begin_ex) +#define __itt_task_begin_fn_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_fn_ex,d,x,y,z,a,b) +#define __itt_task_begin_fn_ex_ptr ITTNOTIFY_NAME(task_begin_fn_ex) +#define __itt_task_end_ex(d,x,y) ITTNOTIFY_VOID_D2(task_end_ex,d,x,y) +#define __itt_task_end_ex_ptr ITTNOTIFY_NAME(task_end_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_task_begin_ex(domain,clock_domain,timestamp,id,parentid,name) +#define __itt_task_begin_ex_ptr 0 +#define __itt_task_begin_fn_ex(domain,clock_domain,timestamp,id,parentid,fn) +#define __itt_task_begin_fn_ex_ptr 0 +#define __itt_task_end_ex(domain,clock_domain,timestamp) +#define __itt_task_end_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_task_begin_ex_ptr 0 +#define __itt_task_begin_fn_ex_ptr 0 +#define __itt_task_end_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @defgroup counters Counters + * @ingroup public + * Counters are user-defined objects with a monotonically increasing + * value. Counter values are 64-bit unsigned integers. + * Counters have names that can be displayed in + * the tools. + * @{ + */ + +/** + * @brief opaque structure for counter identification + */ +/** @cond exclude_from_documentation */ + +typedef struct ___itt_counter* __itt_counter; + +/** + * @brief Create an unsigned 64 bits integer counter with given name/domain + * + * After __itt_counter_create() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta), + * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr) + * can be used to change the value of the counter, where value_ptr is a pointer to an unsigned 64 bits integer + * + * The call is equal to __itt_counter_create_typed(name, domain, __itt_metadata_u64) + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_counter ITTAPI __itt_counter_createA(const char *name, const char *domain); +__itt_counter ITTAPI __itt_counter_createW(const wchar_t *name, const wchar_t *domain); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_counter_create __itt_counter_createW +# define __itt_counter_create_ptr __itt_counter_createW_ptr +#else /* UNICODE */ +# define __itt_counter_create __itt_counter_createA +# define __itt_counter_create_ptr __itt_counter_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char *name, const char *domain)) +ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_counter, counter_create, (const char *name, const char *domain)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_createA ITTNOTIFY_DATA(counter_createA) +#define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA) +#define __itt_counter_createW ITTNOTIFY_DATA(counter_createW) +#define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create ITTNOTIFY_DATA(counter_create) +#define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_createA(name, domain) +#define __itt_counter_createA_ptr 0 +#define __itt_counter_createW(name, domain) +#define __itt_counter_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create(name, domain) +#define __itt_counter_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_createA_ptr 0 +#define __itt_counter_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Increment the unsigned 64 bits integer counter value + * + * Calling this function to non-unsigned 64 bits integer counters has no effect + */ +void ITTAPI __itt_counter_inc(__itt_counter id); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id)) +#define __itt_counter_inc ITTNOTIFY_VOID(counter_inc) +#define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_inc(id) +#define __itt_counter_inc_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_inc_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** + * @brief Increment the unsigned 64 bits integer counter value with x + * + * Calling this function to non-unsigned 64 bits integer counters has no effect + */ +void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value)) +#define __itt_counter_inc_delta ITTNOTIFY_VOID(counter_inc_delta) +#define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_inc_delta(id, value) +#define __itt_counter_inc_delta_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_inc_delta_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Decrement the unsigned 64 bits integer counter value + * + * Calling this function to non-unsigned 64 bits integer counters has no effect + */ +void ITTAPI __itt_counter_dec(__itt_counter id); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id)) +#define __itt_counter_dec ITTNOTIFY_VOID(counter_dec) +#define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_dec(id) +#define __itt_counter_dec_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_dec_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** + * @brief Decrement the unsigned 64 bits integer counter value with x + * + * Calling this function to non-unsigned 64 bits integer counters has no effect + */ +void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value)) +#define __itt_counter_dec_delta ITTNOTIFY_VOID(counter_dec_delta) +#define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_dec_delta(id, value) +#define __itt_counter_dec_delta_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_dec_delta_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup counters + * @brief Increment a counter by one. + * The first call with a given name creates a counter by that name and sets its + * value to zero. Successive calls increment the counter value. + * @param[in] domain The domain controlling the call. Counter names are not domain specific. + * The domain argument is used only to enable or disable the API calls. + * @param[in] name The name of the counter + */ +void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain, __itt_string_handle *name); + +/** + * @ingroup counters + * @brief Increment a counter by the value specified in delta. + * @param[in] domain The domain controlling the call. Counter names are not domain specific. + * The domain argument is used only to enable or disable the API calls. + * @param[in] name The name of the counter + * @param[in] delta The amount by which to increment the counter + */ +void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_inc_v3, (const __itt_domain *domain, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta)) +#define __itt_counter_inc_v3(d,x) ITTNOTIFY_VOID_D1(counter_inc_v3,d,x) +#define __itt_counter_inc_v3_ptr ITTNOTIFY_NAME(counter_inc_v3) +#define __itt_counter_inc_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_inc_delta_v3,d,x,y) +#define __itt_counter_inc_delta_v3_ptr ITTNOTIFY_NAME(counter_inc_delta_v3) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_inc_v3(domain,name) +#define __itt_counter_inc_v3_ptr 0 +#define __itt_counter_inc_delta_v3(domain,name,delta) +#define __itt_counter_inc_delta_v3_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_inc_v3_ptr 0 +#define __itt_counter_inc_delta_v3_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + + +/** + * @ingroup counters + * @brief Decrement a counter by one. + * The first call with a given name creates a counter by that name and sets its + * value to zero. Successive calls decrement the counter value. + * @param[in] domain The domain controlling the call. Counter names are not domain specific. + * The domain argument is used only to enable or disable the API calls. + * @param[in] name The name of the counter + */ +void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain, __itt_string_handle *name); + +/** + * @ingroup counters + * @brief Decrement a counter by the value specified in delta. + * @param[in] domain The domain controlling the call. Counter names are not domain specific. + * The domain argument is used only to enable or disable the API calls. + * @param[in] name The name of the counter + * @param[in] delta The amount by which to decrement the counter + */ +void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_dec_v3, (const __itt_domain *domain, __itt_string_handle *name)) +ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta)) +#define __itt_counter_dec_v3(d,x) ITTNOTIFY_VOID_D1(counter_dec_v3,d,x) +#define __itt_counter_dec_v3_ptr ITTNOTIFY_NAME(counter_dec_v3) +#define __itt_counter_dec_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_dec_delta_v3,d,x,y) +#define __itt_counter_dec_delta_v3_ptr ITTNOTIFY_NAME(counter_dec_delta_v3) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_dec_v3(domain,name) +#define __itt_counter_dec_v3_ptr 0 +#define __itt_counter_dec_delta_v3(domain,name,delta) +#define __itt_counter_dec_delta_v3_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_dec_v3_ptr 0 +#define __itt_counter_dec_delta_v3_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @} counters group */ + + +/** + * @brief Set the counter value + */ +void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr)) +#define __itt_counter_set_value ITTNOTIFY_VOID(counter_set_value) +#define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_set_value(id, value_ptr) +#define __itt_counter_set_value_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_set_value_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Set the counter value + */ +void ITTAPI __itt_counter_set_value_ex(__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr)) +#define __itt_counter_set_value_ex ITTNOTIFY_VOID(counter_set_value_ex) +#define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr) +#define __itt_counter_set_value_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_set_value_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Create a typed counter with given name/domain + * + * After __itt_counter_create_typed() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta), + * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr) + * can be used to change the value of the counter + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_counter ITTAPI __itt_counter_create_typedA(const char *name, const char *domain, __itt_metadata_type type); +__itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name, const wchar_t *domain, __itt_metadata_type type); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_counter_create_typed __itt_counter_create_typedW +# define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr +#else /* UNICODE */ +# define __itt_counter_create_typed __itt_counter_create_typedA +# define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_counter ITTAPI __itt_counter_create_typed(const char *name, const char *domain, __itt_metadata_type type); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char *name, const char *domain, __itt_metadata_type type)) +ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, const char *domain, __itt_metadata_type type)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_create_typedA ITTNOTIFY_DATA(counter_create_typedA) +#define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA) +#define __itt_counter_create_typedW ITTNOTIFY_DATA(counter_create_typedW) +#define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create_typed ITTNOTIFY_DATA(counter_create_typed) +#define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_create_typedA(name, domain, type) +#define __itt_counter_create_typedA_ptr 0 +#define __itt_counter_create_typedW(name, domain, type) +#define __itt_counter_create_typedW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create_typed(name, domain, type) +#define __itt_counter_create_typed_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_counter_create_typedA_ptr 0 +#define __itt_counter_create_typedW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_counter_create_typed_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Destroy the counter identified by the pointer previously returned by __itt_counter_create() or + * __itt_counter_create_typed() + */ +void ITTAPI __itt_counter_destroy(__itt_counter id); + +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id)) +#define __itt_counter_destroy ITTNOTIFY_VOID(counter_destroy) +#define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_counter_destroy(id) +#define __itt_counter_destroy_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_counter_destroy_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} counters group */ + +/** + * @ingroup markers + * @brief Create a marker instance. + * @param[in] domain The domain for this marker + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] id The instance ID for this marker, or __itt_null + * @param[in] name The name for this marker + * @param[in] scope The scope for this marker + */ +void ITTAPI __itt_marker_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, marker_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope)) +#define __itt_marker_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(marker_ex,d,x,y,z,a,b) +#define __itt_marker_ex_ptr ITTNOTIFY_NAME(marker_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_marker_ex(domain,clock_domain,timestamp,id,name,scope) +#define __itt_marker_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_marker_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup clockdomain + * @brief Add a relation to the current task instance. + * The current task instance is the head of the relation. + * @param[in] domain The domain controlling this call + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] relation The kind of relation + * @param[in] tail The ID for the tail of the relation + */ +void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail); + +/** + * @ingroup clockdomain + * @brief Add a relation between two instance identifiers. + * @param[in] domain The domain controlling this call + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] head The ID for the head of the relation + * @param[in] relation The kind of relation + * @param[in] tail The ID for the tail of the relation + */ +void ITTAPI __itt_relation_add_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail)) +ITT_STUBV(ITTAPI, void, relation_add_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail)) +#define __itt_relation_add_to_current_ex(d,x,y,z,a) ITTNOTIFY_VOID_D4(relation_add_to_current_ex,d,x,y,z,a) +#define __itt_relation_add_to_current_ex_ptr ITTNOTIFY_NAME(relation_add_to_current_ex) +#define __itt_relation_add_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(relation_add_ex,d,x,y,z,a,b) +#define __itt_relation_add_ex_ptr ITTNOTIFY_NAME(relation_add_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_relation_add_to_current_ex(domain,clock_domain,timestame,relation,tail) +#define __itt_relation_add_to_current_ex_ptr 0 +#define __itt_relation_add_ex(domain,clock_domain,timestamp,head,relation,tail) +#define __itt_relation_add_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_relation_add_to_current_ex_ptr 0 +#define __itt_relation_add_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @cond exclude_from_documentation */ +typedef enum ___itt_track_group_type +{ + __itt_track_group_type_normal = 0 +} __itt_track_group_type; +/** @endcond */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_track_group +{ + __itt_string_handle* name; /*!< Name of the track group */ + struct ___itt_track* track; /*!< List of child tracks */ + __itt_track_group_type tgtype; /*!< Type of the track group */ + int extra1; /*!< Reserved. Must be zero */ + void* extra2; /*!< Reserved. Must be zero */ + struct ___itt_track_group* next; +} __itt_track_group; + +#pragma pack(pop) +/** @endcond */ + +/** + * @brief Placeholder for custom track types. Currently, "normal" custom track + * is the only available track type. + */ +typedef enum ___itt_track_type +{ + __itt_track_type_normal = 0 +#ifdef INTEL_ITTNOTIFY_API_PRIVATE + , __itt_track_type_queue +#endif /* INTEL_ITTNOTIFY_API_PRIVATE */ +} __itt_track_type; + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_track +{ + __itt_string_handle* name; /*!< Name of the track group */ + __itt_track_group* group; /*!< Parent group to a track */ + __itt_track_type ttype; /*!< Type of the track */ + int extra1; /*!< Reserved. Must be zero */ + void* extra2; /*!< Reserved. Must be zero */ + struct ___itt_track* next; +} __itt_track; + +#pragma pack(pop) +/** @endcond */ + +/** + * @brief Create logical track group. + */ +__itt_track_group* ITTAPI __itt_track_group_create(__itt_string_handle* name, __itt_track_group_type track_group_type); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type)) +#define __itt_track_group_create ITTNOTIFY_DATA(track_group_create) +#define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_track_group_create(name) (__itt_track_group*)0 +#define __itt_track_group_create_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_track_group_create_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Create logical track. + */ +__itt_track* ITTAPI __itt_track_create(__itt_track_group* track_group, __itt_string_handle* name, __itt_track_type track_type); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type)) +#define __itt_track_create ITTNOTIFY_DATA(track_create) +#define __itt_track_create_ptr ITTNOTIFY_NAME(track_create) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_track_create(track_group,name,track_type) (__itt_track*)0 +#define __itt_track_create_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_track_create_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Set the logical track. + */ +void ITTAPI __itt_set_track(__itt_track* track); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track)) +#define __itt_set_track ITTNOTIFY_VOID(set_track) +#define __itt_set_track_ptr ITTNOTIFY_NAME(set_track) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_set_track(track) +#define __itt_set_track_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_set_track_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/* ========================================================================== */ +/** @cond exclude_from_gpa_documentation */ +/** + * @defgroup events Events + * @ingroup public + * Events group + * @{ + */ +/** @brief user event type */ +typedef int __itt_event; + +/** + * @brief Create an event notification + * @note name or namelen being null/name and namelen not matching, user event feature not enabled + * @return non-zero event identifier upon success and __itt_err otherwise + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen); +__itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_event_create __itt_event_createW +# define __itt_event_create_ptr __itt_event_createW_ptr +#else +# define __itt_event_create __itt_event_createA +# define __itt_event_create_ptr __itt_event_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_event LIBITTAPI __itt_event_create(const char *name, int namelen); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen)) +ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA ITTNOTIFY_DATA(event_createA) +#define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA) +#define __itt_event_createW ITTNOTIFY_DATA(event_createW) +#define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create ITTNOTIFY_DATA(event_create) +#define __itt_event_create_ptr ITTNOTIFY_NAME(event_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA(name, namelen) (__itt_event)0 +#define __itt_event_createA_ptr 0 +#define __itt_event_createW(name, namelen) (__itt_event)0 +#define __itt_event_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create(name, namelen) (__itt_event)0 +#define __itt_event_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA_ptr 0 +#define __itt_event_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an event occurrence. + * @return __itt_err upon failure (invalid event id/user event feature not enabled) + */ +int LIBITTAPI __itt_event_start(__itt_event event); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event)) +#define __itt_event_start ITTNOTIFY_DATA(event_start) +#define __itt_event_start_ptr ITTNOTIFY_NAME(event_start) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_event_start(event) (int)0 +#define __itt_event_start_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_event_start_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an event end occurrence. + * @note It is optional if events do not have durations. + * @return __itt_err upon failure (invalid event id/user event feature not enabled) + */ +int LIBITTAPI __itt_event_end(__itt_event event); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event)) +#define __itt_event_end ITTNOTIFY_DATA(event_end) +#define __itt_event_end_ptr ITTNOTIFY_NAME(event_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_event_end(event) (int)0 +#define __itt_event_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_event_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} events group */ + + +/** + * @defgroup arrays Arrays Visualizer + * @ingroup public + * Visualize arrays + * @{ + */ + +/** + * @enum __itt_av_data_type + * @brief Defines types of arrays data (for C/C++ intrinsic types) + */ +typedef enum +{ + __itt_e_first = 0, + __itt_e_char = 0, /* 1-byte integer */ + __itt_e_uchar, /* 1-byte unsigned integer */ + __itt_e_int16, /* 2-byte integer */ + __itt_e_uint16, /* 2-byte unsigned integer */ + __itt_e_int32, /* 4-byte integer */ + __itt_e_uint32, /* 4-byte unsigned integer */ + __itt_e_int64, /* 8-byte integer */ + __itt_e_uint64, /* 8-byte unsigned integer */ + __itt_e_float, /* 4-byte floating */ + __itt_e_double, /* 8-byte floating */ + __itt_e_last = __itt_e_double +} __itt_av_data_type; + +/** + * @brief Save an array data to a file. + * Output format is defined by the file extension. The csv and bmp formats are supported (bmp - for 2-dimensional array only). + * @param[in] data - pointer to the array data + * @param[in] rank - the rank of the array + * @param[in] dimensions - pointer to an array of integers, which specifies the array dimensions. + * The size of dimensions must be equal to the rank + * @param[in] type - the type of the array, specified as one of the __itt_av_data_type values (for intrinsic types) + * @param[in] filePath - the file path; the output format is defined by the file extension + * @param[in] columnOrder - defines how the array is stored in the linear memory. + * It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for row-major order (e.g. in C). + */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder); +int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_av_save __itt_av_saveW +# define __itt_av_save_ptr __itt_av_saveW_ptr +#else /* UNICODE */ +# define __itt_av_save __itt_av_saveA +# define __itt_av_save_ptr __itt_av_saveA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder)) +ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_av_saveA ITTNOTIFY_DATA(av_saveA) +#define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA) +#define __itt_av_saveW ITTNOTIFY_DATA(av_saveW) +#define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_av_save ITTNOTIFY_DATA(av_save) +#define __itt_av_save_ptr ITTNOTIFY_NAME(av_save) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_av_saveA(name) +#define __itt_av_saveA_ptr 0 +#define __itt_av_saveW(name) +#define __itt_av_saveW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_av_save(name) +#define __itt_av_save_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_av_saveA_ptr 0 +#define __itt_av_saveW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_av_save_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +void ITTAPI __itt_enable_attach(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, enable_attach, (void)) +#define __itt_enable_attach ITTNOTIFY_VOID(enable_attach) +#define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_enable_attach() +#define __itt_enable_attach_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_enable_attach_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @cond exclude_from_gpa_documentation */ + +/** @} arrays group */ + +/** @endcond */ + +/** + * @brief Module load notification + * This API is used to report necessary information in case of bypassing default system loader. + * Notification should be done immidiatelly after this module is loaded to process memory. + * @param[in] start_addr - module start address + * @param[in] end_addr - module end address + * @param[in] path - file system full path to the module + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path); +void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr, const wchar_t *path); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_module_load __itt_module_loadW +# define __itt_module_load_ptr __itt_module_loadW_ptr +#else /* UNICODE */ +# define __itt_module_load __itt_module_loadA +# define __itt_module_load_ptr __itt_module_loadA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_module_load(void *start_addr, void *end_addr, const char *path); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, void, module_loadA, (void *start_addr, void *end_addr, const char *path)) +ITT_STUB(ITTAPI, void, module_loadW, (void *start_addr, void *end_addr, const wchar_t *path)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_module_loadA ITTNOTIFY_VOID(module_loadA) +#define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA) +#define __itt_module_loadW ITTNOTIFY_VOID(module_loadW) +#define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_module_load ITTNOTIFY_VOID(module_load) +#define __itt_module_load_ptr ITTNOTIFY_NAME(module_load) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_module_loadA(start_addr, end_addr, path) +#define __itt_module_loadA_ptr 0 +#define __itt_module_loadW(start_addr, end_addr, path) +#define __itt_module_loadW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_module_load(start_addr, end_addr, path) +#define __itt_module_load_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_module_loadA_ptr 0 +#define __itt_module_loadW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_module_load_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Report module unload + * This API is used to report necessary information in case of bypassing default system loader. + * Notification should be done just before the module is unloaded from process memory. + * @param[in] addr - base address of loaded module + */ +void ITTAPI __itt_module_unload(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, module_unload, (void *addr)) +#define __itt_module_unload ITTNOTIFY_VOID(module_unload) +#define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_module_unload(addr) +#define __itt_module_unload_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_module_unload_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @cond exclude_from_documentation */ +typedef enum +{ + __itt_module_type_unknown = 0, + __itt_module_type_elf, + __itt_module_type_coff +} __itt_module_type; +/** @endcond */ + +/** @cond exclude_from_documentation */ +typedef enum +{ + itt_section_type_unknown, + itt_section_type_bss, /* notifies that the section contains uninitialized data. These are the relevant section types and the modules that contain them: + * ELF module: SHT_NOBITS section type + * COFF module: IMAGE_SCN_CNT_UNINITIALIZED_DATA section type + */ + itt_section_type_data, /* notifies that section contains initialized data. These are the relevant section types and the modules that contain them: + * ELF module: SHT_PROGBITS section type + * COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA section type + */ + itt_section_type_text /* notifies that the section contains executable code. These are the relevant section types and the modules that contain them: + * ELF module: SHT_PROGBITS section type + * COFF module: IMAGE_SCN_CNT_CODE section type + */ +} __itt_section_type; +/** @endcond */ + +/** + * @hideinitializer + * @brief bit-mask, detects a section attribute that indicates whether a section can be executed as code: + * These are the relevant section attributes and the modules that contain them: + * ELF module: PF_X section attribute + * COFF module: IMAGE_SCN_MEM_EXECUTE attribute + */ +#define __itt_section_exec 0x20000000 + +/** + * @hideinitializer + * @brief bit-mask, detects a section attribute that indicates whether a section can be read. + * These are the relevant section attributes and the modules that contain them: + * ELF module: PF_R attribute + * COFF module: IMAGE_SCN_MEM_READ attribute + */ +#define __itt_section_read 0x40000000 + +/** + * @hideinitializer + * @brief bit-mask, detects a section attribute that indicates whether a section can be written to. + * These are the relevant section attributes and the modules that contain them: + * ELF module: PF_W attribute + * COFF module: IMAGE_SCN_MEM_WRITE attribute + */ +#define __itt_section_write 0x80000000 + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_section_info +{ + const char* name; /*!< Section name in UTF8 */ + __itt_section_type type; /*!< Section content and semantics description */ + size_t flags; /*!< Section bit flags that describe attributes using bit mask + * Zero if disabled, non-zero if enabled + */ + void* start_addr; /*!< Section load(relocated) start address */ + size_t size; /*!< Section file offset */ + size_t file_offset; /*!< Section size */ +} __itt_section_info; + +#pragma pack(pop) +/** @endcond */ + +/** @cond exclude_from_documentation */ +#pragma pack(push, 8) + +typedef struct ___itt_module_object +{ + unsigned int version; /*!< API version*/ + __itt_id module_id; /*!< Unique identifier. This is unchanged for sections that belong to the same module */ + __itt_module_type module_type; /*!< Binary module format */ + const char* module_name; /*!< Unique module name or path to module in UTF8 + * Contains module name when module_bufer and module_size exist + * Contains module path when module_bufer and module_size absent + * module_name remains the same for the certain module_id + */ + void* module_buffer; /*!< Module buffer content */ + size_t module_size; /*!< Module buffer size */ + /*!< If module_buffer and module_size exist, the binary module is dumped onto the system. + * If module_buffer and module_size do not exist, + * the binary module exists on the system already. + * The module_name parameter contains the path to the module. + */ + __itt_section_info* section_array; /*!< Reference to section information */ + size_t section_number; +} __itt_module_object; + +#pragma pack(pop) +/** @endcond */ + +/** + * @brief Load module content and its loaded(relocated) sections. + * This API is useful to save a module, or specify its location on the system and report information about loaded sections. + * The target module is saved on the system if module buffer content and size are available. + * If module buffer content and size are unavailable, the module name contains the path to the existing binary module. + * @param[in] module_obj - provides module and section information, along with unique module identifiers (name,module ID) + * which bind the binary module to particular sections. + */ +void ITTAPI __itt_module_load_with_sections(__itt_module_object* module_obj); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj)) +#define __itt_module_load_with_sections ITTNOTIFY_VOID(module_load_with_sections) +#define __itt_module_load_with_sections_ptr ITTNOTIFY_NAME(module_load_with_sections) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_module_load_with_sections(module_obj) +#define __itt_module_load_with_sections_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_module_load_with_sections_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Unload a module and its loaded(relocated) sections. + * This API notifies that the module and its sections were unloaded. + * @param[in] module_obj - provides module and sections information, along with unique module identifiers (name,module ID) + * which bind the binary module to particular sections. + */ +void ITTAPI __itt_module_unload_with_sections(__itt_module_object* module_obj); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj)) +#define __itt_module_unload_with_sections ITTNOTIFY_VOID(module_unload_with_sections) +#define __itt_module_unload_with_sections_ptr ITTNOTIFY_NAME(module_unload_with_sections) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_module_unload_with_sections(module_obj) +#define __itt_module_unload_with_sections_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_module_unload_with_sections_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _ITTNOTIFY_H_ */ + +#ifdef INTEL_ITTNOTIFY_API_PRIVATE + +#ifndef _ITTNOTIFY_PRIVATE_ +#define _ITTNOTIFY_PRIVATE_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @ingroup clockdomain + * @brief Begin an overlapped task instance. + * @param[in] domain The domain for this task + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null. + * @param[in] parentid The parent of this task, or __itt_null. + * @param[in] name The name of this task. + */ +void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name); + +/** + * @ingroup clockdomain + * @brief End an overlapped task instance. + * @param[in] domain The domain for this task + * @param[in] clock_domain The clock domain controlling the execution of this call. + * @param[in] timestamp The user defined timestamp. + * @param[in] taskid Explicit ID of finished task + */ +void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex, (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name)) +ITT_STUBV(ITTAPI, void, task_end_overlapped_ex, (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid)) +#define __itt_task_begin_overlapped_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_overlapped_ex,d,x,y,z,a,b) +#define __itt_task_begin_overlapped_ex_ptr ITTNOTIFY_NAME(task_begin_overlapped_ex) +#define __itt_task_end_overlapped_ex(d,x,y,z) ITTNOTIFY_VOID_D3(task_end_overlapped_ex,d,x,y,z) +#define __itt_task_end_overlapped_ex_ptr ITTNOTIFY_NAME(task_end_overlapped_ex) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_task_begin_overlapped_ex(domain,clock_domain,timestamp,taskid,parentid,name) +#define __itt_task_begin_overlapped_ex_ptr 0 +#define __itt_task_end_overlapped_ex(domain,clock_domain,timestamp,taskid) +#define __itt_task_end_overlapped_ex_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_task_begin_overlapped_ex_ptr 0 +#define __itt_task_end_overlapped_ptr 0 +#define __itt_task_end_overlapped_ex_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @defgroup makrs_internal Marks + * @ingroup internal + * Marks group + * @warning Internal API: + * - It is not shipped to outside of Intel + * - It is delivered to internal Intel teams using e-mail or SVN access only + * @{ + */ +/** @brief user mark type */ +typedef int __itt_mark_type; + +/** + * @brief Creates a user mark type with the specified name using char or Unicode string. + * @param[in] name - name of mark to create + * @return Returns a handle to the mark type + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_mark_type ITTAPI __itt_mark_createA(const char *name); +__itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_mark_create __itt_mark_createW +# define __itt_mark_create_ptr __itt_mark_createW_ptr +#else /* UNICODE */ +# define __itt_mark_create __itt_mark_createA +# define __itt_mark_create_ptr __itt_mark_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_mark_type ITTAPI __itt_mark_create(const char *name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name)) +ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_createA ITTNOTIFY_DATA(mark_createA) +#define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA) +#define __itt_mark_createW ITTNOTIFY_DATA(mark_createW) +#define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_create ITTNOTIFY_DATA(mark_create) +#define __itt_mark_create_ptr ITTNOTIFY_NAME(mark_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_createA(name) (__itt_mark_type)0 +#define __itt_mark_createA_ptr 0 +#define __itt_mark_createW(name) (__itt_mark_type)0 +#define __itt_mark_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_create(name) (__itt_mark_type)0 +#define __itt_mark_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_createA_ptr 0 +#define __itt_mark_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Creates a "discrete" user mark type of the specified type and an optional parameter using char or Unicode string. + * + * - The mark of "discrete" type is placed to collection results in case of success. It appears in overtime view(s) as a special tick sign. + * - The call is "synchronous" - function returns after mark is actually added to results. + * - This function is useful, for example, to mark different phases of application + * (beginning of the next mark automatically meand end of current region). + * - Can be used together with "continuous" marks (see below) at the same collection session + * @param[in] mt - mark, created by __itt_mark_create(const char* name) function + * @param[in] parameter - string parameter of mark + * @return Returns zero value in case of success, non-zero value otherwise. + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +int ITTAPI __itt_markA(__itt_mark_type mt, const char *parameter); +int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_mark __itt_markW +# define __itt_mark_ptr __itt_markW_ptr +#else /* UNICODE */ +# define __itt_mark __itt_markA +# define __itt_mark_ptr __itt_markA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter)) +ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_markA ITTNOTIFY_DATA(markA) +#define __itt_markA_ptr ITTNOTIFY_NAME(markA) +#define __itt_markW ITTNOTIFY_DATA(markW) +#define __itt_markW_ptr ITTNOTIFY_NAME(markW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark ITTNOTIFY_DATA(mark) +#define __itt_mark_ptr ITTNOTIFY_NAME(mark) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_markA(mt, parameter) (int)0 +#define __itt_markA_ptr 0 +#define __itt_markW(mt, parameter) (int)0 +#define __itt_markW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark(mt, parameter) (int)0 +#define __itt_mark_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_markA_ptr 0 +#define __itt_markW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Use this if necessary to create a "discrete" user event type (mark) for process + * rather then for one thread + * @see int __itt_mark(__itt_mark_type mt, const char* parameter); + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char *parameter); +int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_mark_global __itt_mark_globalW +# define __itt_mark_global_ptr __itt_mark_globalW_ptr +#else /* UNICODE */ +# define __itt_mark_global __itt_mark_globalA +# define __itt_mark_global_ptr __itt_mark_globalA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter)) +ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_globalA ITTNOTIFY_DATA(mark_globalA) +#define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA) +#define __itt_mark_globalW ITTNOTIFY_DATA(mark_globalW) +#define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_global ITTNOTIFY_DATA(mark_global) +#define __itt_mark_global_ptr ITTNOTIFY_NAME(mark_global) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_globalA(mt, parameter) (int)0 +#define __itt_mark_globalA_ptr 0 +#define __itt_mark_globalW(mt, parameter) (int)0 +#define __itt_mark_globalW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_global(mt, parameter) (int)0 +#define __itt_mark_global_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_mark_globalA_ptr 0 +#define __itt_mark_globalW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_mark_global_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Creates an "end" point for "continuous" mark with specified name. + * + * - Returns zero value in case of success, non-zero value otherwise. + * Also returns non-zero value when preceding "begin" point for the + * mark with the same name failed to be created or not created. + * - The mark of "continuous" type is placed to collection results in + * case of success. It appears in overtime view(s) as a special tick + * sign (different from "discrete" mark) together with line from + * corresponding "begin" mark to "end" mark. + * @note Continuous marks can overlap and be nested inside each other. + * Discrete mark can be nested inside marked region + * @param[in] mt - mark, created by __itt_mark_create(const char* name) function + * @return Returns zero value in case of success, non-zero value otherwise. + */ +int ITTAPI __itt_mark_off(__itt_mark_type mt); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt)) +#define __itt_mark_off ITTNOTIFY_DATA(mark_off) +#define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_mark_off(mt) (int)0 +#define __itt_mark_off_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_mark_off_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Use this if necessary to create an "end" point for mark of process + * @see int __itt_mark_off(__itt_mark_type mt); + */ +int ITTAPI __itt_mark_global_off(__itt_mark_type mt); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt)) +#define __itt_mark_global_off ITTNOTIFY_DATA(mark_global_off) +#define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_mark_global_off(mt) (int)0 +#define __itt_mark_global_off_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_mark_global_off_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} marks group */ + +/** + * @defgroup counters_internal Counters + * @ingroup internal + * Counters group + * @{ + */ + + +/** + * @defgroup stitch Stack Stitching + * @ingroup internal + * Stack Stitching group + * @{ + */ +/** + * @brief opaque structure for counter identification + */ +typedef struct ___itt_caller *__itt_caller; + +/** + * @brief Create the stitch point e.g. a point in call stack where other stacks should be stitched to. + * The function returns a unique identifier which is used to match the cut points with corresponding stitch points. + */ +__itt_caller ITTAPI __itt_stack_caller_create(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void)) +#define __itt_stack_caller_create ITTNOTIFY_DATA(stack_caller_create) +#define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_stack_caller_create() (__itt_caller)0 +#define __itt_stack_caller_create_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_stack_caller_create_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Destroy the information about stitch point identified by the pointer previously returned by __itt_stack_caller_create() + */ +void ITTAPI __itt_stack_caller_destroy(__itt_caller id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id)) +#define __itt_stack_caller_destroy ITTNOTIFY_VOID(stack_caller_destroy) +#define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_stack_caller_destroy(id) +#define __itt_stack_caller_destroy_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_stack_caller_destroy_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Sets the cut point. Stack from each event which occurs after this call will be cut + * at the same stack level the function was called and stitched to the corresponding stitch point. + */ +void ITTAPI __itt_stack_callee_enter(__itt_caller id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id)) +#define __itt_stack_callee_enter ITTNOTIFY_VOID(stack_callee_enter) +#define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_stack_callee_enter(id) +#define __itt_stack_callee_enter_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_stack_callee_enter_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief This function eliminates the cut point which was set by latest __itt_stack_callee_enter(). + */ +void ITTAPI __itt_stack_callee_leave(__itt_caller id); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id)) +#define __itt_stack_callee_leave ITTNOTIFY_VOID(stack_callee_leave) +#define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_stack_callee_leave(id) +#define __itt_stack_callee_leave_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_stack_callee_leave_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @} stitch group */ + +/* ***************************************************************************************************************************** */ + +#include + +/** @cond exclude_from_documentation */ +typedef enum __itt_error_code +{ + __itt_error_success = 0, /*!< no error */ + __itt_error_no_module = 1, /*!< module can't be loaded */ + /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system error message. */ + __itt_error_no_symbol = 2, /*!< symbol not found */ + /* %1$s -- library name, %2$s -- symbol name. */ + __itt_error_unknown_group = 3, /*!< unknown group specified */ + /* %1$s -- env var name, %2$s -- group name. */ + __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */ + /* %1$s -- env var name, %2$d -- system error. */ + __itt_error_env_too_long = 5, /*!< variable value too long */ + /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed length. */ + __itt_error_system = 6 /*!< pthread_mutexattr_init or pthread_mutex_init failed */ + /* %1$s -- function name, %2$d -- errno. */ +} __itt_error_code; + +typedef void (__itt_error_handler_t)(__itt_error_code code, va_list); +__itt_error_handler_t* __itt_set_error_handler(__itt_error_handler_t*); + +const char* ITTAPI __itt_api_version(void); +/** @endcond */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler) +void __itt_error_handler(__itt_error_code code, va_list args); +extern const int ITTNOTIFY_NAME(err); +#define __itt_err ITTNOTIFY_NAME(err) +ITT_STUB(ITTAPI, const char*, api_version, (void)) +#define __itt_api_version ITTNOTIFY_DATA(api_version) +#define __itt_api_version_ptr ITTNOTIFY_NAME(api_version) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_api_version() (const char*)0 +#define __itt_api_version_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_api_version_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _ITTNOTIFY_PRIVATE_ */ + +#endif /* INTEL_ITTNOTIFY_API_PRIVATE */ diff --git a/deps/v8/third_party/ittapi/include/jitprofiling.h b/deps/v8/third_party/ittapi/include/jitprofiling.h new file mode 100644 index 00000000000000..ffda0048d05a4e --- /dev/null +++ b/deps/v8/third_party/ittapi/include/jitprofiling.h @@ -0,0 +1,642 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#ifndef __JITPROFILING_H__ +#define __JITPROFILING_H__ + +/** + * @brief JIT Profiling APIs + * + * The JIT Profiling API is used to report information about just-in-time + * generated code that can be used by performance tools. The user inserts + * calls in the code generator to report information before JIT-compiled + * code goes to execution. This information is collected at runtime and used + * by tools like Intel(R) VTune(TM) Amplifier to display performance metrics + * associated with JIT-compiled code. + * + * These APIs can be used to\n + * - **Profile trace-based and method-based JIT-compiled + * code**. Some examples of environments that you can profile with these APIs: + * dynamic JIT compilation of JavaScript code traces, JIT execution in OpenCL(TM) + * software technology, Java/.NET managed execution environments, and custom + * ISV JIT engines. + * @code + * #include + * + * if (iJIT_IsProfilingActive != iJIT_SAMPLING_ON) { + * return; + * } + * + * iJIT_Method_Load jmethod = {0}; + * jmethod.method_id = iJIT_GetNewMethodID(); + * jmethod.method_name = "method_name"; + * jmethod.class_file_name = "class_name"; + * jmethod.source_file_name = "source_file_name"; + * jmethod.method_load_address = code_addr; + * jmethod.method_size = code_size; + * + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod); + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL); + * @endcode + * + * * Expected behavior: + * * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an + * already reported method, then such a method becomes invalid and its + * memory region is treated as unloaded. VTune Amplifier displays the metrics + * collected by the method until it is overwritten. + * * If supplied line number information contains multiple source lines for + * the same assembly instruction (code location), then VTune Amplifier picks up + * the first line number. + * * Dynamically generated code can be associated with a module name. + * Use the iJIT_Method_Load_V2 structure.\n + * Clarification of some cases: + * * If you register a function with the same method ID multiple times, + * specifying different module names, then the VTune Amplifier picks up + * the module name registered first. If you want to distinguish the same + * function between different JIT engines, supply different method IDs for + * each function. Other symbolic information (for example, source file) + * can be identical. + * + * - **Analyze split functions** (multiple joint or disjoint code regions + * belonging to the same function) **including re-JIT** + * with potential overlapping of code regions in time, which is common in + * resource-limited environments. + * @code + * #include + * + * unsigned int method_id = iJIT_GetNewMethodID(); + * + * iJIT_Method_Load a = {0}; + * a.method_id = method_id; + * a.method_load_address = 0x100; + * a.method_size = 0x20; + * + * iJIT_Method_Load b = {0}; + * b.method_id = method_id; + * b.method_load_address = 0x200; + * b.method_size = 0x30; + * + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a); + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&b); + * @endcode + * + * * Expected behaviour: + * * If a iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an + * already reported method, then such a method becomes invalid and + * its memory region is treated as unloaded. + * * All code regions reported with the same method ID are considered as + * belonging to the same method. Symbolic information (method name, + * source file name) will be taken from the first notification, and all + * subsequent notifications with the same method ID will be processed + * only for line number table information. So, the VTune Amplifier will map + * samples to a source line using the line number table from the current + * notification while taking the source file name from the very first one.\n + * Clarification of some cases:\n + * * If you register a second code region with a different source file + * name and the same method ID, then this information will be saved and + * will not be considered as an extension of the first code region, but + * VTune Amplifier will use the source file of the first code region and map + * performance metrics incorrectly. + * * If you register a second code region with the same source file as + * for the first region and the same method ID, then the source file will be + * discarded but VTune Amplifier will map metrics to the source file correctly. + * * If you register a second code region with a null source file and + * the same method ID, then provided line number info will be associated + * with the source file of the first code region. + * + * - **Explore inline functions** including multi-level hierarchy of + * nested inline methods which shows how performance metrics are distributed through them. + * @code + * #include + * + * // method_id parent_id + * // [-- c --] 3000 2000 + * // [---- d -----] 2001 1000 + * // [---- b ----] 2000 1000 + * // [------------ a ----------------] 1000 n/a + * + * iJIT_Method_Load a = {0}; + * a.method_id = 1000; + * + * iJIT_Method_Inline_Load b = {0}; + * b.method_id = 2000; + * b.parent_method_id = 1000; + * + * iJIT_Method_Inline_Load c = {0}; + * c.method_id = 3000; + * c.parent_method_id = 2000; + * + * iJIT_Method_Inline_Load d = {0}; + * d.method_id = 2001; + * d.parent_method_id = 1000; + * + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a); + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&b); + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&c); + * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&d); + * @endcode + * + * * Requirements: + * * Each inline (iJIT_Method_Inline_Load) method should be associated + * with two method IDs: one for itself; one for its immediate parent. + * * Address regions of inline methods of the same parent method cannot + * overlap each other. + * * Execution of the parent method must not be started until it and all + * its inline methods are reported. + * * Expected behaviour: + * * In case of nested inline methods an order of + * iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED events is not important. + * * If any event overwrites either inline method or top parent method, + * then the parent, including inline methods, becomes invalid and its memory + * region is treated as unloaded. + * + * **Life time of allocated data**\n + * The client sends an event notification to the agent with event-specific + * data, which is a structure. The pointers in the structure refer to memory + * allocated by the client, which responsible for releasing it. The pointers are + * used by the iJIT_NotifyEvent method to copy client's data in a trace file, + * and they are not used after the iJIT_NotifyEvent method returns. + */ + +/** + * @defgroup jitapi JIT Profiling + * @ingroup internal + * @{ + */ + +/** + * @brief Enumerator for the types of notifications + */ +typedef enum iJIT_jvm_event +{ + iJVM_EVENT_TYPE_SHUTDOWN = 2, /**<\brief Send this to shutdown the agent. + * Use NULL for event data. */ + + iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED = 13, /**<\brief Send when dynamic code is + * JIT compiled and loaded into + * memory by the JIT engine, but + * before the code is executed. + * Use iJIT_Method_Load as event + * data. */ +/** @cond exclude_from_documentation */ + iJVM_EVENT_TYPE_METHOD_UNLOAD_START, /**<\brief Send when compiled dynamic + * code is being unloaded from memory. + * Use iJIT_Method_Load as event data.*/ +/** @endcond */ + + iJVM_EVENT_TYPE_METHOD_UPDATE, /**<\brief Send to provide new content for + * a previously reported dynamic code. + * The previous content will be invalidated + * starting from the time of the notification. + * Use iJIT_Method_Load as event data but + * required fields are following: + * - method_id identify the code to update. + * - method_load_address specify start address + * within identified code range + * where update should be started. + * - method_size specify length of updated code + * range. */ + + + iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, /**<\brief Send when an inline dynamic + * code is JIT compiled and loaded + * into memory by the JIT engine, + * but before the parent code region + * starts executing. + * Use iJIT_Method_Inline_Load as event data.*/ + +/** @cond exclude_from_documentation */ + iJVM_EVENT_TYPE_METHOD_UPDATE_V2, +/** @endcond */ + + iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 = 21, /**<\brief Send when a dynamic code is + * JIT compiled and loaded into + * memory by the JIT engine, but + * before the code is executed. + * Use iJIT_Method_Load_V2 as event data. */ + + iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 /**<\brief Send when a dynamic code is + * JIT compiled and loaded into + * memory by the JIT engine, but + * before the code is executed. + * Use iJIT_Method_Load_V3 as event data. */ +} iJIT_JVM_EVENT; + +/** + * @brief Enumerator for the agent's mode + */ +typedef enum _iJIT_IsProfilingActiveFlags +{ + iJIT_NOTHING_RUNNING = 0x0000, /**<\brief The agent is not running; + * iJIT_NotifyEvent calls will + * not be processed. */ + iJIT_SAMPLING_ON = 0x0001, /**<\brief The agent is running and + * ready to process notifications. */ +} iJIT_IsProfilingActiveFlags; + +/** + * @brief Description of a single entry in the line number information of a code region. + * @details A table of line number entries gives information about how the reported code region + * is mapped to source file. + * Intel(R) VTune(TM) Amplifier uses line number information to attribute + * the samples (virtual address) to a line number. \n + * It is acceptable to report different code addresses for the same source line: + * @code + * Offset LineNumber + * 1 2 + * 12 4 + * 15 2 + * 18 1 + * 21 30 + * + * VTune Amplifier constructs the following table using the client data + * + * Code subrange Line number + * 0-1 2 + * 1-12 4 + * 12-15 2 + * 15-18 1 + * 18-21 30 + * @endcode + */ +typedef struct _LineNumberInfo +{ + unsigned int Offset; /**<\brief Offset from the begining of the code region. */ + unsigned int LineNumber; /**<\brief Matching source line number offset (from beginning of source file). */ + +} *pLineNumberInfo, LineNumberInfo; + +/** + * @brief Enumerator for the code architecture. + */ +typedef enum _iJIT_CodeArchitecture +{ + iJIT_CA_NATIVE = 0, /**<\brief Native to the process architecture that is calling it. */ + + iJIT_CA_32, /**<\brief 32-bit machine code. */ + + iJIT_CA_64 /**<\brief 64-bit machine code. */ + +} iJIT_CodeArchitecture; + +#pragma pack(push, 8) + +/** + * @brief Description of a JIT-compiled method + * @details When you use the iJIT_Method_Load structure to describe + * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED + * as an event type to report it. + */ +typedef struct _iJIT_Method_Load +{ + unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. + * You must either use the API function + * iJIT_GetNewMethodID to get a valid and unique + * method ID, or else manage ID uniqueness + * and correct range by yourself.\n + * You must use the same method ID for all code + * regions of the same method, otherwise different + * method IDs specify different methods. */ + + char* method_name; /**<\brief The name of the method. It can be optionally + * prefixed with its class name and appended with + * its complete signature. Can't be NULL. */ + + void* method_load_address; /**<\brief The start virtual address of the method code + * region. If NULL, data provided with + * event are not accepted. */ + + unsigned int method_size; /**<\brief The code size of the method in memory. + * If 0, then data provided with the event are not + * accepted. */ + + unsigned int line_number_size; /**<\brief The number of entries in the line number + * table.0 if none. */ + + pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info + * array. Can be NULL if + * line_number_size is 0. See + * LineNumberInfo Structure for a + * description of a single entry in + * the line number info array */ + + unsigned int class_id; /**<\brief This field is obsolete. */ + + char* class_file_name; /**<\brief Class name. Can be NULL.*/ + + char* source_file_name; /**<\brief Source file name. Can be NULL.*/ + +} *piJIT_Method_Load, iJIT_Method_Load; + +/** + * @brief Description of a JIT-compiled method + * @details When you use the iJIT_Method_Load_V2 structure to describe + * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 + * as an event type to report it. + */ +typedef struct _iJIT_Method_Load_V2 +{ + unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. + * You must either use the API function + * iJIT_GetNewMethodID to get a valid and unique + * method ID, or else manage ID uniqueness + * and correct range by yourself.\n + * You must use the same method ID for all code + * regions of the same method, otherwise different + * method IDs specify different methods. */ + + char* method_name; /**<\brief The name of the method. It can be optionally + * prefixed with its class name and appended with + * its complete signature. Can't be NULL. */ + + void* method_load_address; /**<\brief The start virtual address of the method code + * region. If NULL, then data provided with the + * event are not accepted. */ + + unsigned int method_size; /**<\brief The code size of the method in memory. + * If 0, then data provided with the event are not + * accepted. */ + + unsigned int line_number_size; /**<\brief The number of entries in the line number + * table. 0 if none. */ + + pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info + * array. Can be NULL if + * line_number_size is 0. See + * LineNumberInfo Structure for a + * description of a single entry in + * the line number info array. */ + + char* class_file_name; /**<\brief Class name. Can be NULL. */ + + char* source_file_name; /**<\brief Source file name. Can be NULL. */ + + char* module_name; /**<\brief Module name. Can be NULL. + The module name can be useful for distinguishing among + different JIT engines. VTune Amplifier will display + reported methods grouped by specific module. */ + +} *piJIT_Method_Load_V2, iJIT_Method_Load_V2; + +/** + * @brief Description of a JIT-compiled method + * @details The iJIT_Method_Load_V3 structure is the same as iJIT_Method_Load_V2 + * with a newly introduced 'arch' field that specifies architecture of the code region. + * When you use the iJIT_Method_Load_V3 structure to describe + * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 + * as an event type to report it. + */ +typedef struct _iJIT_Method_Load_V3 +{ + unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. + * You must either use the API function + * iJIT_GetNewMethodID to get a valid and unique + * method ID, or manage ID uniqueness + * and correct range by yourself.\n + * You must use the same method ID for all code + * regions of the same method, otherwise they are + * treated as regions of different methods. */ + + char* method_name; /**<\brief The name of the method. It can be optionally + * prefixed with its class name and appended with + * its complete signature. Cannot be NULL. */ + + void* method_load_address; /**<\brief The start virtual address of the method code + * region. If NULL, then data provided with the + * event are not accepted. */ + + unsigned int method_size; /**<\brief The code size of the method in memory. + * If 0, then data provided with the event are not + * accepted. */ + + unsigned int line_number_size; /**<\brief The number of entries in the line number + * table. 0 if none. */ + + pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info + * array. Can be NULL if + * line_number_size is 0. See + * LineNumberInfo Structure for a + * description of a single entry in + * the line number info array. */ + + char* class_file_name; /**<\brief Class name. Can be NULL. */ + + char* source_file_name; /**<\brief Source file name. Can be NULL. */ + + char* module_name; /**<\brief Module name. Can be NULL. + * The module name can be useful for distinguishing among + * different JIT engines. VTune Amplifier will display + * reported methods grouped by specific module. */ + + iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region. + * By default, it is the same as the process + * architecture that is calling it. + * For example, you can use it if your 32-bit JIT + * engine generates 64-bit code. + * + * If JIT engine reports both 32-bit and 64-bit types + * of methods then VTune Amplifier splits the methods + * with the same module name but with different + * architectures in two different modules. VTune Amplifier + * modifies the original name provided with a 64-bit method + * version by ending it with '(64)' */ + +} *piJIT_Method_Load_V3, iJIT_Method_Load_V3; + +/** + * @brief Description of an inline JIT-compiled method + * @details When you use the_iJIT_Method_Inline_Load structure to describe + * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED + * as an event type to report it. + */ +typedef struct _iJIT_Method_Inline_Load +{ + unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. + * You must either use the API function + * iJIT_GetNewMethodID to get a valid and unique + * method ID, or else manage ID uniqueness + * and correct range by yourself. */ + + unsigned int parent_method_id; /**<\brief Unique immediate parent's method ID. + * Cannot be 0. + * You must either use the API function + * iJIT_GetNewMethodID to get a valid and unique + * method ID, or else manage ID uniqueness + * and correct range by yourself. */ + + char* method_name; /**<\brief The name of the method. It can be optionally + * prefixed with its class name and appended with + * its complete signature. Can't be NULL. */ + + void* method_load_address; /** <\brief The virtual address on which the method + * is inlined. If NULL, then data provided with + * the event are not accepted. */ + + unsigned int method_size; /**<\brief The code size of the method in memory. + * If 0, then data provided with the event are not + * accepted. */ + + unsigned int line_number_size; /**<\brief The number of entries in the line number + * table. 0 if none. */ + + pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info + * array. Can be NULL if + * line_number_size is 0. See + * LineNumberInfo Structure for a + * description of a single entry in + * the line number info array */ + + char* class_file_name; /**<\brief Class name. Can be NULL.*/ + + char* source_file_name; /**<\brief Source file name. Can be NULL.*/ + +} *piJIT_Method_Inline_Load, iJIT_Method_Inline_Load; + +/** @cond exclude_from_documentation */ +/** + * @brief Description of a segment type + * @details Use the segment type to specify a type of data supplied + * with the iJVM_EVENT_TYPE_METHOD_UPDATE_V2 event to be applied to + * a certain code trace. + */ +typedef enum _iJIT_SegmentType +{ + iJIT_CT_UNKNOWN = 0, + + iJIT_CT_CODE, /**<\brief Executable code. */ + + iJIT_CT_DATA, /**<\brief Data (not executable code). + * VTune Amplifier uses the format string + * (see iJIT_Method_Update) to represent + * this data in the VTune Amplifier GUI */ + + iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace. + * Can be used for the following + * iJVM_EVENT_TYPE_METHOD_UPDATE_V2 events, + * if the type of the previously reported segment + * type is the same. */ + iJIT_CT_EOF +} iJIT_SegmentType; + +/** + * @brief Description of a dynamic update of the content within JIT-compiled method + * @details The JIT engine may generate the methods that are updated at runtime + * partially by mixed (data + executable code) content. When you use the iJIT_Method_Update + * structure to describe the update of the content within a JIT-compiled method, + * use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it. + * + * On the first Update event, VTune Amplifier copies the original code range reported by + * the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and + * adds the modified range to the original method. For next update events, VTune Amplifier + * does the same but it uses the latest modified version of a code region for update. + * Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by + * the iJVM_EVENT_TYPE_METHOD_LOAD event. + * Notes: + * - Multiple update events with different types for the same trace are allowed + * but they must be reported for the same code ranges. + * Example, + * @code + * [-- data---] Allowed + * [-- code --] Allowed + * [code] Ignored + * [-- data---] Allowed + * [-- code --] Allowed + * [------------ trace ---------] + * @endcode + * - The types of previously reported events can be changed but they must be reported + * for the same code ranges. + * Example, + * @code + * [-- data---] Allowed + * [-- code --] Allowed + * [-- data---] Allowed + * [-- code --] Allowed + * [------------ trace ---------] + * @endcode + */ + +typedef struct _iJIT_Method_Update +{ + void* load_address; /**<\brief Start address of the update within a method */ + + unsigned int size; /**<\brief The update size */ + + iJIT_SegmentType type; /**<\brief Type of the update */ + + const char* data_format; /**<\brief C string that contains a format string + * that follows the same specifications as format in printf. + * The format string is used for iJIT_CT_CODE only + * and cannot be NULL. + * Format can be changed on the fly. */ +} *piJIT_Method_Update, iJIT_Method_Update; + +/** @endcond */ + +#pragma pack(pop) + +/** @cond exclude_from_documentation */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef JITAPI_CDECL +# if defined WIN32 || defined _WIN32 +# define JITAPI_CDECL __cdecl +# else /* defined WIN32 || defined _WIN32 */ +# if defined _M_IX86 || defined __i386__ +# define JITAPI_CDECL __attribute__ ((cdecl)) +# else /* _M_IX86 || __i386__ */ +# define JITAPI_CDECL /* actual only on x86_64 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* defined WIN32 || defined _WIN32 */ +#endif /* JITAPI_CDECL */ + +#define JITAPI JITAPI_CDECL +/** @endcond */ + +/** + * @brief Generates a new unique method ID. + * + * You must use this API to obtain unique and valid method IDs for methods or + * traces reported to the agent if you don't have your own mechanism to generate + * unique method IDs. + * + * @return a new unique method ID. When out of unique method IDs, this API + * returns 0, which is not an accepted value. + */ +unsigned int JITAPI iJIT_GetNewMethodID(void); + +/** + * @brief Returns the current mode of the agent. + * + * @return iJIT_SAMPLING_ON, indicating that agent is running, or + * iJIT_NOTHING_RUNNING if no agent is running. + */ +iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void); + +/** + * @brief Reports infomation about JIT-compiled code to the agent. + * + * The reported information is used to attribute samples obtained from any + * Intel(R) VTune(TM) Amplifier collector. This API needs to be called + * after JIT compilation and before the first entry into the JIT-compiled + * code. + * + * @param[in] event_type - type of the data sent to the agent + * @param[in] EventSpecificData - pointer to event-specific data + * + * @returns 1 on success, otherwise 0. + */ +int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +/** @endcond */ + +/** @} jitapi group */ + +#endif /* __JITPROFILING_H__ */ diff --git a/deps/v8/third_party/ittapi/include/legacy/ittnotify.h b/deps/v8/third_party/ittapi/include/legacy/ittnotify.h new file mode 100644 index 00000000000000..75ee4e4edcf8be --- /dev/null +++ b/deps/v8/third_party/ittapi/include/legacy/ittnotify.h @@ -0,0 +1,992 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ +#ifndef _LEGACY_ITTNOTIFY_H_ +#define _LEGACY_ITTNOTIFY_H_ + +/** + * @file + * @brief Legacy User API functions and types + */ + +/** @cond exclude_from_documentation */ +#ifndef ITT_OS_WIN +# define ITT_OS_WIN 1 +#endif /* ITT_OS_WIN */ + +#ifndef ITT_OS_LINUX +# define ITT_OS_LINUX 2 +#endif /* ITT_OS_LINUX */ + +#ifndef ITT_OS_MAC +# define ITT_OS_MAC 3 +#endif /* ITT_OS_MAC */ + +#ifndef ITT_OS_FREEBSD +# define ITT_OS_FREEBSD 4 +#endif /* ITT_OS_FREEBSD */ + +#ifndef ITT_OS +# if defined WIN32 || defined _WIN32 +# define ITT_OS ITT_OS_WIN +# elif defined( __APPLE__ ) && defined( __MACH__ ) +# define ITT_OS ITT_OS_MAC +# elif defined( __FreeBSD__ ) +# define ITT_OS ITT_OS_FREEBSD +# else +# define ITT_OS ITT_OS_LINUX +# endif +#endif /* ITT_OS */ + +#ifndef ITT_PLATFORM_WIN +# define ITT_PLATFORM_WIN 1 +#endif /* ITT_PLATFORM_WIN */ + +#ifndef ITT_PLATFORM_POSIX +# define ITT_PLATFORM_POSIX 2 +#endif /* ITT_PLATFORM_POSIX */ + +#ifndef ITT_PLATFORM_MAC +# define ITT_PLATFORM_MAC 3 +#endif /* ITT_PLATFORM_MAC */ + +#ifndef ITT_PLATFORM_FREEBSD +# define ITT_PLATFORM_FREEBSD 4 +#endif /* ITT_PLATFORM_FREEBSD */ + +#ifndef ITT_PLATFORM +# if ITT_OS==ITT_OS_WIN +# define ITT_PLATFORM ITT_PLATFORM_WIN +# elif ITT_OS==ITT_OS_MAC +# define ITT_PLATFORM ITT_PLATFORM_MAC +# elif ITT_OS==ITT_OS_FREEBSD +# define ITT_PLATFORM ITT_PLATFORM_FREEBSD +# else +# define ITT_PLATFORM ITT_PLATFORM_POSIX +# endif +#endif /* ITT_PLATFORM */ + +#if defined(_UNICODE) && !defined(UNICODE) +#define UNICODE +#endif + +#include +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#include +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#include +#if defined(UNICODE) || defined(_UNICODE) +#include +#endif /* UNICODE || _UNICODE */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#ifndef ITTAPI_CDECL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define ITTAPI_CDECL __cdecl +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define ITTAPI_CDECL __attribute__ ((cdecl)) +# else /* _M_IX86 || __i386__ */ +# define ITTAPI_CDECL /* actual only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* ITTAPI_CDECL */ + +#ifndef STDCALL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define STDCALL __stdcall +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define STDCALL __attribute__ ((stdcall)) +# else /* _M_IX86 || __i386__ */ +# define STDCALL /* supported only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* STDCALL */ + +#define ITTAPI ITTAPI_CDECL +#define LIBITTAPI ITTAPI_CDECL + +/* TODO: Temporary for compatibility! */ +#define ITTAPI_CALL ITTAPI_CDECL +#define LIBITTAPI_CALL ITTAPI_CDECL + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +/* use __forceinline (VC++ specific) */ +#if defined(__MINGW32__) && !defined(__cplusplus) +#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#else +#define ITT_INLINE static __forceinline +#endif /* __MINGW32__ */ + +#define ITT_INLINE_ATTRIBUTE /* nothing */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/* + * Generally, functions are not inlined unless optimization is specified. + * For functions declared inline, this attribute inlines the function even + * if no optimization level was specified. + */ +#ifdef __STRICT_ANSI__ +#define ITT_INLINE static +#define ITT_INLINE_ATTRIBUTE __attribute__((unused)) +#else /* __STRICT_ANSI__ */ +#define ITT_INLINE static inline +#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) +#endif /* __STRICT_ANSI__ */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/** @endcond */ + +/** @cond exclude_from_documentation */ +/* Helper macro for joining tokens */ +#define ITT_JOIN_AUX(p,n) p##n +#define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n) + +#ifdef ITT_MAJOR +#undef ITT_MAJOR +#endif +#ifdef ITT_MINOR +#undef ITT_MINOR +#endif +#define ITT_MAJOR 3 +#define ITT_MINOR 0 + +/* Standard versioning of a token with major and minor version numbers */ +#define ITT_VERSIONIZE(x) \ + ITT_JOIN(x, \ + ITT_JOIN(_, \ + ITT_JOIN(ITT_MAJOR, \ + ITT_JOIN(_, ITT_MINOR)))) + +#ifndef INTEL_ITTNOTIFY_PREFIX +# define INTEL_ITTNOTIFY_PREFIX __itt_ +#endif /* INTEL_ITTNOTIFY_PREFIX */ +#ifndef INTEL_ITTNOTIFY_POSTFIX +# define INTEL_ITTNOTIFY_POSTFIX _ptr_ +#endif /* INTEL_ITTNOTIFY_POSTFIX */ + +#define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n) +#define ITTNOTIFY_NAME(n) ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX))) + +#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n) +#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n) + +#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d) +#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x) +#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y) +#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z) +#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) +#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) +#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) +#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d) +#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x) +#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y) +#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z) +#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) +#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) +#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) + +#ifdef ITT_STUB +#undef ITT_STUB +#endif +#ifdef ITT_STUBV +#undef ITT_STUBV +#endif +#define ITT_STUBV(api,type,name,args) \ + typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args; \ + extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name); +#define ITT_STUB ITT_STUBV +/** @endcond */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup legacy Legacy API + * @{ + * @} + */ + +/** + * @defgroup legacy_control Collection Control + * @ingroup legacy + * General behavior: application continues to run, but no profiling information is being collected + * + * Pausing occurs not only for the current thread but for all process as well as spawned processes + * - Intel(R) Parallel Inspector and Intel(R) Inspector XE: + * - Does not analyze or report errors that involve memory access. + * - Other errors are reported as usual. Pausing data collection in + * Intel(R) Parallel Inspector and Intel(R) Inspector XE + * only pauses tracing and analyzing memory access. + * It does not pause tracing or analyzing threading APIs. + * . + * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE: + * - Does continue to record when new threads are started. + * . + * - Other effects: + * - Possible reduction of runtime overhead. + * . + * @{ + */ +#ifndef _ITTNOTIFY_H_ +/** @brief Pause collection */ +void ITTAPI __itt_pause(void); +/** @brief Resume collection */ +void ITTAPI __itt_resume(void); +/** @brief Detach collection */ +void ITTAPI __itt_detach(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, pause, (void)) +ITT_STUBV(ITTAPI, void, resume, (void)) +ITT_STUBV(ITTAPI, void, detach, (void)) +#define __itt_pause ITTNOTIFY_VOID(pause) +#define __itt_pause_ptr ITTNOTIFY_NAME(pause) +#define __itt_resume ITTNOTIFY_VOID(resume) +#define __itt_resume_ptr ITTNOTIFY_NAME(resume) +#define __itt_detach ITTNOTIFY_VOID(detach) +#define __itt_detach_ptr ITTNOTIFY_NAME(detach) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_pause() +#define __itt_pause_ptr 0 +#define __itt_resume() +#define __itt_resume_ptr 0 +#define __itt_detach() +#define __itt_detach_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_pause_ptr 0 +#define __itt_resume_ptr 0 +#define __itt_detach_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +#endif /* _ITTNOTIFY_H_ */ +/** @} legacy_control group */ + +/** + * @defgroup legacy_threads Threads + * @ingroup legacy + * Threads group + * @warning Legacy API + * @{ + */ +/** + * @deprecated Legacy API + * @brief Set name to be associated with thread in analysis GUI. + * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched) + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +int LIBITTAPI __itt_thr_name_setA(const char *name, int namelen); +int LIBITTAPI __itt_thr_name_setW(const wchar_t *name, int namelen); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_thr_name_set __itt_thr_name_setW +# define __itt_thr_name_set_ptr __itt_thr_name_setW_ptr +#else +# define __itt_thr_name_set __itt_thr_name_setA +# define __itt_thr_name_set_ptr __itt_thr_name_setA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +int LIBITTAPI __itt_thr_name_set(const char *name, int namelen); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen)) +ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thr_name_setA ITTNOTIFY_DATA(thr_name_setA) +#define __itt_thr_name_setA_ptr ITTNOTIFY_NAME(thr_name_setA) +#define __itt_thr_name_setW ITTNOTIFY_DATA(thr_name_setW) +#define __itt_thr_name_setW_ptr ITTNOTIFY_NAME(thr_name_setW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thr_name_set ITTNOTIFY_DATA(thr_name_set) +#define __itt_thr_name_set_ptr ITTNOTIFY_NAME(thr_name_set) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thr_name_setA(name, namelen) +#define __itt_thr_name_setA_ptr 0 +#define __itt_thr_name_setW(name, namelen) +#define __itt_thr_name_setW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thr_name_set(name, namelen) +#define __itt_thr_name_set_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_thr_name_setA_ptr 0 +#define __itt_thr_name_setW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_thr_name_set_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Mark current thread as ignored from this point on, for the duration of its existence. + */ +void LIBITTAPI __itt_thr_ignore(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, thr_ignore, (void)) +#define __itt_thr_ignore ITTNOTIFY_VOID(thr_ignore) +#define __itt_thr_ignore_ptr ITTNOTIFY_NAME(thr_ignore) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_thr_ignore() +#define __itt_thr_ignore_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_thr_ignore_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} legacy_threads group */ + +/** + * @defgroup legacy_sync Synchronization + * @ingroup legacy + * Synchronization group + * @warning Legacy API + * @{ + */ +/** + * @hideinitializer + * @brief possible value of attribute argument for sync object type + */ +#define __itt_attr_barrier 1 + +/** + * @hideinitializer + * @brief possible value of attribute argument for sync object type + */ +#define __itt_attr_mutex 2 + +/** + * @deprecated Legacy API + * @brief Assign a name to a sync object using char or Unicode string + * @param[in] addr - pointer to the sync object. You should use a real pointer to your object + * to make sure that the values don't clash with other object addresses + * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will + * be assumed to be of generic "User Synchronization" type + * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned + * to the object -- you can use the __itt_sync_rename call later to assign + * the name + * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the + * exact semantics of how prepare/acquired/releasing calls work. + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +void ITTAPI __itt_sync_set_nameA(void *addr, const char *objtype, const char *objname, int attribute); +void ITTAPI __itt_sync_set_nameW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_sync_set_name __itt_sync_set_nameW +# define __itt_sync_set_name_ptr __itt_sync_set_nameW_ptr +#else /* UNICODE */ +# define __itt_sync_set_name __itt_sync_set_nameA +# define __itt_sync_set_name_ptr __itt_sync_set_nameA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +void ITTAPI __itt_sync_set_name(void *addr, const char* objtype, const char* objname, int attribute); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute)) +ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_set_nameA ITTNOTIFY_VOID(sync_set_nameA) +#define __itt_sync_set_nameA_ptr ITTNOTIFY_NAME(sync_set_nameA) +#define __itt_sync_set_nameW ITTNOTIFY_VOID(sync_set_nameW) +#define __itt_sync_set_nameW_ptr ITTNOTIFY_NAME(sync_set_nameW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_set_name ITTNOTIFY_VOID(sync_set_name) +#define __itt_sync_set_name_ptr ITTNOTIFY_NAME(sync_set_name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_set_nameA(addr, objtype, objname, attribute) +#define __itt_sync_set_nameA_ptr 0 +#define __itt_sync_set_nameW(addr, objtype, objname, attribute) +#define __itt_sync_set_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_set_name(addr, objtype, objname, attribute) +#define __itt_sync_set_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_sync_set_nameA_ptr 0 +#define __itt_sync_set_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_sync_set_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Assign a name and type to a sync object using char or Unicode string + * @param[in] addr - pointer to the sync object. You should use a real pointer to your object + * to make sure that the values don't clash with other object addresses + * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will + * be assumed to be of generic "User Synchronization" type + * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned + * to the object -- you can use the __itt_sync_rename call later to assign + * the name + * @param[in] typelen, namelen - a length of string for appropriate objtype and objname parameter + * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the + * exact semantics of how prepare/acquired/releasing calls work. + * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched) + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +int LIBITTAPI __itt_notify_sync_nameA(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute); +int LIBITTAPI __itt_notify_sync_nameW(void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_notify_sync_name __itt_notify_sync_nameW +#else +# define __itt_notify_sync_name __itt_notify_sync_nameA +#endif +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +int LIBITTAPI __itt_notify_sync_name(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute)) +ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_notify_sync_nameA ITTNOTIFY_DATA(notify_sync_nameA) +#define __itt_notify_sync_nameA_ptr ITTNOTIFY_NAME(notify_sync_nameA) +#define __itt_notify_sync_nameW ITTNOTIFY_DATA(notify_sync_nameW) +#define __itt_notify_sync_nameW_ptr ITTNOTIFY_NAME(notify_sync_nameW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_notify_sync_name ITTNOTIFY_DATA(notify_sync_name) +#define __itt_notify_sync_name_ptr ITTNOTIFY_NAME(notify_sync_name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_notify_sync_nameA(addr, objtype, typelen, objname, namelen, attribute) +#define __itt_notify_sync_nameA_ptr 0 +#define __itt_notify_sync_nameW(addr, objtype, typelen, objname, namelen, attribute) +#define __itt_notify_sync_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_notify_sync_name(addr, objtype, typelen, objname, namelen, attribute) +#define __itt_notify_sync_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_notify_sync_nameA_ptr 0 +#define __itt_notify_sync_nameW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_notify_sync_name_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Enter spin loop on user-defined sync object + */ +void LIBITTAPI __itt_notify_sync_prepare(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *addr)) +#define __itt_notify_sync_prepare ITTNOTIFY_VOID(notify_sync_prepare) +#define __itt_notify_sync_prepare_ptr ITTNOTIFY_NAME(notify_sync_prepare) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_notify_sync_prepare(addr) +#define __itt_notify_sync_prepare_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_notify_sync_prepare_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Quit spin loop without acquiring spin object + */ +void LIBITTAPI __itt_notify_sync_cancel(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *addr)) +#define __itt_notify_sync_cancel ITTNOTIFY_VOID(notify_sync_cancel) +#define __itt_notify_sync_cancel_ptr ITTNOTIFY_NAME(notify_sync_cancel) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_notify_sync_cancel(addr) +#define __itt_notify_sync_cancel_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_notify_sync_cancel_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Successful spin loop completion (sync object acquired) + */ +void LIBITTAPI __itt_notify_sync_acquired(void *addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *addr)) +#define __itt_notify_sync_acquired ITTNOTIFY_VOID(notify_sync_acquired) +#define __itt_notify_sync_acquired_ptr ITTNOTIFY_NAME(notify_sync_acquired) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_notify_sync_acquired(addr) +#define __itt_notify_sync_acquired_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_notify_sync_acquired_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Start sync object releasing code. Is called before the lock release call. + */ +void LIBITTAPI __itt_notify_sync_releasing(void* addr); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *addr)) +#define __itt_notify_sync_releasing ITTNOTIFY_VOID(notify_sync_releasing) +#define __itt_notify_sync_releasing_ptr ITTNOTIFY_NAME(notify_sync_releasing) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_notify_sync_releasing(addr) +#define __itt_notify_sync_releasing_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_notify_sync_releasing_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} legacy_sync group */ + +#ifndef _ITTNOTIFY_H_ +/** + * @defgroup legacy_events Events + * @ingroup legacy + * Events group + * @{ + */ + +/** @brief user event type */ +typedef int __itt_event; + +/** + * @brief Create an event notification + * @note name or namelen being null/name and namelen not matching, user event feature not enabled + * @return non-zero event identifier upon success and __itt_err otherwise + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen); +__itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_event_create __itt_event_createW +# define __itt_event_create_ptr __itt_event_createW_ptr +#else +# define __itt_event_create __itt_event_createA +# define __itt_event_create_ptr __itt_event_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_event LIBITTAPI __itt_event_create(const char *name, int namelen); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen)) +ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA ITTNOTIFY_DATA(event_createA) +#define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA) +#define __itt_event_createW ITTNOTIFY_DATA(event_createW) +#define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create ITTNOTIFY_DATA(event_create) +#define __itt_event_create_ptr ITTNOTIFY_NAME(event_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA(name, namelen) (__itt_event)0 +#define __itt_event_createA_ptr 0 +#define __itt_event_createW(name, namelen) (__itt_event)0 +#define __itt_event_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create(name, namelen) (__itt_event)0 +#define __itt_event_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_event_createA_ptr 0 +#define __itt_event_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_event_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an event occurrence. + * @return __itt_err upon failure (invalid event id/user event feature not enabled) + */ +int LIBITTAPI __itt_event_start(__itt_event event); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event)) +#define __itt_event_start ITTNOTIFY_DATA(event_start) +#define __itt_event_start_ptr ITTNOTIFY_NAME(event_start) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_event_start(event) (int)0 +#define __itt_event_start_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_event_start_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @brief Record an event end occurrence. + * @note It is optional if events do not have durations. + * @return __itt_err upon failure (invalid event id/user event feature not enabled) + */ +int LIBITTAPI __itt_event_end(__itt_event event); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event)) +#define __itt_event_end ITTNOTIFY_DATA(event_end) +#define __itt_event_end_ptr ITTNOTIFY_NAME(event_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_event_end(event) (int)0 +#define __itt_event_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_event_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} legacy_events group */ +#endif /* _ITTNOTIFY_H_ */ + +/** + * @defgroup legacy_memory Memory Accesses + * @ingroup legacy + */ + +/** + * @deprecated Legacy API + * @brief Inform the tool of memory accesses on reading + */ +void LIBITTAPI __itt_memory_read(void *addr, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size)) +#define __itt_memory_read ITTNOTIFY_VOID(memory_read) +#define __itt_memory_read_ptr ITTNOTIFY_NAME(memory_read) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_memory_read(addr, size) +#define __itt_memory_read_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_memory_read_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Inform the tool of memory accesses on writing + */ +void LIBITTAPI __itt_memory_write(void *addr, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size)) +#define __itt_memory_write ITTNOTIFY_VOID(memory_write) +#define __itt_memory_write_ptr ITTNOTIFY_NAME(memory_write) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_memory_write(addr, size) +#define __itt_memory_write_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_memory_write_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief Inform the tool of memory accesses on updating + */ +void LIBITTAPI __itt_memory_update(void *address, size_t size); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size)) +#define __itt_memory_update ITTNOTIFY_VOID(memory_update) +#define __itt_memory_update_ptr ITTNOTIFY_NAME(memory_update) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_memory_update(addr, size) +#define __itt_memory_update_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_memory_update_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} legacy_memory group */ + +/** + * @defgroup legacy_state Thread and Object States + * @ingroup legacy + */ + +/** @brief state type */ +typedef int __itt_state_t; + +/** @cond exclude_from_documentation */ +typedef enum __itt_obj_state { + __itt_obj_state_err = 0, + __itt_obj_state_clr = 1, + __itt_obj_state_set = 2, + __itt_obj_state_use = 3 +} __itt_obj_state_t; + +typedef enum __itt_thr_state { + __itt_thr_state_err = 0, + __itt_thr_state_clr = 1, + __itt_thr_state_set = 2 +} __itt_thr_state_t; + +typedef enum __itt_obj_prop { + __itt_obj_prop_watch = 1, + __itt_obj_prop_ignore = 2, + __itt_obj_prop_sharable = 3 +} __itt_obj_prop_t; + +typedef enum __itt_thr_prop { + __itt_thr_prop_quiet = 1 +} __itt_thr_prop_t; +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief managing thread and object states + */ +__itt_state_t LIBITTAPI __itt_state_get(void); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_state_t, state_get, (void)) +#define __itt_state_get ITTNOTIFY_DATA(state_get) +#define __itt_state_get_ptr ITTNOTIFY_NAME(state_get) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_state_get(void) (__itt_state_t)0 +#define __itt_state_get_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_state_get_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief managing thread and object states + */ +__itt_state_t LIBITTAPI __itt_state_set(__itt_state_t s); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_state_t, state_set, (__itt_state_t s)) +#define __itt_state_set ITTNOTIFY_DATA(state_set) +#define __itt_state_set_ptr ITTNOTIFY_NAME(state_set) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_state_set(s) (__itt_state_t)0 +#define __itt_state_set_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_state_set_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief managing thread and object modes + */ +__itt_thr_state_t LIBITTAPI __itt_thr_mode_set(__itt_thr_prop_t p, __itt_thr_state_t s); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s)) +#define __itt_thr_mode_set ITTNOTIFY_DATA(thr_mode_set) +#define __itt_thr_mode_set_ptr ITTNOTIFY_NAME(thr_mode_set) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_thr_mode_set(p, s) (__itt_thr_state_t)0 +#define __itt_thr_mode_set_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_thr_mode_set_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @deprecated Legacy API + * @brief managing thread and object modes + */ +__itt_obj_state_t LIBITTAPI __itt_obj_mode_set(__itt_obj_prop_t p, __itt_obj_state_t s); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUB(ITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s)) +#define __itt_obj_mode_set ITTNOTIFY_DATA(obj_mode_set) +#define __itt_obj_mode_set_ptr ITTNOTIFY_NAME(obj_mode_set) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_obj_mode_set(p, s) (__itt_obj_state_t)0 +#define __itt_obj_mode_set_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_obj_mode_set_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} legacy_state group */ + +/** + * @defgroup frames Frames + * @ingroup legacy + * Frames group + * @{ + */ +/** + * @brief opaque structure for frame identification + */ +typedef struct __itt_frame_t *__itt_frame; + +/** + * @brief Create a global frame with given domain + */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +__itt_frame ITTAPI __itt_frame_createA(const char *domain); +__itt_frame ITTAPI __itt_frame_createW(const wchar_t *domain); +#if defined(UNICODE) || defined(_UNICODE) +# define __itt_frame_create __itt_frame_createW +# define __itt_frame_create_ptr __itt_frame_createW_ptr +#else /* UNICODE */ +# define __itt_frame_create __itt_frame_createA +# define __itt_frame_create_ptr __itt_frame_createA_ptr +#endif /* UNICODE */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +__itt_frame ITTAPI __itt_frame_create(const char *domain); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain)) +ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain)) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain)) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_frame_createA ITTNOTIFY_DATA(frame_createA) +#define __itt_frame_createA_ptr ITTNOTIFY_NAME(frame_createA) +#define __itt_frame_createW ITTNOTIFY_DATA(frame_createW) +#define __itt_frame_createW_ptr ITTNOTIFY_NAME(frame_createW) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_frame_create ITTNOTIFY_DATA(frame_create) +#define __itt_frame_create_ptr ITTNOTIFY_NAME(frame_create) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#else /* INTEL_NO_ITTNOTIFY_API */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_frame_createA(domain) +#define __itt_frame_createA_ptr 0 +#define __itt_frame_createW(domain) +#define __itt_frame_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_frame_create(domain) +#define __itt_frame_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_frame_createA_ptr 0 +#define __itt_frame_createW_ptr 0 +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#define __itt_frame_create_ptr 0 +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** @brief Record a frame begin occurrence. */ +void ITTAPI __itt_frame_begin(__itt_frame frame); +/** @brief Record a frame end occurrence. */ +void ITTAPI __itt_frame_end (__itt_frame frame); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame)) +ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame)) +#define __itt_frame_begin ITTNOTIFY_VOID(frame_begin) +#define __itt_frame_begin_ptr ITTNOTIFY_NAME(frame_begin) +#define __itt_frame_end ITTNOTIFY_VOID(frame_end) +#define __itt_frame_end_ptr ITTNOTIFY_NAME(frame_end) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_frame_begin(frame) +#define __itt_frame_begin_ptr 0 +#define __itt_frame_end(frame) +#define __itt_frame_end_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_frame_begin_ptr 0 +#define __itt_frame_end_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ +/** @} frames group */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _LEGACY_ITTNOTIFY_H_ */ diff --git a/deps/v8/third_party/ittapi/include/libittnotify.h b/deps/v8/third_party/ittapi/include/libittnotify.h new file mode 100644 index 00000000000000..107949aa7668d3 --- /dev/null +++ b/deps/v8/third_party/ittapi/include/libittnotify.h @@ -0,0 +1,19 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#ifndef _LIBITTNOTIFY_H_ +#define _LIBITTNOTIFY_H_ + +#ifndef __ITT_INTERNAL_INCLUDE +# if defined WIN32 || defined _WIN32 +# pragma message("WARNING!!! Include file libittnotify.h is deprecated and should not be included anymore") +# else /* WIN32 */ +# warning "Include file libittnotify.h is deprecated and should not be included anymore" +# endif /* WIN32 */ +#endif /* __ITT_INTERNAL_INCLUDE */ +#include "legacy/ittnotify.h" + +#endif /* _LIBITTNOTIFY_H_ */ diff --git a/deps/v8/third_party/ittapi/ittapi-rs/.gitignore b/deps/v8/third_party/ittapi/ittapi-rs/.gitignore new file mode 100644 index 00000000000000..693699042b1a8c --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/.gitignore @@ -0,0 +1,3 @@ +/target +**/*.rs.bk +Cargo.lock diff --git a/deps/v8/third_party/ittapi/ittapi-rs/CMakeLists.txt b/deps/v8/third_party/ittapi/ittapi-rs/CMakeLists.txt new file mode 120000 index 00000000000000..de0cf227139ff6 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/CMakeLists.txt @@ -0,0 +1 @@ +../CMakeLists.txt \ No newline at end of file diff --git a/deps/v8/third_party/ittapi/ittapi-rs/Cargo.toml b/deps/v8/third_party/ittapi/ittapi-rs/Cargo.toml new file mode 100644 index 00000000000000..b85ab97b22135a --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "ittapi-rs" +version = "0.1.5" +authors = ["Johnnie Birch <45402135+jlb6740@users.noreply.github.com>"] +edition = "2018" +description = "Rust bindings for ittapi" +license-file = "LICENSES/" +documentation = "https://docs.rs/ittapi-rs" +homepage = "https://github.com/intel/ittapi/ittapi-rs" +repository = "https://github.com/intel/ittapi" + +[dependencies] + +[features] +force_32 = [] + +[build-dependencies] +cmake = "0.1.42" + +[dev-dependencies] +bindgen = "0.52.0" +diff = "0.1" diff --git a/deps/v8/third_party/ittapi/ittapi-rs/LICENSES b/deps/v8/third_party/ittapi/ittapi-rs/LICENSES new file mode 120000 index 00000000000000..a274e110699818 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/LICENSES @@ -0,0 +1 @@ +../LICENSES/ \ No newline at end of file diff --git a/deps/v8/third_party/ittapi/ittapi-rs/README.md b/deps/v8/third_party/ittapi/ittapi-rs/README.md new file mode 100644 index 00000000000000..69340620786847 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/README.md @@ -0,0 +1,14 @@ +# ittapi-rs +This package creates Rust bindings for ittapi. Ittapi is used for instrumentation and tracking and just-in-time profiling. + +Note the building of this package is currently only supported (tested) on a couple of Linux platforms (recent Ubuntu and Fedora builds) but support for other platforms is intended and contributions are welcomed. + +# Build the package +cargo build + +** Note This package uses bindgen which in turn requires recent versions of cmake and llvm to be installed. For Fedora, "yum install llvm-devel" was needed to bring in llvm-config. + +** Also note building this package requires rust nightly. + +# Publish the package to crates.io +cargo publish \ No newline at end of file diff --git a/deps/v8/third_party/ittapi/ittapi-rs/build.rs b/deps/v8/third_party/ittapi/ittapi-rs/build.rs new file mode 100644 index 00000000000000..549afe2ec108f2 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/build.rs @@ -0,0 +1,37 @@ +#![allow(unused)] +use cmake::Config; +use std::env; +use std::path::PathBuf; + +#[cfg(target_os = "windows")] +fn main() {} + +#[cfg(not(target_os = "windows"))] +fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); + let out_path = PathBuf::from(out_dir); + + #[cfg(not(feature = "force_32"))] + { + let _ittnotify_64 = Config::new("./") + .generator("Unix Makefiles") + .no_build_target(true) + .build(); + + println!("cargo:rustc-link-search={}/build/bin/", out_path.display()); + println!("cargo:rustc-link-lib=static=ittnotify"); + } + + #[cfg(feature = "force_32")] + #[cfg(not(any(target_os = "ios", target_os = "macos")))] + { + let _ittnotify_32 = Config::new("./") + .generator("Unix Makefiles") + .define("FORCE_32", "ON") + .no_build_target(true) + .build(); + + println!("cargo:rustc-link-search={}/build/bin/", out_path.display()); + println!("cargo:rustc-link-lib=static=ittnotify32"); + } +} diff --git a/deps/v8/third_party/ittapi/ittapi-rs/include b/deps/v8/third_party/ittapi/ittapi-rs/include new file mode 120000 index 00000000000000..3a1af68fd1cdb6 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/include @@ -0,0 +1 @@ +../include/ \ No newline at end of file diff --git a/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify b/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify new file mode 120000 index 00000000000000..4859c0fe8132b0 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify @@ -0,0 +1 @@ +../../src/ittnotify \ No newline at end of file diff --git a/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify_bindings.rs b/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify_bindings.rs new file mode 100644 index 00000000000000..a5b45f4b30e32e --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/src/ittnotify_bindings.rs @@ -0,0 +1,2987 @@ +/* automatically generated by rust-bindgen */ + +pub const ITT_OS_WIN: u32 = 1; +pub const ITT_OS_LINUX: u32 = 2; +pub const ITT_OS_MAC: u32 = 3; +pub const ITT_OS_FREEBSD: u32 = 4; +pub const ITT_OS: u32 = 2; +pub const ITT_PLATFORM_WIN: u32 = 1; +pub const ITT_PLATFORM_POSIX: u32 = 2; +pub const ITT_PLATFORM_MAC: u32 = 3; +pub const ITT_PLATFORM_FREEBSD: u32 = 4; +pub const ITT_PLATFORM: u32 = 2; +pub const _STDINT_H: u32 = 1; +pub const _FEATURES_H: u32 = 1; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const __USE_ISOC11: u32 = 1; +pub const __USE_ISOC99: u32 = 1; +pub const __USE_ISOC95: u32 = 1; +pub const __USE_POSIX_IMPLICITLY: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const __USE_POSIX: u32 = 1; +pub const __USE_POSIX2: u32 = 1; +pub const __USE_POSIX199309: u32 = 1; +pub const __USE_POSIX199506: u32 = 1; +pub const __USE_XOPEN2K: u32 = 1; +pub const __USE_XOPEN2K8: u32 = 1; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __USE_MISC: u32 = 1; +pub const __USE_ATFILE: u32 = 1; +pub const __USE_FORTIFY_LEVEL: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; +pub const _STDC_PREDEF_H: u32 = 1; +pub const __STDC_IEC_559__: u32 = 1; +pub const __STDC_IEC_559_COMPLEX__: u32 = 1; +pub const __STDC_ISO_10646__: u32 = 201706; +pub const __STDC_NO_THREADS__: u32 = 1; +pub const __GNU_LIBRARY__: u32 = 6; +pub const __GLIBC__: u32 = 2; +pub const __GLIBC_MINOR__: u32 = 27; +pub const _SYS_CDEFS_H: u32 = 1; +pub const __glibc_c99_flexarr_available: u32 = 1; +pub const __WORDSIZE: u32 = 64; +pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; +pub const __SYSCALL_WORDSIZE: u32 = 64; +pub const __HAVE_GENERIC_SELECTION: u32 = 1; +pub const __GLIBC_USE_LIB_EXT2: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; +pub const _BITS_TYPES_H: u32 = 1; +pub const _BITS_TYPESIZES_H: u32 = 1; +pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; +pub const __INO_T_MATCHES_INO64_T: u32 = 1; +pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; +pub const __FD_SETSIZE: u32 = 1024; +pub const _BITS_WCHAR_H: u32 = 1; +pub const _BITS_STDINT_INTN_H: u32 = 1; +pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i64 = -9223372036854775808; +pub const INT_FAST32_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u64 = 9223372036854775807; +pub const INT_FAST32_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: i32 = -1; +pub const UINT_FAST32_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 4294967295; +pub const ITT_MAJOR: u32 = 3; +pub const ITT_MINOR: u32 = 0; +pub const __itt_suppress_all_errors: u32 = 2147483647; +pub const __itt_suppress_threading_errors: u32 = 255; +pub const __itt_suppress_memory_errors: u32 = 65280; +pub const __itt_attr_barrier: u32 = 1; +pub const __itt_attr_mutex: u32 = 2; +pub const __itt_heap_leaks: u32 = 1; +pub const __itt_heap_growth: u32 = 2; +pub const __itt_section_exec: u32 = 536870912; +pub const __itt_section_read: u32 = 1073741824; +pub const __itt_section_write: u32 = 2147483648; +pub type wchar_t = ::std::os::raw::c_int; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, + pub __bindgen_padding_0: u64, + pub __clang_max_align_nonce2: u128, +} +#[test] +fn bindgen_test_layout_max_align_t() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(max_align_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 16usize, + concat!("Alignment of ", stringify!(max_align_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce2) + ) + ); +} +pub type __u_char = ::std::os::raw::c_uchar; +pub type __u_short = ::std::os::raw::c_ushort; +pub type __u_int = ::std::os::raw::c_uint; +pub type __u_long = ::std::os::raw::c_ulong; +pub type __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_long; +pub type __uint64_t = ::std::os::raw::c_ulong; +pub type __quad_t = ::std::os::raw::c_long; +pub type __u_quad_t = ::std::os::raw::c_ulong; +pub type __intmax_t = ::std::os::raw::c_long; +pub type __uintmax_t = ::std::os::raw::c_ulong; +pub type __dev_t = ::std::os::raw::c_ulong; +pub type __uid_t = ::std::os::raw::c_uint; +pub type __gid_t = ::std::os::raw::c_uint; +pub type __ino_t = ::std::os::raw::c_ulong; +pub type __ino64_t = ::std::os::raw::c_ulong; +pub type __mode_t = ::std::os::raw::c_uint; +pub type __nlink_t = ::std::os::raw::c_ulong; +pub type __off_t = ::std::os::raw::c_long; +pub type __off64_t = ::std::os::raw::c_long; +pub type __pid_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __fsid_t { + pub __val: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___fsid_t() { + assert_eq!( + ::std::mem::size_of::<__fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__fsid_t)) + ); + assert_eq!( + ::std::mem::align_of::<__fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__fsid_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__fsid_t), + "::", + stringify!(__val) + ) + ); +} +pub type __clock_t = ::std::os::raw::c_long; +pub type __rlim_t = ::std::os::raw::c_ulong; +pub type __rlim64_t = ::std::os::raw::c_ulong; +pub type __id_t = ::std::os::raw::c_uint; +pub type __time_t = ::std::os::raw::c_long; +pub type __useconds_t = ::std::os::raw::c_uint; +pub type __suseconds_t = ::std::os::raw::c_long; +pub type __daddr_t = ::std::os::raw::c_int; +pub type __key_t = ::std::os::raw::c_int; +pub type __clockid_t = ::std::os::raw::c_int; +pub type __timer_t = *mut ::std::os::raw::c_void; +pub type __blksize_t = ::std::os::raw::c_long; +pub type __blkcnt_t = ::std::os::raw::c_long; +pub type __blkcnt64_t = ::std::os::raw::c_long; +pub type __fsblkcnt_t = ::std::os::raw::c_ulong; +pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; +pub type __fsword_t = ::std::os::raw::c_long; +pub type __ssize_t = ::std::os::raw::c_long; +pub type __syscall_slong_t = ::std::os::raw::c_long; +pub type __syscall_ulong_t = ::std::os::raw::c_ulong; +pub type __loff_t = __off64_t; +pub type __caddr_t = *mut ::std::os::raw::c_char; +pub type __intptr_t = ::std::os::raw::c_long; +pub type __socklen_t = ::std::os::raw::c_uint; +pub type __sig_atomic_t = ::std::os::raw::c_int; +pub type int_least8_t = ::std::os::raw::c_schar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type int_least32_t = ::std::os::raw::c_int; +pub type int_least64_t = ::std::os::raw::c_long; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type uint_least64_t = ::std::os::raw::c_ulong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_long; +pub type int_fast32_t = ::std::os::raw::c_long; +pub type int_fast64_t = ::std::os::raw::c_long; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_ulong; +pub type uint_fast32_t = ::std::os::raw::c_ulong; +pub type uint_fast64_t = ::std::os::raw::c_ulong; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +extern "C" { + #[doc = " @defgroup control Collection Control"] + #[doc = " @ingroup public"] + #[doc = " General behavior: application continues to run, but no profiling information is being collected"] + #[doc = ""] + #[doc = " Pausing occurs not only for the current thread but for all process as well as spawned processes"] + #[doc = " - Intel(R) Parallel Inspector and Intel(R) Inspector XE:"] + #[doc = " - Does not analyze or report errors that involve memory access."] + #[doc = " - Other errors are reported as usual. Pausing data collection in"] + #[doc = " Intel(R) Parallel Inspector and Intel(R) Inspector XE"] + #[doc = " only pauses tracing and analyzing memory access."] + #[doc = " It does not pause tracing or analyzing threading APIs."] + #[doc = " ."] + #[doc = " - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:"] + #[doc = " - Does continue to record when new threads are started."] + #[doc = " ."] + #[doc = " - Other effects:"] + #[doc = " - Possible reduction of runtime overhead."] + #[doc = " ."] + #[doc = " @{"] + pub fn __itt_pause(); +} +extern "C" { + #[doc = " @brief Resume collection"] + pub fn __itt_resume(); +} +extern "C" { + #[doc = " @brief Detach collection"] + pub fn __itt_detach(); +} +pub type __itt_pause_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_pause_ptr__3_0: __itt_pause_ptr__3_0_t; +} +pub type __itt_resume_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_resume_ptr__3_0: __itt_resume_ptr__3_0_t; +} +pub type __itt_detach_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_detach_ptr__3_0: __itt_detach_ptr__3_0_t; +} +#[doc = " @defgroup Intel Processor Trace control"] +#[doc = " API from this group provides control over collection and analysis of Intel Processor Trace (Intel PT) data"] +#[doc = " Information about Intel Processor Trace technology can be found here (Volume 3 chapter 35):"] +#[doc = " https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf"] +#[doc = " Use this API to mark particular code regions for loading detailed performance statistics."] +#[doc = " This mode makes your analysis faster and more accurate."] +#[doc = " @{"] +pub type __itt_pt_region = ::std::os::raw::c_uchar; +extern "C" { + pub fn __itt_pt_region_create(name: *const ::std::os::raw::c_char) -> __itt_pt_region; +} +pub type __itt_pt_region_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> __itt_pt_region, +>; +extern "C" { + pub static mut __itt_pt_region_create_ptr__3_0: __itt_pt_region_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief function contains a special code pattern identified on the post-processing stage and"] + #[doc = " marks the beginning of a code region targeted for Intel PT analysis"] + #[doc = " @param[in] region - region id, 0 <= region < 8"] + pub fn __itt_mark_pt_region_begin(region: __itt_pt_region); +} +extern "C" { + #[doc = " @brief function contains a special code pattern identified on the post-processing stage and"] + #[doc = " marks the end of a code region targeted for Intel PT analysis"] + #[doc = " @param[in] region - region id, 0 <= region < 8"] + pub fn __itt_mark_pt_region_end(region: __itt_pt_region); +} +extern "C" { + pub fn __itt_thread_set_name(name: *const ::std::os::raw::c_char); +} +pub type __itt_thread_set_name_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_thread_set_name_ptr__3_0: __itt_thread_set_name_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Mark current thread as ignored from this point on, for the duration of its existence."] + pub fn __itt_thread_ignore(); +} +pub type __itt_thread_ignore_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_thread_ignore_ptr__3_0: __itt_thread_ignore_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Start suppressing errors identified in mask on this thread"] + pub fn __itt_suppress_push(mask: ::std::os::raw::c_uint); +} +pub type __itt_suppress_push_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_suppress_push_ptr__3_0: __itt_suppress_push_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Undo the effects of the matching call to __itt_suppress_push"] + pub fn __itt_suppress_pop(); +} +pub type __itt_suppress_pop_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_suppress_pop_ptr__3_0: __itt_suppress_pop_ptr__3_0_t; +} +pub const __itt_suppress_mode___itt_unsuppress_range: __itt_suppress_mode = 0; +pub const __itt_suppress_mode___itt_suppress_range: __itt_suppress_mode = 1; +#[doc = " @enum __itt_model_disable"] +#[doc = " @brief Enumerator for the disable methods"] +pub type __itt_suppress_mode = u32; +pub use self::__itt_suppress_mode as __itt_suppress_mode_t; +extern "C" { + #[doc = " @brief Mark a range of memory for error suppression or unsuppression for error types included in mask"] + pub fn __itt_suppress_mark_range( + mode: __itt_suppress_mode_t, + mask: ::std::os::raw::c_uint, + address: *mut ::std::os::raw::c_void, + size: usize, + ); +} +pub type __itt_suppress_mark_range_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + mode: __itt_suppress_mode_t, + mask: ::std::os::raw::c_uint, + address: *mut ::std::os::raw::c_void, + size: usize, + ), +>; +extern "C" { + pub static mut __itt_suppress_mark_range_ptr__3_0: __itt_suppress_mark_range_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Undo the effect of a matching call to __itt_suppress_mark_range. If not matching"] + #[doc = " call is found, nothing is changed."] + pub fn __itt_suppress_clear_range( + mode: __itt_suppress_mode_t, + mask: ::std::os::raw::c_uint, + address: *mut ::std::os::raw::c_void, + size: usize, + ); +} +pub type __itt_suppress_clear_range_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + mode: __itt_suppress_mode_t, + mask: ::std::os::raw::c_uint, + address: *mut ::std::os::raw::c_void, + size: usize, + ), +>; +extern "C" { + pub static mut __itt_suppress_clear_range_ptr__3_0: __itt_suppress_clear_range_ptr__3_0_t; +} +extern "C" { + pub fn __itt_sync_create( + addr: *mut ::std::os::raw::c_void, + objtype: *const ::std::os::raw::c_char, + objname: *const ::std::os::raw::c_char, + attribute: ::std::os::raw::c_int, + ); +} +pub type __itt_sync_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + addr: *mut ::std::os::raw::c_void, + objtype: *const ::std::os::raw::c_char, + objname: *const ::std::os::raw::c_char, + attribute: ::std::os::raw::c_int, + ), +>; +extern "C" { + pub static mut __itt_sync_create_ptr__3_0: __itt_sync_create_ptr__3_0_t; +} +extern "C" { + pub fn __itt_sync_rename( + addr: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + ); +} +pub type __itt_sync_rename_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(addr: *mut ::std::os::raw::c_void, name: *const ::std::os::raw::c_char), +>; +extern "C" { + pub static mut __itt_sync_rename_ptr__3_0: __itt_sync_rename_ptr__3_0_t; +} +extern "C" { + #[doc = "@brief Destroy a synchronization object."] + #[doc = "@param addr Handle for the synchronization object."] + pub fn __itt_sync_destroy(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_sync_destroy_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_sync_destroy_ptr__3_0: __itt_sync_destroy_ptr__3_0_t; +} +extern "C" { + #[doc = " @name group of functions is used for performance measurement tools"] + #[doc = " @brief Enter spin loop on user-defined sync object"] + pub fn __itt_sync_prepare(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_sync_prepare_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_sync_prepare_ptr__3_0: __itt_sync_prepare_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Quit spin loop without acquiring spin object"] + pub fn __itt_sync_cancel(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_sync_cancel_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_sync_cancel_ptr__3_0: __itt_sync_cancel_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Successful spin loop completion (sync object acquired)"] + pub fn __itt_sync_acquired(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_sync_acquired_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_sync_acquired_ptr__3_0: __itt_sync_acquired_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Start sync object releasing code. Is called before the lock release call."] + pub fn __itt_sync_releasing(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_sync_releasing_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_sync_releasing_ptr__3_0: __itt_sync_releasing_ptr__3_0_t; +} +extern "C" { + #[doc = " @name group of functions is used for correctness checking tools"] + #[doc = " @ingroup legacy"] + #[doc = " @deprecated Legacy API"] + #[doc = " @brief Fast synchronization which does no require spinning."] + #[doc = " - This special function is to be used by TBB and OpenMP libraries only when they know"] + #[doc = " there is no spin but they need to suppress TC warnings about shared variable modifications."] + #[doc = " - It only has corresponding pointers in static library and does not have corresponding function"] + #[doc = " in dynamic library."] + #[doc = " @see void __itt_sync_prepare(void* addr);"] + pub fn __itt_fsync_prepare(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_fsync_prepare_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_fsync_prepare_ptr__3_0: __itt_fsync_prepare_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup legacy"] + #[doc = " @deprecated Legacy API"] + #[doc = " @brief Fast synchronization which does no require spinning."] + #[doc = " - This special function is to be used by TBB and OpenMP libraries only when they know"] + #[doc = " there is no spin but they need to suppress TC warnings about shared variable modifications."] + #[doc = " - It only has corresponding pointers in static library and does not have corresponding function"] + #[doc = " in dynamic library."] + #[doc = " @see void __itt_sync_cancel(void *addr);"] + pub fn __itt_fsync_cancel(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_fsync_cancel_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_fsync_cancel_ptr__3_0: __itt_fsync_cancel_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup legacy"] + #[doc = " @deprecated Legacy API"] + #[doc = " @brief Fast synchronization which does no require spinning."] + #[doc = " - This special function is to be used by TBB and OpenMP libraries only when they know"] + #[doc = " there is no spin but they need to suppress TC warnings about shared variable modifications."] + #[doc = " - It only has corresponding pointers in static library and does not have corresponding function"] + #[doc = " in dynamic library."] + #[doc = " @see void __itt_sync_acquired(void *addr);"] + pub fn __itt_fsync_acquired(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_fsync_acquired_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_fsync_acquired_ptr__3_0: __itt_fsync_acquired_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup legacy"] + #[doc = " @deprecated Legacy API"] + #[doc = " @brief Fast synchronization which does no require spinning."] + #[doc = " - This special function is to be used by TBB and OpenMP libraries only when they know"] + #[doc = " there is no spin but they need to suppress TC warnings about shared variable modifications."] + #[doc = " - It only has corresponding pointers in static library and does not have corresponding function"] + #[doc = " in dynamic library."] + #[doc = " @see void __itt_sync_releasing(void* addr);"] + pub fn __itt_fsync_releasing(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_fsync_releasing_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_fsync_releasing_ptr__3_0: __itt_fsync_releasing_ptr__3_0_t; +} +pub type __itt_model_site = *mut ::std::os::raw::c_void; +pub type __itt_model_site_instance = *mut ::std::os::raw::c_void; +pub type __itt_model_task = *mut ::std::os::raw::c_void; +pub type __itt_model_task_instance = *mut ::std::os::raw::c_void; +pub const __itt_model_disable___itt_model_disable_observation: __itt_model_disable = 0; +pub const __itt_model_disable___itt_model_disable_collection: __itt_model_disable = 1; +#[doc = " @enum __itt_model_disable"] +#[doc = " @brief Enumerator for the disable methods"] +pub type __itt_model_disable = u32; +extern "C" { + #[doc = " @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support."] + #[doc = ""] + #[doc = " site_begin/end model a potential concurrency site."] + #[doc = " site instances may be recursively nested with themselves."] + #[doc = " site_end exits the most recently started but unended site for the current"] + #[doc = " thread. The handle passed to end may be used to validate structure."] + #[doc = " Instances of a site encountered on different threads concurrently"] + #[doc = " are considered completely distinct. If the site name for two different"] + #[doc = " lexical sites match, it is unspecified whether they are treated as the"] + #[doc = " same or different for data presentation."] + pub fn __itt_model_site_begin( + site: *mut __itt_model_site, + instance: *mut __itt_model_site_instance, + name: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn __itt_model_site_beginA(name: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn __itt_model_site_beginAL(name: *const ::std::os::raw::c_char, siteNameLen: usize); +} +extern "C" { + pub fn __itt_model_site_end( + site: *mut __itt_model_site, + instance: *mut __itt_model_site_instance, + ); +} +extern "C" { + pub fn __itt_model_site_end_2(); +} +pub type __itt_model_site_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + site: *mut __itt_model_site, + instance: *mut __itt_model_site_instance, + name: *const ::std::os::raw::c_char, + ), +>; +extern "C" { + pub static mut __itt_model_site_begin_ptr__3_0: __itt_model_site_begin_ptr__3_0_t; +} +pub type __itt_model_site_beginA_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_site_beginA_ptr__3_0: __itt_model_site_beginA_ptr__3_0_t; +} +pub type __itt_model_site_beginAL_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char, siteNameLen: usize), +>; +extern "C" { + pub static mut __itt_model_site_beginAL_ptr__3_0: __itt_model_site_beginAL_ptr__3_0_t; +} +pub type __itt_model_site_end_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(site: *mut __itt_model_site, instance: *mut __itt_model_site_instance), +>; +extern "C" { + pub static mut __itt_model_site_end_ptr__3_0: __itt_model_site_end_ptr__3_0_t; +} +pub type __itt_model_site_end_2_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_model_site_end_2_ptr__3_0: __itt_model_site_end_2_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support"] + #[doc = ""] + #[doc = " task_begin/end model a potential task, which is contained within the most"] + #[doc = " closely enclosing dynamic site. task_end exits the most recently started"] + #[doc = " but unended task. The handle passed to end may be used to validate"] + #[doc = " structure. It is unspecified if bad dynamic nesting is detected. If it"] + #[doc = " is, it should be encoded in the resulting data collection. The collector"] + #[doc = " should not fail due to construct nesting issues, nor attempt to directly"] + #[doc = " indicate the problem."] + pub fn __itt_model_task_begin( + task: *mut __itt_model_task, + instance: *mut __itt_model_task_instance, + name: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn __itt_model_task_beginA(name: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn __itt_model_task_beginAL(name: *const ::std::os::raw::c_char, taskNameLen: usize); +} +extern "C" { + pub fn __itt_model_iteration_taskA(name: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn __itt_model_iteration_taskAL(name: *const ::std::os::raw::c_char, taskNameLen: usize); +} +extern "C" { + pub fn __itt_model_task_end( + task: *mut __itt_model_task, + instance: *mut __itt_model_task_instance, + ); +} +extern "C" { + pub fn __itt_model_task_end_2(); +} +pub type __itt_model_task_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + task: *mut __itt_model_task, + instance: *mut __itt_model_task_instance, + name: *const ::std::os::raw::c_char, + ), +>; +extern "C" { + pub static mut __itt_model_task_begin_ptr__3_0: __itt_model_task_begin_ptr__3_0_t; +} +pub type __itt_model_task_beginA_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_task_beginA_ptr__3_0: __itt_model_task_beginA_ptr__3_0_t; +} +pub type __itt_model_task_beginAL_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char, taskNameLen: usize), +>; +extern "C" { + pub static mut __itt_model_task_beginAL_ptr__3_0: __itt_model_task_beginAL_ptr__3_0_t; +} +pub type __itt_model_iteration_taskA_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_iteration_taskA_ptr__3_0: __itt_model_iteration_taskA_ptr__3_0_t; +} +pub type __itt_model_iteration_taskAL_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char, taskNameLen: usize), +>; +extern "C" { + pub static mut __itt_model_iteration_taskAL_ptr__3_0: __itt_model_iteration_taskAL_ptr__3_0_t; +} +pub type __itt_model_task_end_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(task: *mut __itt_model_task, instance: *mut __itt_model_task_instance), +>; +extern "C" { + pub static mut __itt_model_task_end_ptr__3_0: __itt_model_task_end_ptr__3_0_t; +} +pub type __itt_model_task_end_2_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_model_task_end_2_ptr__3_0: __itt_model_task_end_2_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support"] + #[doc = ""] + #[doc = " lock_acquire/release model a potential lock for both lockset and"] + #[doc = " performance modeling. Each unique address is modeled as a separate"] + #[doc = " lock, with invalid addresses being valid lock IDs. Specifically:"] + #[doc = " no storage is accessed by the API at the specified address - it is only"] + #[doc = " used for lock identification. Lock acquires may be self-nested and are"] + #[doc = " unlocked by a corresponding number of releases."] + #[doc = " (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,"] + #[doc = " but may not have identical semantics.)"] + pub fn __itt_model_lock_acquire(lock: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn __itt_model_lock_acquire_2(lock: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn __itt_model_lock_release(lock: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn __itt_model_lock_release_2(lock: *mut ::std::os::raw::c_void); +} +pub type __itt_model_lock_acquire_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_lock_acquire_ptr__3_0: __itt_model_lock_acquire_ptr__3_0_t; +} +pub type __itt_model_lock_acquire_2_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_lock_acquire_2_ptr__3_0: __itt_model_lock_acquire_2_ptr__3_0_t; +} +pub type __itt_model_lock_release_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_lock_release_ptr__3_0: __itt_model_lock_release_ptr__3_0_t; +} +pub type __itt_model_lock_release_2_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_lock_release_2_ptr__3_0: __itt_model_lock_release_2_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support"] + #[doc = ""] + #[doc = " record_allocation/deallocation describe user-defined memory allocator"] + #[doc = " behavior, which may be required for correctness modeling to understand"] + #[doc = " when storage is not expected to be actually reused across threads."] + pub fn __itt_model_record_allocation(addr: *mut ::std::os::raw::c_void, size: usize); +} +extern "C" { + pub fn __itt_model_record_deallocation(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_model_record_allocation_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_record_allocation_ptr__3_0: __itt_model_record_allocation_ptr__3_0_t; +} +pub type __itt_model_record_deallocation_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_record_deallocation_ptr__3_0: + __itt_model_record_deallocation_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_INDUCTION_USES support"] + #[doc = ""] + #[doc = " Note particular storage is inductive through the end of the current site"] + pub fn __itt_model_induction_uses(addr: *mut ::std::os::raw::c_void, size: usize); +} +pub type __itt_model_induction_uses_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_induction_uses_ptr__3_0: __itt_model_induction_uses_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_REDUCTION_USES support"] + #[doc = ""] + #[doc = " Note particular storage is used for reduction through the end"] + #[doc = " of the current site"] + pub fn __itt_model_reduction_uses(addr: *mut ::std::os::raw::c_void, size: usize); +} +pub type __itt_model_reduction_uses_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_reduction_uses_ptr__3_0: __itt_model_reduction_uses_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_OBSERVE_USES support"] + #[doc = ""] + #[doc = " Have correctness modeling record observations about uses of storage"] + #[doc = " through the end of the current site"] + pub fn __itt_model_observe_uses(addr: *mut ::std::os::raw::c_void, size: usize); +} +pub type __itt_model_observe_uses_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_observe_uses_ptr__3_0: __itt_model_observe_uses_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_CLEAR_USES support"] + #[doc = ""] + #[doc = " Clear the special handling of a piece of storage related to induction,"] + #[doc = " reduction or observe_uses"] + pub fn __itt_model_clear_uses(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_model_clear_uses_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_clear_uses_ptr__3_0: __itt_model_clear_uses_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support"] + #[doc = ""] + #[doc = " disable_push/disable_pop push and pop disabling based on a parameter."] + #[doc = " Disabling observations stops processing of memory references during"] + #[doc = " correctness modeling, and all annotations that occur in the disabled"] + #[doc = " region. This allows description of code that is expected to be handled"] + #[doc = " specially during conversion to parallelism or that is not recognized"] + #[doc = " by tools (e.g. some kinds of synchronization operations.)"] + #[doc = " This mechanism causes all annotations in the disabled region, other"] + #[doc = " than disable_push and disable_pop, to be ignored. (For example, this"] + #[doc = " might validly be used to disable an entire parallel site and the contained"] + #[doc = " tasks and locking in it for data collection purposes.)"] + #[doc = " The disable for collection is a more expensive operation, but reduces"] + #[doc = " collector overhead significantly. This applies to BOTH correctness data"] + #[doc = " collection and performance data collection. For example, a site"] + #[doc = " containing a task might only enable data collection for the first 10"] + #[doc = " iterations. Both performance and correctness data should reflect this,"] + #[doc = " and the program should run as close to full speed as possible when"] + #[doc = " collection is disabled."] + pub fn __itt_model_disable_push(x: __itt_model_disable); +} +extern "C" { + pub fn __itt_model_disable_pop(); +} +extern "C" { + pub fn __itt_model_aggregate_task(x: usize); +} +pub type __itt_model_disable_push_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_disable_push_ptr__3_0: __itt_model_disable_push_ptr__3_0_t; +} +pub type __itt_model_disable_pop_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_model_disable_pop_ptr__3_0: __itt_model_disable_pop_ptr__3_0_t; +} +pub type __itt_model_aggregate_task_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_model_aggregate_task_ptr__3_0: __itt_model_aggregate_task_ptr__3_0_t; +} +#[doc = " @defgroup heap Heap"] +#[doc = " @ingroup public"] +#[doc = " Heap group"] +#[doc = " @{"] +pub type __itt_heap_function = *mut ::std::os::raw::c_void; +extern "C" { + pub fn __itt_heap_function_create( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + ) -> __itt_heap_function; +} +pub type __itt_heap_function_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + ) -> __itt_heap_function, +>; +extern "C" { + pub static mut __itt_heap_function_create_ptr__3_0: __itt_heap_function_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an allocation begin occurrence."] + pub fn __itt_heap_allocate_begin( + h: __itt_heap_function, + size: usize, + initialized: ::std::os::raw::c_int, + ); +} +pub type __itt_heap_allocate_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(h: __itt_heap_function, size: usize, initialized: ::std::os::raw::c_int), +>; +extern "C" { + pub static mut __itt_heap_allocate_begin_ptr__3_0: __itt_heap_allocate_begin_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an allocation end occurrence."] + pub fn __itt_heap_allocate_end( + h: __itt_heap_function, + addr: *mut *mut ::std::os::raw::c_void, + size: usize, + initialized: ::std::os::raw::c_int, + ); +} +pub type __itt_heap_allocate_end_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + h: __itt_heap_function, + addr: *mut *mut ::std::os::raw::c_void, + size: usize, + initialized: ::std::os::raw::c_int, + ), +>; +extern "C" { + pub static mut __itt_heap_allocate_end_ptr__3_0: __itt_heap_allocate_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an free begin occurrence."] + pub fn __itt_heap_free_begin(h: __itt_heap_function, addr: *mut ::std::os::raw::c_void); +} +pub type __itt_heap_free_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(h: __itt_heap_function, addr: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub static mut __itt_heap_free_begin_ptr__3_0: __itt_heap_free_begin_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an free end occurrence."] + pub fn __itt_heap_free_end(h: __itt_heap_function, addr: *mut ::std::os::raw::c_void); +} +pub type __itt_heap_free_end_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(h: __itt_heap_function, addr: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub static mut __itt_heap_free_end_ptr__3_0: __itt_heap_free_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an reallocation begin occurrence."] + pub fn __itt_heap_reallocate_begin( + h: __itt_heap_function, + addr: *mut ::std::os::raw::c_void, + new_size: usize, + initialized: ::std::os::raw::c_int, + ); +} +pub type __itt_heap_reallocate_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + h: __itt_heap_function, + addr: *mut ::std::os::raw::c_void, + new_size: usize, + initialized: ::std::os::raw::c_int, + ), +>; +extern "C" { + pub static mut __itt_heap_reallocate_begin_ptr__3_0: __itt_heap_reallocate_begin_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an reallocation end occurrence."] + pub fn __itt_heap_reallocate_end( + h: __itt_heap_function, + addr: *mut ::std::os::raw::c_void, + new_addr: *mut *mut ::std::os::raw::c_void, + new_size: usize, + initialized: ::std::os::raw::c_int, + ); +} +pub type __itt_heap_reallocate_end_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + h: __itt_heap_function, + addr: *mut ::std::os::raw::c_void, + new_addr: *mut *mut ::std::os::raw::c_void, + new_size: usize, + initialized: ::std::os::raw::c_int, + ), +>; +extern "C" { + pub static mut __itt_heap_reallocate_end_ptr__3_0: __itt_heap_reallocate_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief internal access begin"] + pub fn __itt_heap_internal_access_begin(); +} +pub type __itt_heap_internal_access_begin_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_heap_internal_access_begin_ptr__3_0: + __itt_heap_internal_access_begin_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief internal access end"] + pub fn __itt_heap_internal_access_end(); +} +pub type __itt_heap_internal_access_end_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_heap_internal_access_end_ptr__3_0: + __itt_heap_internal_access_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief record memory growth begin"] + pub fn __itt_heap_record_memory_growth_begin(); +} +pub type __itt_heap_record_memory_growth_begin_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_heap_record_memory_growth_begin_ptr__3_0: + __itt_heap_record_memory_growth_begin_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief record memory growth end"] + pub fn __itt_heap_record_memory_growth_end(); +} +pub type __itt_heap_record_memory_growth_end_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_heap_record_memory_growth_end_ptr__3_0: + __itt_heap_record_memory_growth_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief heap reset detection"] + pub fn __itt_heap_reset_detection(reset_mask: ::std::os::raw::c_uint); +} +pub type __itt_heap_reset_detection_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_heap_reset_detection_ptr__3_0: __itt_heap_reset_detection_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief report"] + pub fn __itt_heap_record(record_mask: ::std::os::raw::c_uint); +} +pub type __itt_heap_record_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_heap_record_ptr__3_0: __itt_heap_record_ptr__3_0_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_domain { + #[doc = "< Zero if disabled, non-zero if enabled. The meaning of different non-zero values is reserved to the runtime"] + pub flags: ::std::os::raw::c_int, + #[doc = "< Copy of original name in ASCII."] + pub nameA: *const ::std::os::raw::c_char, + pub nameW: *mut ::std::os::raw::c_void, + #[doc = "< Reserved to the runtime"] + pub extra1: ::std::os::raw::c_int, + #[doc = "< Reserved to the runtime"] + pub extra2: *mut ::std::os::raw::c_void, + pub next: *mut ___itt_domain, +} +#[test] +fn bindgen_test_layout____itt_domain() { + assert_eq!( + ::std::mem::size_of::<___itt_domain>(), + 48usize, + concat!("Size of: ", stringify!(___itt_domain)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_domain>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_domain)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).flags as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).nameA as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(nameA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).nameW as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(nameW) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).extra1 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(extra1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).extra2 as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(extra2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_domain>())).next as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(___itt_domain), + "::", + stringify!(next) + ) + ); +} +pub type __itt_domain = ___itt_domain; +extern "C" { + pub fn __itt_domain_create(name: *const ::std::os::raw::c_char) -> *mut __itt_domain; +} +pub type __itt_domain_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut __itt_domain, +>; +extern "C" { + pub static mut __itt_domain_create_ptr__3_0: __itt_domain_create_ptr__3_0_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_id { + pub d1: ::std::os::raw::c_ulonglong, + pub d2: ::std::os::raw::c_ulonglong, + pub d3: ::std::os::raw::c_ulonglong, +} +#[test] +fn bindgen_test_layout____itt_id() { + assert_eq!( + ::std::mem::size_of::<___itt_id>(), + 24usize, + concat!("Size of: ", stringify!(___itt_id)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_id>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_id)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_id>())).d1 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_id), + "::", + stringify!(d1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_id>())).d2 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_id), + "::", + stringify!(d2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_id>())).d3 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_id), + "::", + stringify!(d3) + ) + ); +} +pub type __itt_id = ___itt_id; +extern "C" { + pub static __itt_null: __itt_id; +} +extern "C" { + #[doc = " @ingroup ids"] + #[doc = " @brief Create an instance of identifier."] + #[doc = " This establishes the beginning of the lifetime of an instance of"] + #[doc = " the given ID in the trace. Once this lifetime starts, the ID"] + #[doc = " can be used to tag named entity instances in calls such as"] + #[doc = " __itt_task_begin, and to specify relationships among"] + #[doc = " identified named entity instances, using the \\ref relations APIs."] + #[doc = " Instance IDs are not domain specific!"] + #[doc = " @param[in] domain The domain controlling the execution of this call."] + #[doc = " @param[in] id The ID to create."] + pub fn __itt_id_create(domain: *const __itt_domain, id: __itt_id); +} +pub type __itt_id_create_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_id_create_ptr__3_0: __itt_id_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup ids"] + #[doc = " @brief Destroy an instance of identifier."] + #[doc = " This ends the lifetime of the current instance of the given ID value in the trace."] + #[doc = " Any relationships that are established after this lifetime ends are invalid."] + #[doc = " This call must be performed before the given ID value can be reused for a different"] + #[doc = " named entity instance."] + #[doc = " @param[in] domain The domain controlling the execution of this call."] + #[doc = " @param[in] id The ID to destroy."] + pub fn __itt_id_destroy(domain: *const __itt_domain, id: __itt_id); +} +pub type __itt_id_destroy_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_id_destroy_ptr__3_0: __itt_id_destroy_ptr__3_0_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_string_handle { + #[doc = "< Copy of original string in ASCII."] + pub strA: *const ::std::os::raw::c_char, + pub strW: *mut ::std::os::raw::c_void, + #[doc = "< Reserved. Must be zero"] + pub extra1: ::std::os::raw::c_int, + #[doc = "< Reserved. Must be zero"] + pub extra2: *mut ::std::os::raw::c_void, + pub next: *mut ___itt_string_handle, +} +#[test] +fn bindgen_test_layout____itt_string_handle() { + assert_eq!( + ::std::mem::size_of::<___itt_string_handle>(), + 40usize, + concat!("Size of: ", stringify!(___itt_string_handle)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_string_handle>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_string_handle)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_string_handle>())).strA as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_string_handle), + "::", + stringify!(strA) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_string_handle>())).strW as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_string_handle), + "::", + stringify!(strW) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_string_handle>())).extra1 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_string_handle), + "::", + stringify!(extra1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_string_handle>())).extra2 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_string_handle), + "::", + stringify!(extra2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_string_handle>())).next as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_string_handle), + "::", + stringify!(next) + ) + ); +} +pub type __itt_string_handle = ___itt_string_handle; +extern "C" { + pub fn __itt_string_handle_create( + name: *const ::std::os::raw::c_char, + ) -> *mut __itt_string_handle; +} +pub type __itt_string_handle_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut __itt_string_handle, +>; +extern "C" { + pub static mut __itt_string_handle_create_ptr__3_0: __itt_string_handle_create_ptr__3_0_t; +} +#[doc = " @cond exclude_from_documentation"] +pub type __itt_timestamp = ::std::os::raw::c_ulonglong; +extern "C" { + #[doc = " @ingroup timestamps"] + #[doc = " @brief Return timestamp corresponding to the current moment."] + #[doc = " This returns the timestamp in the format that is the most relevant for the current"] + #[doc = " host or platform (RDTSC, QPC, and others). You can use the \"<\" operator to"] + #[doc = " compare __itt_timestamp values."] + pub fn __itt_get_timestamp() -> __itt_timestamp; +} +pub type __itt_get_timestamp_ptr__3_0_t = + ::std::option::Option __itt_timestamp>; +extern "C" { + pub static mut __itt_get_timestamp_ptr__3_0: __itt_get_timestamp_ptr__3_0_t; +} +extern "C" { + #[doc = " @defgroup regions Regions"] + #[doc = " @ingroup public"] + #[doc = " Regions group"] + #[doc = " @{"] + #[doc = " @ingroup regions"] + #[doc = " @brief Begin of region instance."] + #[doc = " Successive calls to __itt_region_begin with the same ID are ignored"] + #[doc = " until a call to __itt_region_end with the same ID"] + #[doc = " @param[in] domain The domain for this region instance"] + #[doc = " @param[in] id The instance ID for this region instance. Must not be __itt_null"] + #[doc = " @param[in] parentid The instance ID for the parent of this region instance, or __itt_null"] + #[doc = " @param[in] name The name of this region"] + pub fn __itt_region_begin( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ); +} +extern "C" { + #[doc = " @ingroup regions"] + #[doc = " @brief End of region instance."] + #[doc = " The first call to __itt_region_end with a given ID ends the"] + #[doc = " region. Successive calls with the same ID are ignored, as are"] + #[doc = " calls that do not have a matching __itt_region_begin call."] + #[doc = " @param[in] domain The domain for this region instance"] + #[doc = " @param[in] id The instance ID for this region instance"] + pub fn __itt_region_end(domain: *const __itt_domain, id: __itt_id); +} +pub type __itt_region_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ), +>; +extern "C" { + pub static mut __itt_region_begin_ptr__3_0: __itt_region_begin_ptr__3_0_t; +} +pub type __itt_region_end_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_region_end_ptr__3_0: __itt_region_end_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup frames"] + #[doc = " @brief Begin a frame instance."] + #[doc = " Successive calls to __itt_frame_begin with the"] + #[doc = " same ID are ignored until a call to __itt_frame_end with the same ID."] + #[doc = " @param[in] domain The domain for this frame instance"] + #[doc = " @param[in] id The instance ID for this frame instance or NULL"] + pub fn __itt_frame_begin_v3(domain: *const __itt_domain, id: *mut __itt_id); +} +extern "C" { + #[doc = " @ingroup frames"] + #[doc = " @brief End a frame instance."] + #[doc = " The first call to __itt_frame_end with a given ID"] + #[doc = " ends the frame. Successive calls with the same ID are ignored, as are"] + #[doc = " calls that do not have a matching __itt_frame_begin call."] + #[doc = " @param[in] domain The domain for this frame instance"] + #[doc = " @param[in] id The instance ID for this frame instance or NULL for current"] + pub fn __itt_frame_end_v3(domain: *const __itt_domain, id: *mut __itt_id); +} +extern "C" { + #[doc = " @ingroup frames"] + #[doc = " @brief Submits a frame instance."] + #[doc = " Successive calls to __itt_frame_begin or __itt_frame_submit with the"] + #[doc = " same ID are ignored until a call to __itt_frame_end or __itt_frame_submit"] + #[doc = " with the same ID."] + #[doc = " Passing special __itt_timestamp_none value as \"end\" argument means"] + #[doc = " take the current timestamp as the end timestamp."] + #[doc = " @param[in] domain The domain for this frame instance"] + #[doc = " @param[in] id The instance ID for this frame instance or NULL"] + #[doc = " @param[in] begin Timestamp of the beginning of the frame"] + #[doc = " @param[in] end Timestamp of the end of the frame"] + pub fn __itt_frame_submit_v3( + domain: *const __itt_domain, + id: *mut __itt_id, + begin: __itt_timestamp, + end: __itt_timestamp, + ); +} +pub type __itt_frame_begin_v3_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_frame_begin_v3_ptr__3_0: __itt_frame_begin_v3_ptr__3_0_t; +} +pub type __itt_frame_end_v3_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_frame_end_v3_ptr__3_0: __itt_frame_end_v3_ptr__3_0_t; +} +pub type __itt_frame_submit_v3_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: *mut __itt_id, + begin: __itt_timestamp, + end: __itt_timestamp, + ), +>; +extern "C" { + pub static mut __itt_frame_submit_v3_ptr__3_0: __itt_frame_submit_v3_ptr__3_0_t; +} +extern "C" { + #[doc = " @defgroup taskgroup Task Group"] + #[doc = " @ingroup public"] + #[doc = " Task Group"] + #[doc = " @{"] + #[doc = " @ingroup task_groups"] + #[doc = " @brief Denotes a task_group instance."] + #[doc = " Successive calls to __itt_task_group with the same ID are ignored."] + #[doc = " @param[in] domain The domain for this task_group instance"] + #[doc = " @param[in] id The instance ID for this task_group instance. Must not be __itt_null."] + #[doc = " @param[in] parentid The instance ID for the parent of this task_group instance, or __itt_null."] + #[doc = " @param[in] name The name of this task_group"] + pub fn __itt_task_group( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ); +} +pub type __itt_task_group_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ), +>; +extern "C" { + pub static mut __itt_task_group_ptr__3_0: __itt_task_group_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup tasks"] + #[doc = " @brief Begin a task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] taskid The instance ID for this task instance, or __itt_null"] + #[doc = " @param[in] parentid The parent instance to which this task instance belongs, or __itt_null"] + #[doc = " @param[in] name The name of this task"] + pub fn __itt_task_begin( + domain: *const __itt_domain, + taskid: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ); +} +extern "C" { + #[doc = " @ingroup tasks"] + #[doc = " @brief Begin a task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] taskid The identifier for this task instance (may be 0)"] + #[doc = " @param[in] parentid The parent of this task (may be 0)"] + #[doc = " @param[in] fn The pointer to the function you are tracing"] + pub fn __itt_task_begin_fn( + domain: *const __itt_domain, + taskid: __itt_id, + parentid: __itt_id, + fn_: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " @ingroup tasks"] + #[doc = " @brief End the current task instance."] + #[doc = " @param[in] domain The domain for this task"] + pub fn __itt_task_end(domain: *const __itt_domain); +} +extern "C" { + #[doc = " @ingroup tasks"] + #[doc = " @brief Begin an overlapped task instance."] + #[doc = " @param[in] domain The domain for this task."] + #[doc = " @param[in] taskid The identifier for this task instance, *cannot* be __itt_null."] + #[doc = " @param[in] parentid The parent of this task, or __itt_null."] + #[doc = " @param[in] name The name of this task."] + pub fn __itt_task_begin_overlapped( + domain: *const __itt_domain, + taskid: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ); +} +extern "C" { + #[doc = " @ingroup tasks"] + #[doc = " @brief End an overlapped task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] taskid Explicit ID of finished task"] + pub fn __itt_task_end_overlapped(domain: *const __itt_domain, taskid: __itt_id); +} +pub type __itt_task_begin_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ), +>; +extern "C" { + pub static mut __itt_task_begin_ptr__3_0: __itt_task_begin_ptr__3_0_t; +} +pub type __itt_task_begin_fn_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + parentid: __itt_id, + fn_: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut __itt_task_begin_fn_ptr__3_0: __itt_task_begin_fn_ptr__3_0_t; +} +pub type __itt_task_end_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_task_end_ptr__3_0: __itt_task_end_ptr__3_0_t; +} +pub type __itt_task_begin_overlapped_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + taskid: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ), +>; +extern "C" { + pub static mut __itt_task_begin_overlapped_ptr__3_0: __itt_task_begin_overlapped_ptr__3_0_t; +} +pub type __itt_task_end_overlapped_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_task_end_overlapped_ptr__3_0: __itt_task_end_overlapped_ptr__3_0_t; +} +pub const __itt_scope___itt_scope_unknown: __itt_scope = 0; +pub const __itt_scope___itt_scope_global: __itt_scope = 1; +pub const __itt_scope___itt_scope_track_group: __itt_scope = 2; +pub const __itt_scope___itt_scope_track: __itt_scope = 3; +pub const __itt_scope___itt_scope_task: __itt_scope = 4; +pub const __itt_scope___itt_scope_marker: __itt_scope = 5; +#[doc = " @brief Describes the scope of an event object in the trace."] +pub type __itt_scope = u32; +extern "C" { + #[doc = " @ingroup markers"] + #[doc = " @brief Create a marker instance"] + #[doc = " @param[in] domain The domain for this marker"] + #[doc = " @param[in] id The instance ID for this marker or __itt_null"] + #[doc = " @param[in] name The name for this marker"] + #[doc = " @param[in] scope The scope for this marker"] + pub fn __itt_marker( + domain: *const __itt_domain, + id: __itt_id, + name: *mut __itt_string_handle, + scope: __itt_scope, + ); +} +pub type __itt_marker_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + name: *mut __itt_string_handle, + scope: __itt_scope, + ), +>; +extern "C" { + pub static mut __itt_marker_ptr__3_0: __itt_marker_ptr__3_0_t; +} +pub const __itt_metadata_type___itt_metadata_unknown: __itt_metadata_type = 0; +#[doc = "< Unsigned 64-bit integer"] +pub const __itt_metadata_type___itt_metadata_u64: __itt_metadata_type = 1; +#[doc = "< Signed 64-bit integer"] +pub const __itt_metadata_type___itt_metadata_s64: __itt_metadata_type = 2; +#[doc = "< Unsigned 32-bit integer"] +pub const __itt_metadata_type___itt_metadata_u32: __itt_metadata_type = 3; +#[doc = "< Signed 32-bit integer"] +pub const __itt_metadata_type___itt_metadata_s32: __itt_metadata_type = 4; +#[doc = "< Unsigned 16-bit integer"] +pub const __itt_metadata_type___itt_metadata_u16: __itt_metadata_type = 5; +#[doc = "< Signed 16-bit integer"] +pub const __itt_metadata_type___itt_metadata_s16: __itt_metadata_type = 6; +#[doc = "< Signed 32-bit floating-point"] +pub const __itt_metadata_type___itt_metadata_float: __itt_metadata_type = 7; +#[doc = "< SIgned 64-bit floating-point"] +pub const __itt_metadata_type___itt_metadata_double: __itt_metadata_type = 8; +#[doc = " @ingroup parameters"] +#[doc = " @brief describes the type of metadata"] +pub type __itt_metadata_type = u32; +extern "C" { + #[doc = " @ingroup parameters"] + #[doc = " @brief Add metadata to an instance of a named entity."] + #[doc = " @param[in] domain The domain controlling the call"] + #[doc = " @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task"] + #[doc = " @param[in] key The name of the metadata"] + #[doc = " @param[in] type The type of the metadata"] + #[doc = " @param[in] count The number of elements of the given type. If count == 0, no metadata will be added."] + #[doc = " @param[in] data The metadata itself"] + pub fn __itt_metadata_add( + domain: *const __itt_domain, + id: __itt_id, + key: *mut __itt_string_handle, + type_: __itt_metadata_type, + count: usize, + data: *mut ::std::os::raw::c_void, + ); +} +pub type __itt_metadata_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + key: *mut __itt_string_handle, + type_: __itt_metadata_type, + count: usize, + data: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut __itt_metadata_add_ptr__3_0: __itt_metadata_add_ptr__3_0_t; +} +extern "C" { + pub fn __itt_metadata_str_add( + domain: *const __itt_domain, + id: __itt_id, + key: *mut __itt_string_handle, + data: *const ::std::os::raw::c_char, + length: usize, + ); +} +pub type __itt_metadata_str_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + id: __itt_id, + key: *mut __itt_string_handle, + data: *const ::std::os::raw::c_char, + length: usize, + ), +>; +extern "C" { + pub static mut __itt_metadata_str_add_ptr__3_0: __itt_metadata_str_add_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup parameters"] + #[doc = " @brief Add metadata to an instance of a named entity."] + #[doc = " @param[in] domain The domain controlling the call"] + #[doc = " @param[in] scope The scope of the instance to which the metadata is to be added"] + #[doc = ""] + #[doc = " @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task"] + #[doc = ""] + #[doc = " @param[in] key The name of the metadata"] + #[doc = " @param[in] type The type of the metadata"] + #[doc = " @param[in] count The number of elements of the given type. If count == 0, no metadata will be added."] + #[doc = " @param[in] data The metadata itself"] + pub fn __itt_metadata_add_with_scope( + domain: *const __itt_domain, + scope: __itt_scope, + key: *mut __itt_string_handle, + type_: __itt_metadata_type, + count: usize, + data: *mut ::std::os::raw::c_void, + ); +} +pub type __itt_metadata_add_with_scope_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + scope: __itt_scope, + key: *mut __itt_string_handle, + type_: __itt_metadata_type, + count: usize, + data: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut __itt_metadata_add_with_scope_ptr__3_0: __itt_metadata_add_with_scope_ptr__3_0_t; +} +extern "C" { + pub fn __itt_metadata_str_add_with_scope( + domain: *const __itt_domain, + scope: __itt_scope, + key: *mut __itt_string_handle, + data: *const ::std::os::raw::c_char, + length: usize, + ); +} +pub type __itt_metadata_str_add_with_scope_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + scope: __itt_scope, + key: *mut __itt_string_handle, + data: *const ::std::os::raw::c_char, + length: usize, + ), +>; +extern "C" { + pub static mut __itt_metadata_str_add_with_scope_ptr__3_0: + __itt_metadata_str_add_with_scope_ptr__3_0_t; +} +pub const __itt_relation___itt_relation_is_unknown: __itt_relation = 0; +#[doc = "< \"A is dependent on B\" means that A cannot start until B completes"] +pub const __itt_relation___itt_relation_is_dependent_on: __itt_relation = 1; +#[doc = "< \"A is sibling of B\" means that A and B were created as a group"] +pub const __itt_relation___itt_relation_is_sibling_of: __itt_relation = 2; +#[doc = "< \"A is parent of B\" means that A created B"] +pub const __itt_relation___itt_relation_is_parent_of: __itt_relation = 3; +#[doc = "< \"A is continuation of B\" means that A assumes the dependencies of B"] +pub const __itt_relation___itt_relation_is_continuation_of: __itt_relation = 4; +#[doc = "< \"A is child of B\" means that A was created by B (inverse of is_parent_of)"] +pub const __itt_relation___itt_relation_is_child_of: __itt_relation = 5; +#[doc = "< \"A is continued by B\" means that B assumes the dependencies of A (inverse of is_continuation_of)"] +pub const __itt_relation___itt_relation_is_continued_by: __itt_relation = 6; +#[doc = "< \"A is predecessor to B\" means that B cannot start until A completes (inverse of is_dependent_on)"] +pub const __itt_relation___itt_relation_is_predecessor_to: __itt_relation = 7; +#[doc = " @ingroup relations"] +#[doc = " @brief The kind of relation between two instances is specified by the enumerated type __itt_relation."] +#[doc = " Relations between instances can be added with an API call. The relation"] +#[doc = " API uses instance IDs. Relations can be added before or after the actual"] +#[doc = " instances are created and persist independently of the instances. This"] +#[doc = " is the motivation for having different lifetimes for instance IDs and"] +#[doc = " the actual instances."] +pub type __itt_relation = u32; +extern "C" { + #[doc = " @ingroup relations"] + #[doc = " @brief Add a relation to the current task instance."] + #[doc = " The current task instance is the head of the relation."] + #[doc = " @param[in] domain The domain controlling this call"] + #[doc = " @param[in] relation The kind of relation"] + #[doc = " @param[in] tail The ID for the tail of the relation"] + pub fn __itt_relation_add_to_current( + domain: *const __itt_domain, + relation: __itt_relation, + tail: __itt_id, + ); +} +extern "C" { + #[doc = " @ingroup relations"] + #[doc = " @brief Add a relation between two instance identifiers."] + #[doc = " @param[in] domain The domain controlling this call"] + #[doc = " @param[in] head The ID for the head of the relation"] + #[doc = " @param[in] relation The kind of relation"] + #[doc = " @param[in] tail The ID for the tail of the relation"] + pub fn __itt_relation_add( + domain: *const __itt_domain, + head: __itt_id, + relation: __itt_relation, + tail: __itt_id, + ); +} +pub type __itt_relation_add_to_current_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, relation: __itt_relation, tail: __itt_id), +>; +extern "C" { + pub static mut __itt_relation_add_to_current_ptr__3_0: __itt_relation_add_to_current_ptr__3_0_t; +} +pub type __itt_relation_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + head: __itt_id, + relation: __itt_relation, + tail: __itt_id, + ), +>; +extern "C" { + pub static mut __itt_relation_add_ptr__3_0: __itt_relation_add_ptr__3_0_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_clock_info { + #[doc = "< Clock domain frequency"] + pub clock_freq: ::std::os::raw::c_ulonglong, + #[doc = "< Clock domain base timestamp"] + pub clock_base: ::std::os::raw::c_ulonglong, +} +#[test] +fn bindgen_test_layout____itt_clock_info() { + assert_eq!( + ::std::mem::size_of::<___itt_clock_info>(), + 16usize, + concat!("Size of: ", stringify!(___itt_clock_info)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_clock_info>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_clock_info)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_info>())).clock_freq as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_info), + "::", + stringify!(clock_freq) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_info>())).clock_base as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_info), + "::", + stringify!(clock_base) + ) + ); +} +pub type __itt_clock_info = ___itt_clock_info; +#[doc = " @cond exclude_from_documentation"] +pub type __itt_get_clock_info_fn = ::std::option::Option< + unsafe extern "C" fn(clock_info: *mut __itt_clock_info, data: *mut ::std::os::raw::c_void), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_clock_domain { + #[doc = "< Most recent clock domain info"] + pub info: __itt_clock_info, + #[doc = "< Callback function pointer"] + pub fn_: __itt_get_clock_info_fn, + #[doc = "< Input argument for the callback function"] + pub fn_data: *mut ::std::os::raw::c_void, + #[doc = "< Reserved. Must be zero"] + pub extra1: ::std::os::raw::c_int, + #[doc = "< Reserved. Must be zero"] + pub extra2: *mut ::std::os::raw::c_void, + pub next: *mut ___itt_clock_domain, +} +#[test] +fn bindgen_test_layout____itt_clock_domain() { + assert_eq!( + ::std::mem::size_of::<___itt_clock_domain>(), + 56usize, + concat!("Size of: ", stringify!(___itt_clock_domain)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_clock_domain>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_clock_domain)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).info as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(info) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).fn_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(fn_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).fn_data as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(fn_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).extra1 as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(extra1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).extra2 as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(extra2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_clock_domain>())).next as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(___itt_clock_domain), + "::", + stringify!(next) + ) + ); +} +pub type __itt_clock_domain = ___itt_clock_domain; +extern "C" { + #[doc = " @ingroup clockdomains"] + #[doc = " @brief Create a clock domain."] + #[doc = " Certain applications require the capability to trace their application using"] + #[doc = " a clock domain different than the CPU, for instance the instrumentation of events"] + #[doc = " that occur on a GPU."] + #[doc = " Because the set of domains is expected to be static over the application's execution time,"] + #[doc = " there is no mechanism to destroy a domain."] + #[doc = " Any domain can be accessed by any thread in the process, regardless of which thread created"] + #[doc = " the domain. This call is thread-safe."] + #[doc = " @param[in] fn A pointer to a callback function which retrieves alternative CPU timestamps"] + #[doc = " @param[in] fn_data Argument for a callback function; may be NULL"] + pub fn __itt_clock_domain_create( + fn_: __itt_get_clock_info_fn, + fn_data: *mut ::std::os::raw::c_void, + ) -> *mut __itt_clock_domain; +} +pub type __itt_clock_domain_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + fn_: __itt_get_clock_info_fn, + fn_data: *mut ::std::os::raw::c_void, + ) -> *mut __itt_clock_domain, +>; +extern "C" { + pub static mut __itt_clock_domain_create_ptr__3_0: __itt_clock_domain_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup clockdomains"] + #[doc = " @brief Recalculate clock domains frequencies and clock base timestamps."] + pub fn __itt_clock_domain_reset(); +} +pub type __itt_clock_domain_reset_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_clock_domain_reset_ptr__3_0: __itt_clock_domain_reset_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Create an instance of identifier. This establishes the beginning of the lifetime of"] + #[doc = " an instance of the given ID in the trace. Once this lifetime starts, the ID can be used to"] + #[doc = " tag named entity instances in calls such as __itt_task_begin, and to specify relationships among"] + #[doc = " identified named entity instances, using the \\ref relations APIs."] + #[doc = " @param[in] domain The domain controlling the execution of this call."] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] id The ID to create."] + pub fn __itt_id_create_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + ); +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Destroy an instance of identifier. This ends the lifetime of the current instance of the"] + #[doc = " given ID value in the trace. Any relationships that are established after this lifetime ends are"] + #[doc = " invalid. This call must be performed before the given ID value can be reused for a different"] + #[doc = " named entity instance."] + #[doc = " @param[in] domain The domain controlling the execution of this call."] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] id The ID to destroy."] + pub fn __itt_id_destroy_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + ); +} +pub type __itt_id_create_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + ), +>; +extern "C" { + pub static mut __itt_id_create_ex_ptr__3_0: __itt_id_create_ex_ptr__3_0_t; +} +pub type __itt_id_destroy_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + ), +>; +extern "C" { + pub static mut __itt_id_destroy_ex_ptr__3_0: __itt_id_destroy_ex_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Begin a task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] taskid The instance ID for this task instance, or __itt_null"] + #[doc = " @param[in] parentid The parent instance to which this task instance belongs, or __itt_null"] + #[doc = " @param[in] name The name of this task"] + pub fn __itt_task_begin_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + taskid: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ); +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Begin a task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] taskid The identifier for this task instance, or __itt_null"] + #[doc = " @param[in] parentid The parent of this task, or __itt_null"] + #[doc = " @param[in] fn The pointer to the function you are tracing"] + pub fn __itt_task_begin_fn_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + taskid: __itt_id, + parentid: __itt_id, + fn_: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief End the current task instance."] + #[doc = " @param[in] domain The domain for this task"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + pub fn __itt_task_end_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + ); +} +pub type __itt_task_begin_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + parentid: __itt_id, + name: *mut __itt_string_handle, + ), +>; +extern "C" { + pub static mut __itt_task_begin_ex_ptr__3_0: __itt_task_begin_ex_ptr__3_0_t; +} +pub type __itt_task_begin_fn_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + parentid: __itt_id, + fn_: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut __itt_task_begin_fn_ex_ptr__3_0: __itt_task_begin_fn_ex_ptr__3_0_t; +} +pub type __itt_task_end_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + ), +>; +extern "C" { + pub static mut __itt_task_end_ex_ptr__3_0: __itt_task_end_ex_ptr__3_0_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_counter { + _unused: [u8; 0], +} +#[doc = " @brief opaque structure for counter identification"] +pub type __itt_counter = *mut ___itt_counter; +extern "C" { + pub fn __itt_counter_create( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + ) -> __itt_counter; +} +pub type __itt_counter_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + ) -> __itt_counter, +>; +extern "C" { + pub static mut __itt_counter_create_ptr__3_0: __itt_counter_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Increment the unsigned 64 bits integer counter value"] + #[doc = ""] + #[doc = " Calling this function to non-unsigned 64 bits integer counters has no effect"] + pub fn __itt_counter_inc(id: __itt_counter); +} +pub type __itt_counter_inc_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_counter_inc_ptr__3_0: __itt_counter_inc_ptr__3_0_t; +} +extern "C" { + #[doc = " @endcond */"] + #[doc = " @brief Increment the unsigned 64 bits integer counter value with x"] + #[doc = ""] + #[doc = " Calling this function to non-unsigned 64 bits integer counters has no effect"] + pub fn __itt_counter_inc_delta(id: __itt_counter, value: ::std::os::raw::c_ulonglong); +} +pub type __itt_counter_inc_delta_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(id: __itt_counter, value: ::std::os::raw::c_ulonglong), +>; +extern "C" { + pub static mut __itt_counter_inc_delta_ptr__3_0: __itt_counter_inc_delta_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Decrement the unsigned 64 bits integer counter value"] + #[doc = ""] + #[doc = " Calling this function to non-unsigned 64 bits integer counters has no effect"] + pub fn __itt_counter_dec(id: __itt_counter); +} +pub type __itt_counter_dec_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_counter_dec_ptr__3_0: __itt_counter_dec_ptr__3_0_t; +} +extern "C" { + #[doc = " @endcond */"] + #[doc = " @brief Decrement the unsigned 64 bits integer counter value with x"] + #[doc = ""] + #[doc = " Calling this function to non-unsigned 64 bits integer counters has no effect"] + pub fn __itt_counter_dec_delta(id: __itt_counter, value: ::std::os::raw::c_ulonglong); +} +pub type __itt_counter_dec_delta_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(id: __itt_counter, value: ::std::os::raw::c_ulonglong), +>; +extern "C" { + pub static mut __itt_counter_dec_delta_ptr__3_0: __itt_counter_dec_delta_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup counters"] + #[doc = " @brief Increment a counter by one."] + #[doc = " The first call with a given name creates a counter by that name and sets its"] + #[doc = " value to zero. Successive calls increment the counter value."] + #[doc = " @param[in] domain The domain controlling the call. Counter names are not domain specific."] + #[doc = " The domain argument is used only to enable or disable the API calls."] + #[doc = " @param[in] name The name of the counter"] + pub fn __itt_counter_inc_v3(domain: *const __itt_domain, name: *mut __itt_string_handle); +} +extern "C" { + #[doc = " @ingroup counters"] + #[doc = " @brief Increment a counter by the value specified in delta."] + #[doc = " @param[in] domain The domain controlling the call. Counter names are not domain specific."] + #[doc = " The domain argument is used only to enable or disable the API calls."] + #[doc = " @param[in] name The name of the counter"] + #[doc = " @param[in] delta The amount by which to increment the counter"] + pub fn __itt_counter_inc_delta_v3( + domain: *const __itt_domain, + name: *mut __itt_string_handle, + delta: ::std::os::raw::c_ulonglong, + ); +} +pub type __itt_counter_inc_v3_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, name: *mut __itt_string_handle), +>; +extern "C" { + pub static mut __itt_counter_inc_v3_ptr__3_0: __itt_counter_inc_v3_ptr__3_0_t; +} +pub type __itt_counter_inc_delta_v3_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + name: *mut __itt_string_handle, + delta: ::std::os::raw::c_ulonglong, + ), +>; +extern "C" { + pub static mut __itt_counter_inc_delta_v3_ptr__3_0: __itt_counter_inc_delta_v3_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup counters"] + #[doc = " @brief Decrement a counter by one."] + #[doc = " The first call with a given name creates a counter by that name and sets its"] + #[doc = " value to zero. Successive calls decrement the counter value."] + #[doc = " @param[in] domain The domain controlling the call. Counter names are not domain specific."] + #[doc = " The domain argument is used only to enable or disable the API calls."] + #[doc = " @param[in] name The name of the counter"] + pub fn __itt_counter_dec_v3(domain: *const __itt_domain, name: *mut __itt_string_handle); +} +extern "C" { + #[doc = " @ingroup counters"] + #[doc = " @brief Decrement a counter by the value specified in delta."] + #[doc = " @param[in] domain The domain controlling the call. Counter names are not domain specific."] + #[doc = " The domain argument is used only to enable or disable the API calls."] + #[doc = " @param[in] name The name of the counter"] + #[doc = " @param[in] delta The amount by which to decrement the counter"] + pub fn __itt_counter_dec_delta_v3( + domain: *const __itt_domain, + name: *mut __itt_string_handle, + delta: ::std::os::raw::c_ulonglong, + ); +} +pub type __itt_counter_dec_v3_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, name: *mut __itt_string_handle), +>; +extern "C" { + pub static mut __itt_counter_dec_v3_ptr__3_0: __itt_counter_dec_v3_ptr__3_0_t; +} +pub type __itt_counter_dec_delta_v3_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + name: *mut __itt_string_handle, + delta: ::std::os::raw::c_ulonglong, + ), +>; +extern "C" { + pub static mut __itt_counter_dec_delta_v3_ptr__3_0: __itt_counter_dec_delta_v3_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Set the counter value"] + pub fn __itt_counter_set_value(id: __itt_counter, value_ptr: *mut ::std::os::raw::c_void); +} +pub type __itt_counter_set_value_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(id: __itt_counter, value_ptr: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub static mut __itt_counter_set_value_ptr__3_0: __itt_counter_set_value_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Set the counter value"] + pub fn __itt_counter_set_value_ex( + id: __itt_counter, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + value_ptr: *mut ::std::os::raw::c_void, + ); +} +pub type __itt_counter_set_value_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + id: __itt_counter, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + value_ptr: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut __itt_counter_set_value_ex_ptr__3_0: __itt_counter_set_value_ex_ptr__3_0_t; +} +extern "C" { + pub fn __itt_counter_create_typed( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + type_: __itt_metadata_type, + ) -> __itt_counter; +} +pub type __itt_counter_create_typed_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + type_: __itt_metadata_type, + ) -> __itt_counter, +>; +extern "C" { + pub static mut __itt_counter_create_typed_ptr__3_0: __itt_counter_create_typed_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Destroy the counter identified by the pointer previously returned by __itt_counter_create() or"] + #[doc = " __itt_counter_create_typed()"] + pub fn __itt_counter_destroy(id: __itt_counter); +} +pub type __itt_counter_destroy_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_counter_destroy_ptr__3_0: __itt_counter_destroy_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup markers"] + #[doc = " @brief Create a marker instance."] + #[doc = " @param[in] domain The domain for this marker"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] id The instance ID for this marker, or __itt_null"] + #[doc = " @param[in] name The name for this marker"] + #[doc = " @param[in] scope The scope for this marker"] + pub fn __itt_marker_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + name: *mut __itt_string_handle, + scope: __itt_scope, + ); +} +pub type __itt_marker_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + id: __itt_id, + name: *mut __itt_string_handle, + scope: __itt_scope, + ), +>; +extern "C" { + pub static mut __itt_marker_ex_ptr__3_0: __itt_marker_ex_ptr__3_0_t; +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Add a relation to the current task instance."] + #[doc = " The current task instance is the head of the relation."] + #[doc = " @param[in] domain The domain controlling this call"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] relation The kind of relation"] + #[doc = " @param[in] tail The ID for the tail of the relation"] + pub fn __itt_relation_add_to_current_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + relation: __itt_relation, + tail: __itt_id, + ); +} +extern "C" { + #[doc = " @ingroup clockdomain"] + #[doc = " @brief Add a relation between two instance identifiers."] + #[doc = " @param[in] domain The domain controlling this call"] + #[doc = " @param[in] clock_domain The clock domain controlling the execution of this call."] + #[doc = " @param[in] timestamp The user defined timestamp."] + #[doc = " @param[in] head The ID for the head of the relation"] + #[doc = " @param[in] relation The kind of relation"] + #[doc = " @param[in] tail The ID for the tail of the relation"] + pub fn __itt_relation_add_ex( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + head: __itt_id, + relation: __itt_relation, + tail: __itt_id, + ); +} +pub type __itt_relation_add_to_current_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + relation: __itt_relation, + tail: __itt_id, + ), +>; +extern "C" { + pub static mut __itt_relation_add_to_current_ex_ptr__3_0: + __itt_relation_add_to_current_ex_ptr__3_0_t; +} +pub type __itt_relation_add_ex_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + clock_domain: *mut __itt_clock_domain, + timestamp: ::std::os::raw::c_ulonglong, + head: __itt_id, + relation: __itt_relation, + tail: __itt_id, + ), +>; +extern "C" { + pub static mut __itt_relation_add_ex_ptr__3_0: __itt_relation_add_ex_ptr__3_0_t; +} +pub const ___itt_track_group_type___itt_track_group_type_normal: ___itt_track_group_type = 0; +#[doc = " @cond exclude_from_documentation"] +pub type ___itt_track_group_type = u32; +pub use self::___itt_track_group_type as __itt_track_group_type; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_track_group { + #[doc = "< Name of the track group"] + pub name: *mut __itt_string_handle, + #[doc = "< List of child tracks"] + pub track: *mut ___itt_track, + #[doc = "< Type of the track group"] + pub tgtype: __itt_track_group_type, + #[doc = "< Reserved. Must be zero"] + pub extra1: ::std::os::raw::c_int, + #[doc = "< Reserved. Must be zero"] + pub extra2: *mut ::std::os::raw::c_void, + pub next: *mut ___itt_track_group, +} +#[test] +fn bindgen_test_layout____itt_track_group() { + assert_eq!( + ::std::mem::size_of::<___itt_track_group>(), + 40usize, + concat!("Size of: ", stringify!(___itt_track_group)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_track_group>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_track_group)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).track as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(track) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).tgtype as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(tgtype) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).extra1 as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(extra1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).extra2 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(extra2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track_group>())).next as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_track_group), + "::", + stringify!(next) + ) + ); +} +pub type __itt_track_group = ___itt_track_group; +pub const ___itt_track_type___itt_track_type_normal: ___itt_track_type = 0; +#[doc = " @brief Placeholder for custom track types. Currently, \"normal\" custom track"] +#[doc = " is the only available track type."] +pub type ___itt_track_type = u32; +pub use self::___itt_track_type as __itt_track_type; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_track { + #[doc = "< Name of the track group"] + pub name: *mut __itt_string_handle, + #[doc = "< Parent group to a track"] + pub group: *mut __itt_track_group, + #[doc = "< Type of the track"] + pub ttype: __itt_track_type, + #[doc = "< Reserved. Must be zero"] + pub extra1: ::std::os::raw::c_int, + #[doc = "< Reserved. Must be zero"] + pub extra2: *mut ::std::os::raw::c_void, + pub next: *mut ___itt_track, +} +#[test] +fn bindgen_test_layout____itt_track() { + assert_eq!( + ::std::mem::size_of::<___itt_track>(), + 40usize, + concat!("Size of: ", stringify!(___itt_track)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_track>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_track)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).group as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(group) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).ttype as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(ttype) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).extra1 as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(extra1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).extra2 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(extra2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_track>())).next as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_track), + "::", + stringify!(next) + ) + ); +} +pub type __itt_track = ___itt_track; +extern "C" { + #[doc = " @brief Create logical track group."] + pub fn __itt_track_group_create( + name: *mut __itt_string_handle, + track_group_type: __itt_track_group_type, + ) -> *mut __itt_track_group; +} +pub type __itt_track_group_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + name: *mut __itt_string_handle, + track_group_type: __itt_track_group_type, + ) -> *mut __itt_track_group, +>; +extern "C" { + pub static mut __itt_track_group_create_ptr__3_0: __itt_track_group_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Create logical track."] + pub fn __itt_track_create( + track_group: *mut __itt_track_group, + name: *mut __itt_string_handle, + track_type: __itt_track_type, + ) -> *mut __itt_track; +} +pub type __itt_track_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + track_group: *mut __itt_track_group, + name: *mut __itt_string_handle, + track_type: __itt_track_type, + ) -> *mut __itt_track, +>; +extern "C" { + pub static mut __itt_track_create_ptr__3_0: __itt_track_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Set the logical track."] + pub fn __itt_set_track(track: *mut __itt_track); +} +pub type __itt_set_track_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_set_track_ptr__3_0: __itt_set_track_ptr__3_0_t; +} +#[doc = " @cond exclude_from_gpa_documentation */"] +#[doc = " @defgroup events Events"] +#[doc = " @ingroup public"] +#[doc = " Events group"] +#[doc = " @{"] +pub type __itt_event = ::std::os::raw::c_int; +extern "C" { + pub fn __itt_event_create( + name: *const ::std::os::raw::c_char, + namelen: ::std::os::raw::c_int, + ) -> __itt_event; +} +pub type __itt_event_create_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + namelen: ::std::os::raw::c_int, + ) -> __itt_event, +>; +extern "C" { + pub static mut __itt_event_create_ptr__3_0: __itt_event_create_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an event occurrence."] + #[doc = " @return __itt_err upon failure (invalid event id/user event feature not enabled)"] + pub fn __itt_event_start(event: __itt_event) -> ::std::os::raw::c_int; +} +pub type __itt_event_start_ptr__3_0_t = + ::std::option::Option ::std::os::raw::c_int>; +extern "C" { + pub static mut __itt_event_start_ptr__3_0: __itt_event_start_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Record an event end occurrence."] + #[doc = " @note It is optional if events do not have durations."] + #[doc = " @return __itt_err upon failure (invalid event id/user event feature not enabled)"] + pub fn __itt_event_end(event: __itt_event) -> ::std::os::raw::c_int; +} +pub type __itt_event_end_ptr__3_0_t = + ::std::option::Option ::std::os::raw::c_int>; +extern "C" { + pub static mut __itt_event_end_ptr__3_0: __itt_event_end_ptr__3_0_t; +} +pub const __itt_av_data_type___itt_e_first: __itt_av_data_type = 0; +pub const __itt_av_data_type___itt_e_char: __itt_av_data_type = 0; +pub const __itt_av_data_type___itt_e_uchar: __itt_av_data_type = 1; +pub const __itt_av_data_type___itt_e_int16: __itt_av_data_type = 2; +pub const __itt_av_data_type___itt_e_uint16: __itt_av_data_type = 3; +pub const __itt_av_data_type___itt_e_int32: __itt_av_data_type = 4; +pub const __itt_av_data_type___itt_e_uint32: __itt_av_data_type = 5; +pub const __itt_av_data_type___itt_e_int64: __itt_av_data_type = 6; +pub const __itt_av_data_type___itt_e_uint64: __itt_av_data_type = 7; +pub const __itt_av_data_type___itt_e_float: __itt_av_data_type = 8; +pub const __itt_av_data_type___itt_e_double: __itt_av_data_type = 9; +pub const __itt_av_data_type___itt_e_last: __itt_av_data_type = 9; +#[doc = " @enum __itt_av_data_type"] +#[doc = " @brief Defines types of arrays data (for C/C++ intrinsic types)"] +pub type __itt_av_data_type = u32; +extern "C" { + pub fn __itt_av_save( + data: *mut ::std::os::raw::c_void, + rank: ::std::os::raw::c_int, + dimensions: *const ::std::os::raw::c_int, + type_: ::std::os::raw::c_int, + filePath: *const ::std::os::raw::c_char, + columnOrder: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +pub type __itt_av_save_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + data: *mut ::std::os::raw::c_void, + rank: ::std::os::raw::c_int, + dimensions: *const ::std::os::raw::c_int, + type_: ::std::os::raw::c_int, + filePath: *const ::std::os::raw::c_char, + columnOrder: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub static mut __itt_av_save_ptr__3_0: __itt_av_save_ptr__3_0_t; +} +extern "C" { + #[doc = " @endcond"] + pub fn __itt_enable_attach(); +} +pub type __itt_enable_attach_ptr__3_0_t = ::std::option::Option; +extern "C" { + pub static mut __itt_enable_attach_ptr__3_0: __itt_enable_attach_ptr__3_0_t; +} +extern "C" { + pub fn __itt_module_load( + start_addr: *mut ::std::os::raw::c_void, + end_addr: *mut ::std::os::raw::c_void, + path: *const ::std::os::raw::c_char, + ); +} +pub type __itt_module_load_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + start_addr: *mut ::std::os::raw::c_void, + end_addr: *mut ::std::os::raw::c_void, + path: *const ::std::os::raw::c_char, + ), +>; +extern "C" { + pub static mut __itt_module_load_ptr__3_0: __itt_module_load_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Report module unload"] + #[doc = " This API is used to report necessary information in case of bypassing default system loader."] + #[doc = " Notification should be done just before the module is unloaded from process memory."] + #[doc = " @param[in] addr - base address of loaded module"] + pub fn __itt_module_unload(addr: *mut ::std::os::raw::c_void); +} +pub type __itt_module_unload_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_module_unload_ptr__3_0: __itt_module_unload_ptr__3_0_t; +} +pub const __itt_module_type___itt_module_type_unknown: __itt_module_type = 0; +pub const __itt_module_type___itt_module_type_elf: __itt_module_type = 1; +pub const __itt_module_type___itt_module_type_coff: __itt_module_type = 2; +#[doc = " @cond exclude_from_documentation"] +pub type __itt_module_type = u32; +pub const __itt_section_type_itt_section_type_unknown: __itt_section_type = 0; +pub const __itt_section_type_itt_section_type_bss: __itt_section_type = 1; +pub const __itt_section_type_itt_section_type_data: __itt_section_type = 2; +pub const __itt_section_type_itt_section_type_text: __itt_section_type = 3; +#[doc = " @cond exclude_from_documentation"] +pub type __itt_section_type = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_section_info { + #[doc = "< Section name in UTF8"] + pub name: *const ::std::os::raw::c_char, + #[doc = "< Section content and semantics description"] + pub type_: __itt_section_type, + #[doc = "< Section bit flags that describe attributes using bit mask"] + #[doc = " Zero if disabled, non-zero if enabled"] + pub flags: usize, + #[doc = "< Section load(relocated) start address"] + pub start_addr: *mut ::std::os::raw::c_void, + #[doc = "< Section file offset"] + pub size: usize, + #[doc = "< Section size"] + pub file_offset: usize, +} +#[test] +fn bindgen_test_layout____itt_section_info() { + assert_eq!( + ::std::mem::size_of::<___itt_section_info>(), + 48usize, + concat!("Size of: ", stringify!(___itt_section_info)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_section_info>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_section_info)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).type_ as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).flags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).start_addr as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(start_addr) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_section_info>())).file_offset as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(___itt_section_info), + "::", + stringify!(file_offset) + ) + ); +} +pub type __itt_section_info = ___itt_section_info; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ___itt_module_object { + #[doc = "< API version"] + pub version: ::std::os::raw::c_uint, + #[doc = "< Unique identifier. This is unchanged for sections that belong to the same module"] + pub module_id: __itt_id, + #[doc = "< Binary module format"] + pub module_type: __itt_module_type, + #[doc = "< Unique module name or path to module in UTF8"] + #[doc = " Contains module name when module_bufer and module_size exist"] + #[doc = " Contains module path when module_bufer and module_size absent"] + #[doc = " module_name remains the same for the certain module_id"] + pub module_name: *const ::std::os::raw::c_char, + #[doc = "< Module buffer content"] + pub module_buffer: *mut ::std::os::raw::c_void, + #[doc = "< Module buffer size */"] + #[doc = " If module_buffer and module_size do not exist,"] + #[doc = " the binary module exists on the system already."] + #[doc = " The module_name parameter contains the path to the module."] + pub module_size: usize, + #[doc = "< Reference to section information"] + pub section_array: *mut __itt_section_info, + pub section_number: usize, +} +#[test] +fn bindgen_test_layout____itt_module_object() { + assert_eq!( + ::std::mem::size_of::<___itt_module_object>(), + 80usize, + concat!("Size of: ", stringify!(___itt_module_object)) + ); + assert_eq!( + ::std::mem::align_of::<___itt_module_object>(), + 8usize, + concat!("Alignment of ", stringify!(___itt_module_object)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_module_object>())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<___itt_module_object>())).module_id as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(module_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).module_type as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(module_type) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).module_name as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(module_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).module_buffer as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(module_buffer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).module_size as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(module_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).section_array as *const _ as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(section_array) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<___itt_module_object>())).section_number as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(___itt_module_object), + "::", + stringify!(section_number) + ) + ); +} +pub type __itt_module_object = ___itt_module_object; +extern "C" { + #[doc = " @brief Load module content and its loaded(relocated) sections."] + #[doc = " This API is useful to save a module, or specify its location on the system and report information about loaded sections."] + #[doc = " The target module is saved on the system if module buffer content and size are available."] + #[doc = " If module buffer content and size are unavailable, the module name contains the path to the existing binary module."] + #[doc = " @param[in] module_obj - provides module and section information, along with unique module identifiers (name,module ID)"] + #[doc = " which bind the binary module to particular sections."] + pub fn __itt_module_load_with_sections(module_obj: *mut __itt_module_object); +} +pub type __itt_module_load_with_sections_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_module_load_with_sections_ptr__3_0: + __itt_module_load_with_sections_ptr__3_0_t; +} +extern "C" { + #[doc = " @brief Unload a module and its loaded(relocated) sections."] + #[doc = " This API notifies that the module and its sections were unloaded."] + #[doc = " @param[in] module_obj - provides module and sections information, along with unique module identifiers (name,module ID)"] + #[doc = " which bind the binary module to particular sections."] + pub fn __itt_module_unload_with_sections(module_obj: *mut __itt_module_object); +} +pub type __itt_module_unload_with_sections_ptr__3_0_t = + ::std::option::Option; +extern "C" { + pub static mut __itt_module_unload_with_sections_ptr__3_0: + __itt_module_unload_with_sections_ptr__3_0_t; +} diff --git a/deps/v8/third_party/ittapi/ittapi-rs/src/jitprofiling_bindings.rs b/deps/v8/third_party/ittapi/ittapi-rs/src/jitprofiling_bindings.rs new file mode 100644 index 00000000000000..3b3bc23f646480 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/src/jitprofiling_bindings.rs @@ -0,0 +1,1002 @@ +/* automatically generated by rust-bindgen */ + +#[doc = "<\\brief Send this to shutdown the agent."] +#[doc = " Use NULL for event data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_SHUTDOWN: iJIT_jvm_event = 2; +#[doc = "<\\brief Send when dynamic code is"] +#[doc = " JIT compiled and loaded into"] +#[doc = " memory by the JIT engine, but"] +#[doc = " before the code is executed."] +#[doc = " Use iJIT_Method_Load as event"] +#[doc = " data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED: iJIT_jvm_event = 13; +#[doc = "<\\brief Send when compiled dynamic"] +#[doc = " code is being unloaded from memory."] +#[doc = " Use iJIT_Method_Load as event data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_UNLOAD_START: iJIT_jvm_event = 14; +#[doc = "<\\brief Send to provide new content for"] +#[doc = " a previously reported dynamic code."] +#[doc = " The previous content will be invalidated"] +#[doc = " starting from the time of the notification."] +#[doc = " Use iJIT_Method_Load as event data but"] +#[doc = " required fields are following:"] +#[doc = " - method_id identify the code to update."] +#[doc = " - method_load_address specify start address"] +#[doc = " within identified code range"] +#[doc = " where update should be started."] +#[doc = " - method_size specify length of updated code"] +#[doc = " range."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_UPDATE: iJIT_jvm_event = 15; +#[doc = "<\\brief Send when an inline dynamic"] +#[doc = " code is JIT compiled and loaded"] +#[doc = " into memory by the JIT engine,"] +#[doc = " but before the parent code region"] +#[doc = " starts executing."] +#[doc = " Use iJIT_Method_Inline_Load as event data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED: iJIT_jvm_event = 16; +#[doc = " @cond exclude_from_documentation"] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_UPDATE_V2: iJIT_jvm_event = 17; +#[doc = "<\\brief Send when a dynamic code is"] +#[doc = " JIT compiled and loaded into"] +#[doc = " memory by the JIT engine, but"] +#[doc = " before the code is executed."] +#[doc = " Use iJIT_Method_Load_V2 as event data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2: iJIT_jvm_event = 21; +#[doc = "<\\brief Send when a dynamic code is"] +#[doc = " JIT compiled and loaded into"] +#[doc = " memory by the JIT engine, but"] +#[doc = " before the code is executed."] +#[doc = " Use iJIT_Method_Load_V3 as event data."] +pub const iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3: iJIT_jvm_event = 22; +#[doc = " @brief Enumerator for the types of notifications"] +pub type iJIT_jvm_event = u32; +pub use self::iJIT_jvm_event as iJIT_JVM_EVENT; +#[doc = "<\\brief The agent is not running;"] +#[doc = " iJIT_NotifyEvent calls will"] +#[doc = " not be processed."] +pub const _iJIT_IsProfilingActiveFlags_iJIT_NOTHING_RUNNING: _iJIT_IsProfilingActiveFlags = 0; +#[doc = "<\\brief The agent is running and"] +#[doc = " ready to process notifications."] +pub const _iJIT_IsProfilingActiveFlags_iJIT_SAMPLING_ON: _iJIT_IsProfilingActiveFlags = 1; +#[doc = " @brief Enumerator for the agent's mode"] +pub type _iJIT_IsProfilingActiveFlags = u32; +pub use self::_iJIT_IsProfilingActiveFlags as iJIT_IsProfilingActiveFlags; +#[doc = " @brief Description of a single entry in the line number information of a code region."] +#[doc = " @details A table of line number entries gives information about how the reported code region"] +#[doc = " is mapped to source file."] +#[doc = " Intel(R) VTune(TM) Amplifier uses line number information to attribute"] +#[doc = " the samples (virtual address) to a line number. \\n"] +#[doc = " It is acceptable to report different code addresses for the same source line:"] +#[doc = " @code"] +#[doc = " Offset LineNumber"] +#[doc = " 1 2"] +#[doc = " 12 4"] +#[doc = " 15 2"] +#[doc = " 18 1"] +#[doc = " 21 30"] +#[doc = ""] +#[doc = " VTune Amplifier constructs the following table using the client data"] +#[doc = ""] +#[doc = " Code subrange Line number"] +#[doc = " 0-1 2"] +#[doc = " 1-12 4"] +#[doc = " 12-15 2"] +#[doc = " 15-18 1"] +#[doc = " 18-21 30"] +#[doc = " @endcode"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LineNumberInfo { + #[doc = "<\\brief Offset from the begining of the code region."] + pub Offset: ::std::os::raw::c_uint, + #[doc = "<\\brief Matching source line number offset (from beginning of source file)."] + pub LineNumber: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout__LineNumberInfo() { + assert_eq!( + ::std::mem::size_of::<_LineNumberInfo>(), + 8usize, + concat!("Size of: ", stringify!(_LineNumberInfo)) + ); + assert_eq!( + ::std::mem::align_of::<_LineNumberInfo>(), + 4usize, + concat!("Alignment of ", stringify!(_LineNumberInfo)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_LineNumberInfo>())).Offset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_LineNumberInfo), + "::", + stringify!(Offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_LineNumberInfo>())).LineNumber as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_LineNumberInfo), + "::", + stringify!(LineNumber) + ) + ); +} +pub type pLineNumberInfo = *mut _LineNumberInfo; +pub type LineNumberInfo = _LineNumberInfo; +#[doc = "<\\brief Native to the process architecture that is calling it."] +pub const _iJIT_CodeArchitecture_iJIT_CA_NATIVE: _iJIT_CodeArchitecture = 0; +#[doc = "<\\brief 32-bit machine code."] +pub const _iJIT_CodeArchitecture_iJIT_CA_32: _iJIT_CodeArchitecture = 1; +#[doc = "<\\brief 64-bit machine code."] +pub const _iJIT_CodeArchitecture_iJIT_CA_64: _iJIT_CodeArchitecture = 2; +#[doc = " @brief Enumerator for the code architecture."] +pub type _iJIT_CodeArchitecture = u32; +pub use self::_iJIT_CodeArchitecture as iJIT_CodeArchitecture; +#[doc = " @brief Description of a JIT-compiled method"] +#[doc = " @details When you use the iJIT_Method_Load structure to describe"] +#[doc = " the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED"] +#[doc = " as an event type to report it."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iJIT_Method_Load { + #[doc = "<\\brief Unique method ID. Cannot be 0."] + #[doc = " You must either use the API function"] + #[doc = " iJIT_GetNewMethodID to get a valid and unique"] + #[doc = " method ID, or else manage ID uniqueness"] + #[doc = " and correct range by yourself.\\n"] + #[doc = " You must use the same method ID for all code"] + #[doc = " regions of the same method, otherwise different"] + #[doc = " method IDs specify different methods."] + pub method_id: ::std::os::raw::c_uint, + #[doc = "<\\brief The name of the method. It can be optionally"] + #[doc = " prefixed with its class name and appended with"] + #[doc = " its complete signature. Can't be NULL."] + pub method_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief The start virtual address of the method code"] + #[doc = " region. If NULL, data provided with"] + #[doc = " event are not accepted."] + pub method_load_address: *mut ::std::os::raw::c_void, + #[doc = "<\\brief The code size of the method in memory."] + #[doc = " If 0, then data provided with the event are not"] + #[doc = " accepted."] + pub method_size: ::std::os::raw::c_uint, + #[doc = "<\\brief The number of entries in the line number"] + #[doc = " table.0 if none."] + pub line_number_size: ::std::os::raw::c_uint, + #[doc = "<\\brief Pointer to the line numbers info"] + #[doc = " array. Can be NULL if"] + #[doc = " line_number_size is 0. See"] + #[doc = " LineNumberInfo Structure for a"] + #[doc = " description of a single entry in"] + #[doc = " the line number info array"] + pub line_number_table: pLineNumberInfo, + #[doc = "<\\brief This field is obsolete."] + pub class_id: ::std::os::raw::c_uint, + #[doc = "<\\brief Class name. Can be NULL."] + pub class_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Source file name. Can be NULL."] + pub source_file_name: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout__iJIT_Method_Load() { + assert_eq!( + ::std::mem::size_of::<_iJIT_Method_Load>(), + 64usize, + concat!("Size of: ", stringify!(_iJIT_Method_Load)) + ); + assert_eq!( + ::std::mem::align_of::<_iJIT_Method_Load>(), + 8usize, + concat!("Alignment of ", stringify!(_iJIT_Method_Load)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load>())).method_id as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(method_id) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load>())).method_name as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(method_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load>())).method_load_address as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(method_load_address) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load>())).method_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(method_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load>())).line_number_size as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(line_number_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load>())).line_number_table as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(line_number_table) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load>())).class_id as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(class_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load>())).class_file_name as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(class_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load>())).source_file_name as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load), + "::", + stringify!(source_file_name) + ) + ); +} +pub type piJIT_Method_Load = *mut _iJIT_Method_Load; +pub type iJIT_Method_Load = _iJIT_Method_Load; +#[doc = " @brief Description of a JIT-compiled method"] +#[doc = " @details When you use the iJIT_Method_Load_V2 structure to describe"] +#[doc = " the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2"] +#[doc = " as an event type to report it."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iJIT_Method_Load_V2 { + #[doc = "<\\brief Unique method ID. Cannot be 0."] + #[doc = " You must either use the API function"] + #[doc = " iJIT_GetNewMethodID to get a valid and unique"] + #[doc = " method ID, or else manage ID uniqueness"] + #[doc = " and correct range by yourself.\\n"] + #[doc = " You must use the same method ID for all code"] + #[doc = " regions of the same method, otherwise different"] + #[doc = " method IDs specify different methods."] + pub method_id: ::std::os::raw::c_uint, + #[doc = "<\\brief The name of the method. It can be optionally"] + #[doc = " prefixed with its class name and appended with"] + #[doc = " its complete signature. Can't be NULL."] + pub method_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief The start virtual address of the method code"] + #[doc = " region. If NULL, then data provided with the"] + #[doc = " event are not accepted."] + pub method_load_address: *mut ::std::os::raw::c_void, + #[doc = "<\\brief The code size of the method in memory."] + #[doc = " If 0, then data provided with the event are not"] + #[doc = " accepted."] + pub method_size: ::std::os::raw::c_uint, + #[doc = "<\\brief The number of entries in the line number"] + #[doc = " table. 0 if none."] + pub line_number_size: ::std::os::raw::c_uint, + #[doc = "<\\brief Pointer to the line numbers info"] + #[doc = " array. Can be NULL if"] + #[doc = " line_number_size is 0. See"] + #[doc = " LineNumberInfo Structure for a"] + #[doc = " description of a single entry in"] + #[doc = " the line number info array."] + pub line_number_table: pLineNumberInfo, + #[doc = "<\\brief Class name. Can be NULL."] + pub class_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Source file name. Can be NULL."] + pub source_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Module name. Can be NULL."] + #[doc = "The module name can be useful for distinguishing among"] + #[doc = "different JIT engines. VTune Amplifier will display"] + #[doc = "reported methods grouped by specific module."] + pub module_name: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout__iJIT_Method_Load_V2() { + assert_eq!( + ::std::mem::size_of::<_iJIT_Method_Load_V2>(), + 64usize, + concat!("Size of: ", stringify!(_iJIT_Method_Load_V2)) + ); + assert_eq!( + ::std::mem::align_of::<_iJIT_Method_Load_V2>(), + 8usize, + concat!("Alignment of ", stringify!(_iJIT_Method_Load_V2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).method_id as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(method_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).method_name as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(method_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).method_load_address as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(method_load_address) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).method_size as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(method_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).line_number_size as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(line_number_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).line_number_table as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(line_number_table) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).class_file_name as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(class_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).source_file_name as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(source_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V2>())).module_name as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V2), + "::", + stringify!(module_name) + ) + ); +} +pub type piJIT_Method_Load_V2 = *mut _iJIT_Method_Load_V2; +pub type iJIT_Method_Load_V2 = _iJIT_Method_Load_V2; +#[doc = " @brief Description of a JIT-compiled method"] +#[doc = " @details The iJIT_Method_Load_V3 structure is the same as iJIT_Method_Load_V2"] +#[doc = " with a newly introduced 'arch' field that specifies architecture of the code region."] +#[doc = " When you use the iJIT_Method_Load_V3 structure to describe"] +#[doc = " the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3"] +#[doc = " as an event type to report it."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iJIT_Method_Load_V3 { + #[doc = "<\\brief Unique method ID. Cannot be 0."] + #[doc = " You must either use the API function"] + #[doc = " iJIT_GetNewMethodID to get a valid and unique"] + #[doc = " method ID, or manage ID uniqueness"] + #[doc = " and correct range by yourself.\\n"] + #[doc = " You must use the same method ID for all code"] + #[doc = " regions of the same method, otherwise they are"] + #[doc = " treated as regions of different methods."] + pub method_id: ::std::os::raw::c_uint, + #[doc = "<\\brief The name of the method. It can be optionally"] + #[doc = " prefixed with its class name and appended with"] + #[doc = " its complete signature. Cannot be NULL."] + pub method_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief The start virtual address of the method code"] + #[doc = " region. If NULL, then data provided with the"] + #[doc = " event are not accepted."] + pub method_load_address: *mut ::std::os::raw::c_void, + #[doc = "<\\brief The code size of the method in memory."] + #[doc = " If 0, then data provided with the event are not"] + #[doc = " accepted."] + pub method_size: ::std::os::raw::c_uint, + #[doc = "<\\brief The number of entries in the line number"] + #[doc = " table. 0 if none."] + pub line_number_size: ::std::os::raw::c_uint, + #[doc = "<\\brief Pointer to the line numbers info"] + #[doc = " array. Can be NULL if"] + #[doc = " line_number_size is 0. See"] + #[doc = " LineNumberInfo Structure for a"] + #[doc = " description of a single entry in"] + #[doc = " the line number info array."] + pub line_number_table: pLineNumberInfo, + #[doc = "<\\brief Class name. Can be NULL."] + pub class_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Source file name. Can be NULL."] + pub source_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Module name. Can be NULL."] + #[doc = " The module name can be useful for distinguishing among"] + #[doc = " different JIT engines. VTune Amplifier will display"] + #[doc = " reported methods grouped by specific module."] + pub module_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Architecture of the method's code region."] + #[doc = " By default, it is the same as the process"] + #[doc = " architecture that is calling it."] + #[doc = " For example, you can use it if your 32-bit JIT"] + #[doc = " engine generates 64-bit code."] + #[doc = ""] + #[doc = " If JIT engine reports both 32-bit and 64-bit types"] + #[doc = " of methods then VTune Amplifier splits the methods"] + #[doc = " with the same module name but with different"] + #[doc = " architectures in two different modules. VTune Amplifier"] + #[doc = " modifies the original name provided with a 64-bit method"] + #[doc = " version by ending it with '(64)'"] + pub module_arch: iJIT_CodeArchitecture, +} +#[test] +fn bindgen_test_layout__iJIT_Method_Load_V3() { + assert_eq!( + ::std::mem::size_of::<_iJIT_Method_Load_V3>(), + 72usize, + concat!("Size of: ", stringify!(_iJIT_Method_Load_V3)) + ); + assert_eq!( + ::std::mem::align_of::<_iJIT_Method_Load_V3>(), + 8usize, + concat!("Alignment of ", stringify!(_iJIT_Method_Load_V3)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).method_id as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(method_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).method_name as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(method_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).method_load_address as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(method_load_address) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).method_size as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(method_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).line_number_size as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(line_number_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).line_number_table as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(line_number_table) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).class_file_name as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(class_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).source_file_name as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(source_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).module_name as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(module_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Load_V3>())).module_arch as *const _ as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Load_V3), + "::", + stringify!(module_arch) + ) + ); +} +pub type piJIT_Method_Load_V3 = *mut _iJIT_Method_Load_V3; +pub type iJIT_Method_Load_V3 = _iJIT_Method_Load_V3; +#[doc = " @brief Description of an inline JIT-compiled method"] +#[doc = " @details When you use the_iJIT_Method_Inline_Load structure to describe"] +#[doc = " the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED"] +#[doc = " as an event type to report it."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iJIT_Method_Inline_Load { + #[doc = "<\\brief Unique method ID. Cannot be 0."] + #[doc = " You must either use the API function"] + #[doc = " iJIT_GetNewMethodID to get a valid and unique"] + #[doc = " method ID, or else manage ID uniqueness"] + #[doc = " and correct range by yourself."] + pub method_id: ::std::os::raw::c_uint, + #[doc = "<\\brief Unique immediate parent's method ID."] + #[doc = " Cannot be 0."] + #[doc = " You must either use the API function"] + #[doc = " iJIT_GetNewMethodID to get a valid and unique"] + #[doc = " method ID, or else manage ID uniqueness"] + #[doc = " and correct range by yourself."] + pub parent_method_id: ::std::os::raw::c_uint, + #[doc = "<\\brief The name of the method. It can be optionally"] + #[doc = " prefixed with its class name and appended with"] + #[doc = " its complete signature. Can't be NULL."] + pub method_name: *mut ::std::os::raw::c_char, + pub method_load_address: *mut ::std::os::raw::c_void, + #[doc = "<\\brief The code size of the method in memory."] + #[doc = " If 0, then data provided with the event are not"] + #[doc = " accepted."] + pub method_size: ::std::os::raw::c_uint, + #[doc = "<\\brief The number of entries in the line number"] + #[doc = " table. 0 if none."] + pub line_number_size: ::std::os::raw::c_uint, + #[doc = "<\\brief Pointer to the line numbers info"] + #[doc = " array. Can be NULL if"] + #[doc = " line_number_size is 0. See"] + #[doc = " LineNumberInfo Structure for a"] + #[doc = " description of a single entry in"] + #[doc = " the line number info array"] + pub line_number_table: pLineNumberInfo, + #[doc = "<\\brief Class name. Can be NULL."] + pub class_file_name: *mut ::std::os::raw::c_char, + #[doc = "<\\brief Source file name. Can be NULL."] + pub source_file_name: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout__iJIT_Method_Inline_Load() { + assert_eq!( + ::std::mem::size_of::<_iJIT_Method_Inline_Load>(), + 56usize, + concat!("Size of: ", stringify!(_iJIT_Method_Inline_Load)) + ); + assert_eq!( + ::std::mem::align_of::<_iJIT_Method_Inline_Load>(), + 8usize, + concat!("Alignment of ", stringify!(_iJIT_Method_Inline_Load)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).method_id as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(method_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).parent_method_id as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(parent_method_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).method_name as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(method_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).method_load_address as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(method_load_address) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).method_size as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(method_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).line_number_size as *const _ + as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(line_number_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).line_number_table as *const _ + as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(line_number_table) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).class_file_name as *const _ + as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(class_file_name) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Inline_Load>())).source_file_name as *const _ + as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Inline_Load), + "::", + stringify!(source_file_name) + ) + ); +} +pub type piJIT_Method_Inline_Load = *mut _iJIT_Method_Inline_Load; +pub type iJIT_Method_Inline_Load = _iJIT_Method_Inline_Load; +pub const _iJIT_SegmentType_iJIT_CT_UNKNOWN: _iJIT_SegmentType = 0; +#[doc = "<\\brief Executable code."] +pub const _iJIT_SegmentType_iJIT_CT_CODE: _iJIT_SegmentType = 1; +#[doc = "<\\brief Data (not executable code)."] +#[doc = " VTune Amplifier uses the format string"] +#[doc = " (see iJIT_Method_Update) to represent"] +#[doc = " this data in the VTune Amplifier GUI"] +pub const _iJIT_SegmentType_iJIT_CT_DATA: _iJIT_SegmentType = 2; +#[doc = "<\\brief Use the previous markup for the trace."] +#[doc = " Can be used for the following"] +#[doc = " iJVM_EVENT_TYPE_METHOD_UPDATE_V2 events,"] +#[doc = " if the type of the previously reported segment"] +#[doc = " type is the same."] +pub const _iJIT_SegmentType_iJIT_CT_KEEP: _iJIT_SegmentType = 3; +pub const _iJIT_SegmentType_iJIT_CT_EOF: _iJIT_SegmentType = 4; +#[doc = " @cond exclude_from_documentation */"] +#[doc = " @brief Description of a segment type"] +#[doc = " @details Use the segment type to specify a type of data supplied"] +#[doc = " with the iJVM_EVENT_TYPE_METHOD_UPDATE_V2 event to be applied to"] +#[doc = " a certain code trace."] +pub type _iJIT_SegmentType = u32; +pub use self::_iJIT_SegmentType as iJIT_SegmentType; +#[doc = " @brief Description of a dynamic update of the content within JIT-compiled method"] +#[doc = " @details The JIT engine may generate the methods that are updated at runtime"] +#[doc = " partially by mixed (data + executable code) content. When you use the iJIT_Method_Update"] +#[doc = " structure to describe the update of the content within a JIT-compiled method,"] +#[doc = " use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it."] +#[doc = ""] +#[doc = " On the first Update event, VTune Amplifier copies the original code range reported by"] +#[doc = " the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and"] +#[doc = " adds the modified range to the original method. For next update events, VTune Amplifier"] +#[doc = " does the same but it uses the latest modified version of a code region for update."] +#[doc = " Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by"] +#[doc = " the iJVM_EVENT_TYPE_METHOD_LOAD event."] +#[doc = " Notes:"] +#[doc = " - Multiple update events with different types for the same trace are allowed"] +#[doc = " but they must be reported for the same code ranges."] +#[doc = " Example,"] +#[doc = " @code"] +#[doc = " [-- data---] Allowed"] +#[doc = " [-- code --] Allowed"] +#[doc = " [code] Ignored"] +#[doc = " [-- data---] Allowed"] +#[doc = " [-- code --] Allowed"] +#[doc = " [------------ trace ---------]"] +#[doc = " @endcode"] +#[doc = " - The types of previously reported events can be changed but they must be reported"] +#[doc = " for the same code ranges."] +#[doc = " Example,"] +#[doc = " @code"] +#[doc = " [-- data---] Allowed"] +#[doc = " [-- code --] Allowed"] +#[doc = " [-- data---] Allowed"] +#[doc = " [-- code --] Allowed"] +#[doc = " [------------ trace ---------]"] +#[doc = " @endcode"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iJIT_Method_Update { + #[doc = "<\\brief Start address of the update within a method"] + pub load_address: *mut ::std::os::raw::c_void, + #[doc = "<\\brief The update size"] + pub size: ::std::os::raw::c_uint, + #[doc = "<\\brief Type of the update"] + pub type_: iJIT_SegmentType, + #[doc = "<\\brief C string that contains a format string"] + #[doc = " that follows the same specifications as format in printf."] + #[doc = " The format string is used for iJIT_CT_CODE only"] + #[doc = " and cannot be NULL."] + #[doc = " Format can be changed on the fly."] + pub data_format: *const ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout__iJIT_Method_Update() { + assert_eq!( + ::std::mem::size_of::<_iJIT_Method_Update>(), + 24usize, + concat!("Size of: ", stringify!(_iJIT_Method_Update)) + ); + assert_eq!( + ::std::mem::align_of::<_iJIT_Method_Update>(), + 8usize, + concat!("Alignment of ", stringify!(_iJIT_Method_Update)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_iJIT_Method_Update>())).load_address as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Update), + "::", + stringify!(load_address) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Update>())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Update), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Update>())).type_ as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Update), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iJIT_Method_Update>())).data_format as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iJIT_Method_Update), + "::", + stringify!(data_format) + ) + ); +} +pub type piJIT_Method_Update = *mut _iJIT_Method_Update; +pub type iJIT_Method_Update = _iJIT_Method_Update; +extern "C" { + #[doc = " @brief Generates a new unique method ID."] + #[doc = ""] + #[doc = " You must use this API to obtain unique and valid method IDs for methods or"] + #[doc = " traces reported to the agent if you don't have your own mechanism to generate"] + #[doc = " unique method IDs."] + #[doc = ""] + #[doc = " @return a new unique method ID. When out of unique method IDs, this API"] + #[doc = " returns 0, which is not an accepted value."] + pub fn iJIT_GetNewMethodID() -> ::std::os::raw::c_uint; +} +extern "C" { + #[doc = " @brief Returns the current mode of the agent."] + #[doc = ""] + #[doc = " @return iJIT_SAMPLING_ON, indicating that agent is running, or"] + #[doc = " iJIT_NOTHING_RUNNING if no agent is running."] + pub fn iJIT_IsProfilingActive() -> iJIT_IsProfilingActiveFlags; +} +extern "C" { + #[doc = " @brief Reports infomation about JIT-compiled code to the agent."] + #[doc = ""] + #[doc = " The reported information is used to attribute samples obtained from any"] + #[doc = " Intel(R) VTune(TM) Amplifier collector. This API needs to be called"] + #[doc = " after JIT compilation and before the first entry into the JIT-compiled"] + #[doc = " code."] + #[doc = ""] + #[doc = " @param[in] event_type - type of the data sent to the agent"] + #[doc = " @param[in] EventSpecificData - pointer to event-specific data"] + #[doc = ""] + #[doc = " @returns 1 on success, otherwise 0."] + pub fn iJIT_NotifyEvent( + event_type: iJIT_JVM_EVENT, + EventSpecificData: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} diff --git a/deps/v8/third_party/ittapi/ittapi-rs/src/lib.rs b/deps/v8/third_party/ittapi/ittapi-rs/src/lib.rs new file mode 100644 index 00000000000000..0ce85516a54ce2 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/src/lib.rs @@ -0,0 +1,4 @@ +#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow(unused)] +include!("ittnotify_bindings.rs"); +include!("jitprofiling_bindings.rs"); diff --git a/deps/v8/third_party/ittapi/ittapi-rs/tests/bindgen-up-to-date.rs b/deps/v8/third_party/ittapi/ittapi-rs/tests/bindgen-up-to-date.rs new file mode 100644 index 00000000000000..d3eb75da715dd7 --- /dev/null +++ b/deps/v8/third_party/ittapi/ittapi-rs/tests/bindgen-up-to-date.rs @@ -0,0 +1,68 @@ +// This is a smoke test for pre-generated `src/ittapi-bindings.rs` and +// `src/jitprofiling-bindings.rs` files to see that they don't need to be +// updated. We check in a generated version so downstream consumers don't +// have to get `bindgen` working themselves. +// +// If bindgen or ittapi.h or jitprofiling.h change you can run tests with +// `BLESS=1` (inpired by a similiar pach for binaryen) to regenerate the +// source files, otherwise this can test on CI that the file doesn't need +// to be regenerated. + +#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow(unused)] + +#[test] +fn test_ittnotify_bindings_up_to_date() { + let expected = bindgen::Builder::default() + .rustfmt_bindings(true) + .header("./include/ittnotify.h") + .generate() + .expect("Unable to generate ittnotify bindings.") + .to_string(); + + if std::env::var("BLESS").is_ok() { + std::fs::write("src/ittnotify_bindings.rs", expected).unwrap(); + } else { + let actual = include_str!("../src/ittnotify_bindings.rs"); + if expected == actual { + return; + } + + for diff in diff::lines(&expected, &actual) { + match diff { + diff::Result::Both(_, s) => println!(" {}", s), + diff::Result::Left(s) => println!("-{}", s), + diff::Result::Right(s) => println!("+{}", s), + } + } + panic!("differences found, need to regenerate ittnotify bindings"); + } +} + +#[test] +fn test_jitprofiling_bindings_up_to_date() { + let expected = bindgen::Builder::default() + .rustfmt_bindings(true) + .header("./include/jitprofiling.h") + .generate() + .expect("Unable to generate jitprofiling bindings") + .to_string(); + + if std::env::var("BLESS").is_ok() { + std::fs::write("src/jitprofiling_bindings.rs", expected).unwrap(); + } else { + let actual = include_str!("../src/jitprofiling_bindings.rs"); + if expected == actual { + return; + } + + for diff in diff::lines(&expected, &actual) { + match diff { + diff::Result::Both(_, s) => println!(" {}", s), + diff::Result::Left(s) => println!("-{}", s), + diff::Result::Right(s) => println!("+{}", s), + } + } + panic!("differences found, need to regenerate jitprofiling bindings"); + } +} diff --git a/deps/v8/third_party/ittapi/src/ittnotify/disable_warnings.h b/deps/v8/third_party/ittapi/src/ittnotify/disable_warnings.h new file mode 100644 index 00000000000000..4ebdd77e446344 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/disable_warnings.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#include "ittnotify_config.h" + +#if ITT_PLATFORM==ITT_PLATFORM_WIN + +#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */ +#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */ +#pragma warning (disable: 174) /* expression has no effect */ +#pragma warning (disable: 4127) /* conditional expression is constant */ +#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */ + +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if defined __INTEL_COMPILER + +#pragma warning (disable: 869) /* parameter "XXXXX" was never referenced */ +#pragma warning (disable: 1418) /* external function definition with no prior declaration */ +#pragma warning (disable: 1419) /* external declaration in primary source file */ + +#endif /* __INTEL_COMPILER */ diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_config.h b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_config.h new file mode 100644 index 00000000000000..cb289f79eb25b4 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_config.h @@ -0,0 +1,585 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ +#ifndef _ITTNOTIFY_CONFIG_H_ +#define _ITTNOTIFY_CONFIG_H_ + +/** @cond exclude_from_documentation */ +#ifndef ITT_OS_WIN +# define ITT_OS_WIN 1 +#endif /* ITT_OS_WIN */ + +#ifndef ITT_OS_LINUX +# define ITT_OS_LINUX 2 +#endif /* ITT_OS_LINUX */ + +#ifndef ITT_OS_MAC +# define ITT_OS_MAC 3 +#endif /* ITT_OS_MAC */ + +#ifndef ITT_OS_FREEBSD +# define ITT_OS_FREEBSD 4 +#endif /* ITT_OS_FREEBSD */ + +#ifndef ITT_OS +# if defined WIN32 || defined _WIN32 +# define ITT_OS ITT_OS_WIN +# elif defined( __APPLE__ ) && defined( __MACH__ ) +# define ITT_OS ITT_OS_MAC +# elif defined( __FreeBSD__ ) +# define ITT_OS ITT_OS_FREEBSD +# else +# define ITT_OS ITT_OS_LINUX +# endif +#endif /* ITT_OS */ + +#ifndef ITT_PLATFORM_WIN +# define ITT_PLATFORM_WIN 1 +#endif /* ITT_PLATFORM_WIN */ + +#ifndef ITT_PLATFORM_POSIX +# define ITT_PLATFORM_POSIX 2 +#endif /* ITT_PLATFORM_POSIX */ + +#ifndef ITT_PLATFORM_MAC +# define ITT_PLATFORM_MAC 3 +#endif /* ITT_PLATFORM_MAC */ + +#ifndef ITT_PLATFORM_FREEBSD +# define ITT_PLATFORM_FREEBSD 4 +#endif /* ITT_PLATFORM_FREEBSD */ + +#ifndef ITT_PLATFORM +# if ITT_OS==ITT_OS_WIN +# define ITT_PLATFORM ITT_PLATFORM_WIN +# elif ITT_OS==ITT_OS_MAC +# define ITT_PLATFORM ITT_PLATFORM_MAC +# elif ITT_OS==ITT_OS_FREEBSD +# define ITT_PLATFORM ITT_PLATFORM_FREEBSD +# else +# define ITT_PLATFORM ITT_PLATFORM_POSIX +# endif +#endif /* ITT_PLATFORM */ + +#if defined(_UNICODE) && !defined(UNICODE) +#define UNICODE +#endif + +#include +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#include +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#include +#if defined(UNICODE) || defined(_UNICODE) +#include +#endif /* UNICODE || _UNICODE */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#ifndef ITTAPI_CDECL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define ITTAPI_CDECL __cdecl +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define ITTAPI_CDECL __attribute__ ((cdecl)) +# else /* _M_IX86 || __i386__ */ +# define ITTAPI_CDECL /* actual only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* ITTAPI_CDECL */ + +#ifndef STDCALL +# if ITT_PLATFORM==ITT_PLATFORM_WIN +# define STDCALL __stdcall +# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +# if defined _M_IX86 || defined __i386__ +# define STDCALL __attribute__ ((stdcall)) +# else /* _M_IX86 || __i386__ */ +# define STDCALL /* supported only on x86 platform */ +# endif /* _M_IX86 || __i386__ */ +# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* STDCALL */ + +#define ITTAPI ITTAPI_CDECL +#define LIBITTAPI ITTAPI_CDECL + +/* TODO: Temporary for compatibility! */ +#define ITTAPI_CALL ITTAPI_CDECL +#define LIBITTAPI_CALL ITTAPI_CDECL + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +/* use __forceinline (VC++ specific) */ +#if defined(__MINGW32__) && !defined(__cplusplus) +#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#else +#define ITT_INLINE static __forceinline +#endif /* __MINGW32__ */ + +#define ITT_INLINE_ATTRIBUTE /* nothing */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/* + * Generally, functions are not inlined unless optimization is specified. + * For functions declared inline, this attribute inlines the function even + * if no optimization level was specified. + */ +#ifdef __STRICT_ANSI__ +#define ITT_INLINE static +#define ITT_INLINE_ATTRIBUTE __attribute__((unused)) +#else /* __STRICT_ANSI__ */ +#define ITT_INLINE static inline +#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) +#endif /* __STRICT_ANSI__ */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +/** @endcond */ + +#ifndef ITT_ARCH_IA32 +# define ITT_ARCH_IA32 1 +#endif /* ITT_ARCH_IA32 */ + +#ifndef ITT_ARCH_IA32E +# define ITT_ARCH_IA32E 2 +#endif /* ITT_ARCH_IA32E */ + +#ifndef ITT_ARCH_ARM +# define ITT_ARCH_ARM 4 +#endif /* ITT_ARCH_ARM */ + +#ifndef ITT_ARCH_PPC64 +# define ITT_ARCH_PPC64 5 +#endif /* ITT_ARCH_PPC64 */ + +#ifndef ITT_ARCH_ARM64 +# define ITT_ARCH_ARM64 6 +#endif /* ITT_ARCH_ARM64 */ + +#ifndef ITT_ARCH +# if defined _M_IX86 || defined __i386__ +# define ITT_ARCH ITT_ARCH_IA32 +# elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__ +# define ITT_ARCH ITT_ARCH_IA32E +# elif defined _M_IA64 || defined __ia64__ +# define ITT_ARCH ITT_ARCH_IA64 +# elif defined _M_ARM || defined __arm__ +# define ITT_ARCH ITT_ARCH_ARM +# elif defined __aarch64__ +# define ITT_ARCH ITT_ARCH_ARM64 +# elif defined __powerpc64__ +# define ITT_ARCH ITT_ARCH_PPC64 +# endif +#endif + +#ifdef __cplusplus +# define ITT_EXTERN_C extern "C" +# define ITT_EXTERN_C_BEGIN extern "C" { +# define ITT_EXTERN_C_END } +#else +# define ITT_EXTERN_C /* nothing */ +# define ITT_EXTERN_C_BEGIN /* nothing */ +# define ITT_EXTERN_C_END /* nothing */ +#endif /* __cplusplus */ + +#define ITT_TO_STR_AUX(x) #x +#define ITT_TO_STR(x) ITT_TO_STR_AUX(x) + +#define __ITT_BUILD_ASSERT(expr, suffix) do { \ + static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \ + __itt_build_check_##suffix[0] = 0; \ +} while(0) +#define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix) +#define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__) + +#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 } + +/* Replace with snapshot date YYYYMMDD for promotion build. */ +#define API_VERSION_BUILD 20180723 + +#ifndef API_VERSION_NUM +#define API_VERSION_NUM 3.18.13 +#endif /* API_VERSION_NUM */ + +#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \ + " (" ITT_TO_STR(API_VERSION_BUILD) ")" + +/* OS communication functions */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#include +typedef HMODULE lib_t; +typedef DWORD TIDT; +typedef CRITICAL_SECTION mutex_t; +#define MUTEX_INITIALIZER { 0 } +#define strong_alias(name, aliasname) /* empty for Windows */ +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#include +#if defined(UNICODE) || defined(_UNICODE) +#include +#endif /* UNICODE */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 /* need for PTHREAD_MUTEX_RECURSIVE */ +#endif /* _GNU_SOURCE */ +#ifndef __USE_UNIX98 +#define __USE_UNIX98 1 /* need for PTHREAD_MUTEX_RECURSIVE, on SLES11.1 with gcc 4.3.4 wherein pthread.h missing dependency on __USE_XOPEN2K8 */ +#endif /*__USE_UNIX98*/ +#include +typedef void* lib_t; +typedef pthread_t TIDT; +typedef pthread_mutex_t mutex_t; +#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#define _strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))); +#define strong_alias(name, aliasname) _strong_alias(name, aliasname) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define __itt_get_proc(lib, name) GetProcAddress(lib, name) +#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex) +#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex) +#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex) +#define __itt_load_lib(name) LoadLibraryA(name) +#define __itt_unload_lib(handle) FreeLibrary(handle) +#define __itt_system_error() (int)GetLastError() +#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2) +#define __itt_fstrnlen(s, l) strnlen_s(s, l) +#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l) +#define __itt_fstrdup(s) _strdup(s) +#define __itt_thread_id() GetCurrentThreadId() +#define __itt_thread_yield() SwitchToThread() +#ifndef ITT_SIMPLE_INIT +ITT_INLINE long +__itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE; +ITT_INLINE long __itt_interlocked_increment(volatile long* ptr) +{ + return InterlockedIncrement(ptr); +} +#endif /* ITT_SIMPLE_INIT */ + +#define DL_SYMBOLS (1) +#define PTHREAD_SYMBOLS (1) + +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +#define __itt_get_proc(lib, name) dlsym(lib, name) +#define __itt_mutex_init(mutex) {\ + pthread_mutexattr_t mutex_attr; \ + int error_code = pthread_mutexattr_init(&mutex_attr); \ + if (error_code) \ + __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \ + error_code); \ + error_code = pthread_mutexattr_settype(&mutex_attr, \ + PTHREAD_MUTEX_RECURSIVE); \ + if (error_code) \ + __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \ + error_code); \ + error_code = pthread_mutex_init(mutex, &mutex_attr); \ + if (error_code) \ + __itt_report_error(__itt_error_system, "pthread_mutex_init", \ + error_code); \ + error_code = pthread_mutexattr_destroy(&mutex_attr); \ + if (error_code) \ + __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \ + error_code); \ +} +#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex) +#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex) +#define __itt_load_lib(name) dlopen(name, RTLD_LAZY) +#define __itt_unload_lib(handle) dlclose(handle) +#define __itt_system_error() errno +#define __itt_fstrcmp(s1, s2) strcmp(s1, s2) + +/* makes customer code define safe APIs for SDL_STRNLEN_S and SDL_STRNCPY_S */ +#ifdef SDL_STRNLEN_S +#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l) +#else +#define __itt_fstrnlen(s, l) strlen(s) +#endif /* SDL_STRNLEN_S */ +#ifdef SDL_STRNCPY_S +#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l) +#else +#define __itt_fstrcpyn(s1, b, s2, l) { \ + if (b > 0) { \ + /* 'volatile' is used to suppress the warning that a destination */ \ + /* bound depends on the length of the source. */ \ + volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \ + (size_t)(b - 1) : (size_t)(l); \ + strncpy(s1, s2, num_to_copy); \ + s1[num_to_copy] = 0; \ + } \ +} +#endif /* SDL_STRNCPY_S */ + +#define __itt_fstrdup(s) strdup(s) +#define __itt_thread_id() pthread_self() +#define __itt_thread_yield() sched_yield() +#if ITT_ARCH==ITT_ARCH_IA64 +#ifdef __INTEL_COMPILER +#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val) +#else /* __INTEL_COMPILER */ +/* TODO: Add Support for not Intel compilers for IA-64 architecture */ +#endif /* __INTEL_COMPILER */ +#elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E /* ITT_ARCH!=ITT_ARCH_IA64 */ +ITT_INLINE long +__TBB_machine_fetchadd4(volatile void* ptr, long addend) ITT_INLINE_ATTRIBUTE; +ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend) +{ + long result; + __asm__ __volatile__("lock\nxadd %0,%1" + : "=r"(result),"=m"(*(volatile int*)ptr) + : "0"(addend), "m"(*(volatile int*)ptr) + : "memory"); + return result; +} +#else +#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val) +#endif /* ITT_ARCH==ITT_ARCH_IA64 */ +#ifndef ITT_SIMPLE_INIT +ITT_INLINE long +__itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE; +ITT_INLINE long __itt_interlocked_increment(volatile long* ptr) +{ + return __TBB_machine_fetchadd4(ptr, 1) + 1L; +} +#endif /* ITT_SIMPLE_INIT */ + +void* dlopen(const char*, int) __attribute__((weak)); +void* dlsym(void*, const char*) __attribute__((weak)); +int dlclose(void*) __attribute__((weak)); +#define DL_SYMBOLS (dlopen && dlsym && dlclose) + +int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __attribute__((weak)); +int pthread_mutex_lock(pthread_mutex_t*) __attribute__((weak)); +int pthread_mutex_unlock(pthread_mutex_t*) __attribute__((weak)); +int pthread_mutex_destroy(pthread_mutex_t*) __attribute__((weak)); +int pthread_mutexattr_init(pthread_mutexattr_t*) __attribute__((weak)); +int pthread_mutexattr_settype(pthread_mutexattr_t*, int) __attribute__((weak)); +int pthread_mutexattr_destroy(pthread_mutexattr_t*) __attribute__((weak)); +pthread_t pthread_self(void) __attribute__((weak)); +#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self) + +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +typedef enum { + __itt_collection_normal = 0, + __itt_collection_paused = 1 +} __itt_collection_state; + +typedef enum { + __itt_thread_normal = 0, + __itt_thread_ignored = 1 +} __itt_thread_state; + +#pragma pack(push, 8) + +typedef struct ___itt_thread_info +{ + const char* nameA; /*!< Copy of original name in ASCII. */ +#if defined(UNICODE) || defined(_UNICODE) + const wchar_t* nameW; /*!< Copy of original name in UNICODE. */ +#else /* UNICODE || _UNICODE */ + void* nameW; +#endif /* UNICODE || _UNICODE */ + TIDT tid; + __itt_thread_state state; /*!< Thread state (paused or normal) */ + int extra1; /*!< Reserved to the runtime */ + void* extra2; /*!< Reserved to the runtime */ + struct ___itt_thread_info* next; +} __itt_thread_info; + +#include "ittnotify_types.h" /* For __itt_group_id definition */ + +typedef struct ___itt_api_info_20101001 +{ + const char* name; + void** func_ptr; + void* init_func; + __itt_group_id group; +} __itt_api_info_20101001; + +typedef struct ___itt_api_info +{ + const char* name; + void** func_ptr; + void* init_func; + void* null_func; + __itt_group_id group; +} __itt_api_info; + +typedef struct __itt_counter_info +{ + const char* nameA; /*!< Copy of original name in ASCII. */ +#if defined(UNICODE) || defined(_UNICODE) + const wchar_t* nameW; /*!< Copy of original name in UNICODE. */ +#else /* UNICODE || _UNICODE */ + void* nameW; +#endif /* UNICODE || _UNICODE */ + const char* domainA; /*!< Copy of original name in ASCII. */ +#if defined(UNICODE) || defined(_UNICODE) + const wchar_t* domainW; /*!< Copy of original name in UNICODE. */ +#else /* UNICODE || _UNICODE */ + void* domainW; +#endif /* UNICODE || _UNICODE */ + int type; + long index; + int extra1; /*!< Reserved to the runtime */ + void* extra2; /*!< Reserved to the runtime */ + struct __itt_counter_info* next; +} __itt_counter_info_t; + +struct ___itt_domain; +struct ___itt_string_handle; + +typedef struct ___itt_global +{ + unsigned char magic[8]; + unsigned long version_major; + unsigned long version_minor; + unsigned long version_build; + volatile long api_initialized; + volatile long mutex_initialized; + volatile long atomic_counter; + mutex_t mutex; + lib_t lib; + void* error_handler; + const char** dll_path_ptr; + __itt_api_info* api_list_ptr; + struct ___itt_global* next; + /* Joinable structures below */ + __itt_thread_info* thread_list; + struct ___itt_domain* domain_list; + struct ___itt_string_handle* string_list; + __itt_collection_state state; + __itt_counter_info_t* counter_list; + unsigned int ipt_collect_events; +} __itt_global; + +#pragma pack(pop) + +#define NEW_THREAD_INFO_W(gptr,h,h_tail,t,s,n) { \ + h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ + if (h != NULL) { \ + h->tid = t; \ + h->nameA = NULL; \ + h->nameW = n ? _wcsdup(n) : NULL; \ + h->state = s; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->thread_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_THREAD_INFO_A(gptr,h,h_tail,t,s,n) { \ + h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ + if (h != NULL) { \ + h->tid = t; \ + h->nameA = n ? __itt_fstrdup(n) : NULL; \ + h->nameW = NULL; \ + h->state = s; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->thread_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_DOMAIN_W(gptr,h,h_tail,name) { \ + h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ + if (h != NULL) { \ + h->flags = 1; /* domain is enabled by default */ \ + h->nameA = NULL; \ + h->nameW = name ? _wcsdup(name) : NULL; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->domain_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_DOMAIN_A(gptr,h,h_tail,name) { \ + h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ + if (h != NULL) { \ + h->flags = 1; /* domain is enabled by default */ \ + h->nameA = name ? __itt_fstrdup(name) : NULL; \ + h->nameW = NULL; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->domain_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_STRING_HANDLE_W(gptr,h,h_tail,name) { \ + h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ + if (h != NULL) { \ + h->strA = NULL; \ + h->strW = name ? _wcsdup(name) : NULL; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->string_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \ + h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ + if (h != NULL) { \ + h->strA = name ? __itt_fstrdup(name) : NULL; \ + h->strW = NULL; \ + h->extra1 = 0; /* reserved */ \ + h->extra2 = NULL; /* reserved */ \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->string_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_COUNTER_W(gptr,h,h_tail,name,domain,type) { \ + h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \ + if (h != NULL) { \ + h->nameA = NULL; \ + h->nameW = name ? _wcsdup(name) : NULL; \ + h->domainA = NULL; \ + h->domainW = name ? _wcsdup(domain) : NULL; \ + h->type = type; \ + h->index = 0; \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->counter_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \ + h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \ + if (h != NULL) { \ + h->nameA = name ? __itt_fstrdup(name) : NULL; \ + h->nameW = NULL; \ + h->domainA = domain ? __itt_fstrdup(domain) : NULL; \ + h->domainW = NULL; \ + h->type = type; \ + h->index = 0; \ + h->next = NULL; \ + if (h_tail == NULL) \ + (gptr)->counter_list = h; \ + else \ + h_tail->next = h; \ + } \ +} + +#endif /* _ITTNOTIFY_CONFIG_H_ */ diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.c b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.c new file mode 100644 index 00000000000000..7ada72af62793b --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.c @@ -0,0 +1,1359 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#include "ittnotify_config.h" + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#if !defined(PATH_MAX) +#define PATH_MAX 512 +#endif +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +#include +#include +#include +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#include +#include +#include +#include + +#define INTEL_NO_MACRO_BODY +#define INTEL_ITTNOTIFY_API_PRIVATE +#include "ittnotify.h" +#include "legacy/ittnotify.h" + +#include "disable_warnings.h" + +static const char api_version[] = API_VERSION "\0\n@(#) $Revision$\n"; + +#define _N_(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n) + +#ifndef HAS_CPP_ATTR +#if defined(__cplusplus) && defined(__has_cpp_attribute) +#define HAS_CPP_ATTR(X) __has_cpp_attribute(X) +#else +#define HAS_CPP_ATTR(X) 0 +#endif +#endif + +#ifndef HAS_C_ATTR +#if defined(__STDC__) && defined(__has_c_attribute) +#define HAS_C_ATTR(X) __has_c_attribute(X) +#else +#define HAS_C_ATTR(X) 0 +#endif +#endif + +#ifndef HAS_GNU_ATTR +#if defined(__has_attribute) +#define HAS_GNU_ATTR(X) __has_attribute(X) +#else +#define HAS_GNU_ATTR(X) 0 +#endif +#endif + +#ifndef ITT_ATTRIBUTE_FALLTHROUGH +#if HAS_CPP_ATTR(fallthrough) || HAS_C_ATTR(fallthrough) +#define ITT_ATTRIBUTE_FALLTHROUGH [[fallthrough]] +#elif HAS_CPP_ATTR(gnu::fallthrough) +#define ITT_ATTRIBUTE_FALLTHROUGH [[gnu::fallthrough]] +#elif HAS_CPP_ATTR(clang::fallthrough) +#define ITT_ATTRIBUTE_FALLTHROUGH [[clang::fallthrough]] +#elif HAS_GNU_ATTR(fallthrough) +#define ITT_ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough)) +#else +#define ITT_ATTRIBUTE_FALLTHROUGH +#endif +#endif + +#if ITT_OS==ITT_OS_WIN +static const char* ittnotify_lib_name = "libittnotify.dll"; +#elif ITT_OS==ITT_OS_LINUX || ITT_OS==ITT_OS_FREEBSD +static const char* ittnotify_lib_name = "libittnotify.so"; +#elif ITT_OS==ITT_OS_MAC +static const char* ittnotify_lib_name = "libittnotify.dylib"; +#else +#error Unsupported or unknown OS. +#endif + +#ifdef __ANDROID__ +#include +#include +#include +#include +#include +#include +#include + +#ifdef ITT_ANDROID_LOG + #define ITT_ANDROID_LOG_TAG "INTEL_VTUNE_USERAPI" + #define ITT_ANDROID_LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, ITT_ANDROID_LOG_TAG, __VA_ARGS__)) + #define ITT_ANDROID_LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, ITT_ANDROID_LOG_TAG, __VA_ARGS__)) + #define ITT_ANDROID_LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR,ITT_ANDROID_LOG_TAG, __VA_ARGS__)) + #define ITT_ANDROID_LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG,ITT_ANDROID_LOG_TAG, __VA_ARGS__)) +#else + #define ITT_ANDROID_LOGI(...) + #define ITT_ANDROID_LOGW(...) + #define ITT_ANDROID_LOGE(...) + #define ITT_ANDROID_LOGD(...) +#endif + +/* default location of userapi collector on Android */ +#define ANDROID_ITTNOTIFY_DEFAULT_PATH_MASK(x) "/data/data/com.intel.vtune/perfrun/lib" \ + #x "/runtime/libittnotify.so" + +#if ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_ARM +#define ANDROID_ITTNOTIFY_DEFAULT_PATH ANDROID_ITTNOTIFY_DEFAULT_PATH_MASK(32) +#else +#define ANDROID_ITTNOTIFY_DEFAULT_PATH ANDROID_ITTNOTIFY_DEFAULT_PATH_MASK(64) +#endif + +#endif + + +#ifndef LIB_VAR_NAME +#if ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_ARM +#define LIB_VAR_NAME INTEL_LIBITTNOTIFY32 +#else +#define LIB_VAR_NAME INTEL_LIBITTNOTIFY64 +#endif +#endif /* LIB_VAR_NAME */ + +#define ITT_MUTEX_INIT_AND_LOCK(p) { \ + if (PTHREAD_SYMBOLS) \ + { \ + if (!p.mutex_initialized) \ + { \ + if (__itt_interlocked_increment(&p.atomic_counter) == 1) \ + { \ + __itt_mutex_init(&p.mutex); \ + p.mutex_initialized = 1; \ + } \ + else \ + while (!p.mutex_initialized) \ + __itt_thread_yield(); \ + } \ + __itt_mutex_lock(&p.mutex); \ + } \ +} + +#define ITT_MODULE_OBJECT_VERSION 1 + +typedef int (__itt_init_ittlib_t)(const char*, __itt_group_id); + +/* this define used to control initialization function name. */ +#ifndef __itt_init_ittlib_name +ITT_EXTERN_C int _N_(init_ittlib)(const char*, __itt_group_id); +static __itt_init_ittlib_t* __itt_init_ittlib_ptr = _N_(init_ittlib); +#define __itt_init_ittlib_name __itt_init_ittlib_ptr +#endif /* __itt_init_ittlib_name */ + +typedef void (__itt_fini_ittlib_t)(void); + +/* this define used to control finalization function name. */ +#ifndef __itt_fini_ittlib_name +ITT_EXTERN_C void _N_(fini_ittlib)(void); +static __itt_fini_ittlib_t* __itt_fini_ittlib_ptr = _N_(fini_ittlib); +#define __itt_fini_ittlib_name __itt_fini_ittlib_ptr +#endif /* __itt_fini_ittlib_name */ + +extern __itt_global _N_(_ittapi_global); + +/* building pointers to imported funcs */ +#undef ITT_STUBV +#undef ITT_STUB +#define ITT_STUB(api,type,name,args,params,ptr,group,format) \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\ +typedef type api ITT_JOIN(_N_(name),_t) args; \ +ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \ +{ \ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) \ + __itt_init_ittlib_name(NULL, __itt_group_all); \ + if (ITTNOTIFY_NAME(name) && ITTNOTIFY_NAME(name) != ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init))) \ + return ITTNOTIFY_NAME(name) params; \ + else \ + return (type)0; \ +} + +#define ITT_STUBV(api,type,name,args,params,ptr,group,format) \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\ +typedef type api ITT_JOIN(_N_(name),_t) args; \ +ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \ +{ \ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) \ + __itt_init_ittlib_name(NULL, __itt_group_all); \ + if (ITTNOTIFY_NAME(name) && ITTNOTIFY_NAME(name) != ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init))) \ + ITTNOTIFY_NAME(name) params; \ + else \ + return; \ +} + +#undef __ITT_INTERNAL_INIT +#include "ittnotify_static.h" + +#undef ITT_STUB +#undef ITT_STUBV +#define ITT_STUB(api,type,name,args,params,ptr,group,format) \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\ +typedef type api ITT_JOIN(_N_(name),_t) args; \ +ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END + +#define ITT_STUBV(api,type,name,args,params,ptr,group,format) \ +static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\ +typedef type api ITT_JOIN(_N_(name),_t) args; \ +ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END + +#define __ITT_INTERNAL_INIT +#include "ittnotify_static.h" +#undef __ITT_INTERNAL_INIT + +ITT_GROUP_LIST(group_list); + +#pragma pack(push, 8) + +typedef struct ___itt_group_alias +{ + const char* env_var; + __itt_group_id groups; +} __itt_group_alias; + +static __itt_group_alias group_alias[] = { + { "KMP_FOR_TPROFILE", (__itt_group_id)(__itt_group_control | __itt_group_thread | __itt_group_sync | __itt_group_mark) }, + { "KMP_FOR_TCHECK", (__itt_group_id)(__itt_group_control | __itt_group_thread | __itt_group_sync | __itt_group_fsync | __itt_group_mark | __itt_group_suppress) }, + { NULL, (__itt_group_none) }, + { api_version, (__itt_group_none) } /* !!! Just to avoid unused code elimination !!! */ +}; + +#pragma pack(pop) + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(push) +#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +static __itt_api_info api_list[] = { +/* Define functions with static implementation */ +#undef ITT_STUB +#undef ITT_STUBV +#define ITT_STUB(api,type,name,args,params,nameindll,group,format) { ITT_TO_STR(ITT_JOIN(__itt_,nameindll)), (void**)(void*)&ITTNOTIFY_NAME(name), (void*)(size_t)&ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)), (void*)(size_t)&ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)), (__itt_group_id)(group)}, +#define ITT_STUBV ITT_STUB +#define __ITT_INTERNAL_INIT +#include "ittnotify_static.h" +#undef __ITT_INTERNAL_INIT +/* Define functions without static implementation */ +#undef ITT_STUB +#undef ITT_STUBV +#define ITT_STUB(api,type,name,args,params,nameindll,group,format) {ITT_TO_STR(ITT_JOIN(__itt_,nameindll)), (void**)(void*)&ITTNOTIFY_NAME(name), (void*)(size_t)&ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)), NULL, (__itt_group_id)(group)}, +#define ITT_STUBV ITT_STUB +#include "ittnotify_static.h" + {NULL, NULL, NULL, NULL, __itt_group_none} +}; + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(pop) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/* static part descriptor which handles. all notification api attributes. */ +__itt_global _N_(_ittapi_global) = { + ITT_MAGIC, /* identification info */ + ITT_MAJOR, ITT_MINOR, API_VERSION_BUILD, /* version info */ + 0, /* api_initialized */ + 0, /* mutex_initialized */ + 0, /* atomic_counter */ + MUTEX_INITIALIZER, /* mutex */ + NULL, /* dynamic library handle */ + NULL, /* error_handler */ + NULL, /* dll_path_ptr */ + (__itt_api_info*)&api_list, /* api_list_ptr */ + NULL, /* next __itt_global */ + NULL, /* thread_list */ + NULL, /* domain_list */ + NULL, /* string_list */ + __itt_collection_normal, /* collection state */ + NULL, /* counter_list */ + 0 /* ipt_collect_events */ +}; + +typedef void (__itt_api_init_t)(__itt_global*, __itt_group_id); +typedef void (__itt_api_fini_t)(__itt_global*); + +static __itt_domain dummy_domain; +/* ========================================================================= */ + +#ifdef ITT_NOTIFY_EXT_REPORT +ITT_EXTERN_C void _N_(error_handler)(__itt_error_code, va_list args); +#endif /* ITT_NOTIFY_EXT_REPORT */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(push) +#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +static void __itt_report_error(__itt_error_code code, ...) +{ + va_list args; + va_start(args, code); + if (_N_(_ittapi_global).error_handler != NULL) + { + __itt_error_handler_t* handler = (__itt_error_handler_t*)(size_t)_N_(_ittapi_global).error_handler; + handler(code, args); + } +#ifdef ITT_NOTIFY_EXT_REPORT + _N_(error_handler)(code, args); +#endif /* ITT_NOTIFY_EXT_REPORT */ + va_end(args); +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(pop) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static __itt_domain* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createW),_init))(const wchar_t* name) +{ + __itt_domain *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { + if (ITTNOTIFY_NAME(domain_createW) && ITTNOTIFY_NAME(domain_createW) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createW),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(domain_createW)(name); + } + else + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return &dummy_domain; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameW != NULL && !wcscmp(h->nameW, name)) break; + } + if (h == NULL) + { + NEW_DOMAIN_W(&_N_(_ittapi_global),h,h_tail,name); + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return h; +} + +static __itt_domain* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createA),_init))(const char* name) +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +static __itt_domain* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init))(const char* name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +{ + __itt_domain *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + if (ITTNOTIFY_NAME(domain_createA) && ITTNOTIFY_NAME(domain_createA) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_createA),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(domain_createA)(name); + } +#else + if (ITTNOTIFY_NAME(domain_create) && ITTNOTIFY_NAME(domain_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(domain_create),_init))) + { + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(domain_create)(name); + } +#endif + else + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#else + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#endif + return &dummy_domain; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).domain_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameA != NULL && !__itt_fstrcmp(h->nameA, name)) break; + } + if (h == NULL) + { + NEW_DOMAIN_A(&_N_(_ittapi_global),h,h_tail,name); + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return h; +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(module_load_with_sections),_init))(__itt_module_object* module_obj) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(module_load_with_sections) && ITTNOTIFY_NAME(module_load_with_sections) != ITT_VERSIONIZE(ITT_JOIN(_N_(module_load_with_sections),_init))) + { + if(module_obj != NULL) + { + module_obj->version = ITT_MODULE_OBJECT_VERSION; + ITTNOTIFY_NAME(module_load_with_sections)(module_obj); + } + } +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(module_unload_with_sections),_init))(__itt_module_object* module_obj) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(module_unload_with_sections) && ITTNOTIFY_NAME(module_unload_with_sections) != ITT_VERSIONIZE(ITT_JOIN(_N_(module_unload_with_sections),_init))) + { + if(module_obj != NULL) + { + module_obj->version = ITT_MODULE_OBJECT_VERSION; + ITTNOTIFY_NAME(module_unload_with_sections)(module_obj); + } + } +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static __itt_string_handle* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_createW),_init))(const wchar_t* name) +{ + __itt_string_handle *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { + if (ITTNOTIFY_NAME(string_handle_createW) && ITTNOTIFY_NAME(string_handle_createW) != ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_createW),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(string_handle_createW)(name); + } + else + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next) + { + if (h->strW != NULL && !wcscmp(h->strW, name)) break; + } + if (h == NULL) + { + NEW_STRING_HANDLE_W(&_N_(_ittapi_global),h,h_tail,name); + } + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return h; +} + +static __itt_string_handle* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_createA),_init))(const char* name) +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +static __itt_string_handle* ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_create),_init))(const char* name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +{ + __itt_string_handle *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + if (ITTNOTIFY_NAME(string_handle_createA) && ITTNOTIFY_NAME(string_handle_createA) != ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_createA),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(string_handle_createA)(name); + } +#else + if (ITTNOTIFY_NAME(string_handle_create) && ITTNOTIFY_NAME(string_handle_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(string_handle_create),_init))) + { + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(string_handle_create)(name); + } +#endif + else + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#else + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#endif + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).string_list; h != NULL; h_tail = h, h = h->next) + { + if (h->strA != NULL && !__itt_fstrcmp(h->strA, name)) break; + } + if (h == NULL) + { + NEW_STRING_HANDLE_A(&_N_(_ittapi_global),h,h_tail,name); + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return h; +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_createW),_init))(const wchar_t *name, const wchar_t *domain) +{ + __itt_counter_info_t *h_tail = NULL, *h = NULL; + __itt_metadata_type type = __itt_metadata_u64; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { + if (ITTNOTIFY_NAME(counter_createW) && ITTNOTIFY_NAME(counter_createW) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_createW),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_createW)(name, domain); + } + else + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) || + (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break; + + } + if (h == NULL) + { + NEW_COUNTER_W(&_N_(_ittapi_global),h,h_tail,name,domain,type); + } + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return (__itt_counter)h; +} + +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_createA),_init))(const char *name, const char *domain) +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create),_init))(const char *name, const char *domain) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +{ + __itt_counter_info_t *h_tail = NULL, *h = NULL; + __itt_metadata_type type = __itt_metadata_u64; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + if (ITTNOTIFY_NAME(counter_createA) && ITTNOTIFY_NAME(counter_createA) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_createA),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_createA)(name, domain); + } +#else + if (ITTNOTIFY_NAME(counter_create) && ITTNOTIFY_NAME(counter_create) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create),_init))) + { + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_create)(name, domain); + } +#endif + else + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#else + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#endif + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) || + (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break; + } + if (h == NULL) + { + NEW_COUNTER_A(&_N_(_ittapi_global),h,h_tail,name,domain,type); + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return (__itt_counter)h; +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typedW),_init))(const wchar_t *name, const wchar_t *domain, __itt_metadata_type type) +{ + __itt_counter_info_t *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { + if (ITTNOTIFY_NAME(counter_create_typedW) && ITTNOTIFY_NAME(counter_create_typedW) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typedW),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_create_typedW)(name, domain, type); + } + else + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameW != NULL && h->type == (int)type && !wcscmp(h->nameW, name) && ((h->domainW == NULL && domain == NULL) || + (h->domainW != NULL && domain != NULL && !wcscmp(h->domainW, domain)))) break; + + } + if (h == NULL) + { + NEW_COUNTER_W(&_N_(_ittapi_global),h,h_tail,name,domain,type); + } + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return (__itt_counter)h; +} + +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typedA),_init))(const char *name, const char *domain, __itt_metadata_type type) +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +static __itt_counter ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typed),_init))(const char *name, const char *domain, __itt_metadata_type type) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +{ + __itt_counter_info_t *h_tail = NULL, *h = NULL; + + if (name == NULL) + { + return NULL; + } + + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + if (ITTNOTIFY_NAME(counter_create_typedA) && ITTNOTIFY_NAME(counter_create_typedA) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typedA),_init))) + { + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_create_typedA)(name, domain, type); + } +#else + if (ITTNOTIFY_NAME(counter_create_typed) && ITTNOTIFY_NAME(counter_create_typed) != ITT_VERSIONIZE(ITT_JOIN(_N_(counter_create_typed),_init))) + { + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return ITTNOTIFY_NAME(counter_create_typed)(name, domain, type); + } +#endif + else + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#else + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#endif + return NULL; + } + } + for (h_tail = NULL, h = _N_(_ittapi_global).counter_list; h != NULL; h_tail = h, h = h->next) + { + if (h->nameA != NULL && h->type == (int)type && !__itt_fstrcmp(h->nameA, name) && ((h->domainA == NULL && domain == NULL) || + (h->domainA != NULL && domain != NULL && !__itt_fstrcmp(h->domainA, domain)))) break; + } + if (h == NULL) + { + NEW_COUNTER_A(&_N_(_ittapi_global),h,h_tail,name,domain,type); + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + return (__itt_counter)h; +} + +/* -------------------------------------------------------------------------- */ + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(pause),_init))(void) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(pause) && ITTNOTIFY_NAME(pause) != ITT_VERSIONIZE(ITT_JOIN(_N_(pause),_init))) + { + ITTNOTIFY_NAME(pause)(); + } + else + { + _N_(_ittapi_global).state = __itt_collection_paused; + } +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(resume),_init))(void) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(resume) && ITTNOTIFY_NAME(resume) != ITT_VERSIONIZE(ITT_JOIN(_N_(resume),_init))) + { + ITTNOTIFY_NAME(resume)(); + } + else + { + _N_(_ittapi_global).state = __itt_collection_normal; + } +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameW),_init))(const wchar_t* name) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(thread_set_nameW) && ITTNOTIFY_NAME(thread_set_nameW) != ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameW),_init))) + { + ITTNOTIFY_NAME(thread_set_nameW)(name); + } +} + +static int ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thr_name_setW),_init))(const wchar_t* name, int namelen) +{ + (void)namelen; + ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameW),_init))(name); + return 0; +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameA),_init))(const char* name) +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_name),_init))(const char* name) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } +#if ITT_PLATFORM==ITT_PLATFORM_WIN + if (ITTNOTIFY_NAME(thread_set_nameA) && ITTNOTIFY_NAME(thread_set_nameA) != ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameA),_init))) + { + ITTNOTIFY_NAME(thread_set_nameA)(name); + } +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + if (ITTNOTIFY_NAME(thread_set_name) && ITTNOTIFY_NAME(thread_set_name) != ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_name),_init))) + { + ITTNOTIFY_NAME(thread_set_name)(name); + } +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +static int ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thr_name_setA),_init))(const char* name, int namelen) +{ + (void)namelen; + ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_nameA),_init))(name); + return 0; +} +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +static int ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thr_name_set),_init))(const char* name, int namelen) +{ + (void)namelen; + ITT_VERSIONIZE(ITT_JOIN(_N_(thread_set_name),_init))(name); + return 0; +} +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thread_ignore),_init))(void) +{ + if (!_N_(_ittapi_global).api_initialized && _N_(_ittapi_global).thread_list == NULL) + { + __itt_init_ittlib_name(NULL, __itt_group_all); + } + if (ITTNOTIFY_NAME(thread_ignore) && ITTNOTIFY_NAME(thread_ignore) != ITT_VERSIONIZE(ITT_JOIN(_N_(thread_ignore),_init))) + { + ITTNOTIFY_NAME(thread_ignore)(); + } +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(thr_ignore),_init))(void) +{ + ITT_VERSIONIZE(ITT_JOIN(_N_(thread_ignore),_init))(); +} + +static void ITTAPI ITT_VERSIONIZE(ITT_JOIN(_N_(enable_attach),_init))(void) +{ +#ifdef __ANDROID__ + /* + * if LIB_VAR_NAME env variable were set before then stay previous value + * else set default path + */ + setenv(ITT_TO_STR(LIB_VAR_NAME), ANDROID_ITTNOTIFY_DEFAULT_PATH, 0); +#endif +} + +/* -------------------------------------------------------------------------- */ + +static const char* __itt_fsplit(const char* s, const char* sep, const char** out, int* len) +{ + int i; + int j; + + if (!s || !sep || !out || !len) + return NULL; + + for (i = 0; s[i]; i++) + { + int b = 0; + for (j = 0; sep[j]; j++) + if (s[i] == sep[j]) + { + b = 1; + break; + } + if (!b) + break; + } + + if (!s[i]) + return NULL; + + *len = 0; + *out = &s[i]; + + for (; s[i]; i++, (*len)++) + { + int b = 0; + for (j = 0; sep[j]; j++) + if (s[i] == sep[j]) + { + b = 1; + break; + } + if (b) + break; + } + + for (; s[i]; i++) + { + int b = 0; + for (j = 0; sep[j]; j++) + if (s[i] == sep[j]) + { + b = 1; + break; + } + if (!b) + break; + } + + return &s[i]; +} + +/* This function return value of env variable that placed into static buffer. + * !!! The same static buffer is used for subsequent calls. !!! + * This was done to avoid dynamic allocation for few calls. + * Actually we need this function only four times. + */ +static const char* __itt_get_env_var(const char* name) +{ +#define MAX_ENV_VALUE_SIZE 4086 + static char env_buff[MAX_ENV_VALUE_SIZE]; + static char* env_value = (char*)env_buff; + + if (name != NULL) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + size_t max_len = MAX_ENV_VALUE_SIZE - (size_t)(env_value - env_buff); + DWORD rc = GetEnvironmentVariableA(name, env_value, (DWORD)max_len); + if (rc >= max_len) + __itt_report_error(__itt_error_env_too_long, name, (size_t)rc - 1, (size_t)(max_len - 1)); + else if (rc > 0) + { + const char* ret = (const char*)env_value; + env_value += rc + 1; + return ret; + } + else + { + /* If environment variable is empty, GetEnvironmentVariables() + * returns zero (number of characters (not including terminating null), + * and GetLastError() returns ERROR_SUCCESS. */ + DWORD err = GetLastError(); + if (err == ERROR_SUCCESS) + return env_value; + + if (err != ERROR_ENVVAR_NOT_FOUND) + __itt_report_error(__itt_error_cant_read_env, name, (int)err); + } +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ + char* env = getenv(name); + if (env != NULL) + { + size_t len = __itt_fstrnlen(env, MAX_ENV_VALUE_SIZE); + size_t max_len = MAX_ENV_VALUE_SIZE - (size_t)(env_value - env_buff); + if (len < max_len) + { + const char* ret = (const char*)env_value; + __itt_fstrcpyn(env_value, max_len, env, len + 1); + env_value += len + 1; + return ret; + } else + __itt_report_error(__itt_error_env_too_long, name, (size_t)len, (size_t)(max_len - 1)); + } +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + } + return NULL; +} + +static const char* __itt_get_lib_name(void) +{ + const char* lib_name = __itt_get_env_var(ITT_TO_STR(LIB_VAR_NAME)); + +#ifdef __ANDROID__ + if (lib_name == NULL) + { + +#if ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_ARM + const char* const marker_filename = "com.intel.itt.collector_lib_32"; +#else + const char* const marker_filename = "com.intel.itt.collector_lib_64"; +#endif + + char system_wide_marker_filename[PATH_MAX] = {0}; + int itt_marker_file_fd = -1; + ssize_t res = 0; + + res = snprintf(system_wide_marker_filename, PATH_MAX - 1, "%s%s", "/data/local/tmp/", marker_filename); + if (res < 0) + { + ITT_ANDROID_LOGE("Unable to concatenate marker file string."); + return lib_name; + } + itt_marker_file_fd = open(system_wide_marker_filename, O_RDONLY); + + if (itt_marker_file_fd == -1) + { + const pid_t my_pid = getpid(); + char cmdline_path[PATH_MAX] = {0}; + char package_name[PATH_MAX] = {0}; + char app_sandbox_file[PATH_MAX] = {0}; + int cmdline_fd = 0; + + ITT_ANDROID_LOGI("Unable to open system-wide marker file."); + res = snprintf(cmdline_path, PATH_MAX - 1, "/proc/%d/cmdline", my_pid); + if (res < 0) + { + ITT_ANDROID_LOGE("Unable to get cmdline path string."); + return lib_name; + } + + ITT_ANDROID_LOGI("CMD file: %s\n", cmdline_path); + cmdline_fd = open(cmdline_path, O_RDONLY); + if (cmdline_fd == -1) + { + ITT_ANDROID_LOGE("Unable to open %s file!", cmdline_path); + return lib_name; + } + res = read(cmdline_fd, package_name, PATH_MAX - 1); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to read %s file!", cmdline_path); + res = close(cmdline_fd); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to close %s file!", cmdline_path); + } + return lib_name; + } + res = close(cmdline_fd); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to close %s file!", cmdline_path); + return lib_name; + } + ITT_ANDROID_LOGI("Package name: %s\n", package_name); + res = snprintf(app_sandbox_file, PATH_MAX - 1, "/data/data/%s/%s", package_name, marker_filename); + if (res < 0) + { + ITT_ANDROID_LOGE("Unable to concatenate marker file string."); + return lib_name; + } + + ITT_ANDROID_LOGI("Lib marker file name: %s\n", app_sandbox_file); + itt_marker_file_fd = open(app_sandbox_file, O_RDONLY); + if (itt_marker_file_fd == -1) + { + ITT_ANDROID_LOGE("Unable to open app marker file!"); + return lib_name; + } + } + + { + char itt_lib_name[PATH_MAX] = {0}; + + res = read(itt_marker_file_fd, itt_lib_name, PATH_MAX - 1); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to read %s file!", itt_marker_file_fd); + res = close(itt_marker_file_fd); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to close %s file!", itt_marker_file_fd); + } + return lib_name; + } + ITT_ANDROID_LOGI("ITT Lib path: %s", itt_lib_name); + res = close(itt_marker_file_fd); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to close %s file!", itt_marker_file_fd); + return lib_name; + } + ITT_ANDROID_LOGI("Set env %s to %s", ITT_TO_STR(LIB_VAR_NAME), itt_lib_name); + res = setenv(ITT_TO_STR(LIB_VAR_NAME), itt_lib_name, 0); + if (res == -1) + { + ITT_ANDROID_LOGE("Unable to set env var!"); + return lib_name; + } + lib_name = __itt_get_env_var(ITT_TO_STR(LIB_VAR_NAME)); + ITT_ANDROID_LOGI("ITT Lib path from env: %s", lib_name); + } + } +#endif + + return lib_name; +} + +/* Avoid clashes with std::min, reported by tbb team */ +#define __itt_min(a,b) ((a) < (b) ? (a) : (b)) + +static __itt_group_id __itt_get_groups(void) +{ + int i; + __itt_group_id res = __itt_group_none; + const char* var_name = "INTEL_ITTNOTIFY_GROUPS"; + const char* group_str = __itt_get_env_var(var_name); + + if (group_str != NULL) + { + int len; + char gr[255]; + const char* chunk; + while ((group_str = __itt_fsplit(group_str, ",; ", &chunk, &len)) != NULL) + { + int min_len = __itt_min(len, (int)(sizeof(gr) - 1)); + __itt_fstrcpyn(gr, sizeof(gr) - 1, chunk, min_len); + gr[min_len] = 0; + + for (i = 0; group_list[i].name != NULL; i++) + { + if (!__itt_fstrcmp(gr, group_list[i].name)) + { + res = (__itt_group_id)(res | group_list[i].id); + break; + } + } + } + /* TODO: !!! Workaround for bug with warning for unknown group !!! + * Should be fixed in new initialization scheme. + * Now the following groups should be set always. */ + for (i = 0; group_list[i].id != __itt_group_none; i++) + if (group_list[i].id != __itt_group_all && + group_list[i].id > __itt_group_splitter_min && + group_list[i].id < __itt_group_splitter_max) + res = (__itt_group_id)(res | group_list[i].id); + return res; + } + else + { + for (i = 0; group_alias[i].env_var != NULL; i++) + if (__itt_get_env_var(group_alias[i].env_var) != NULL) + return group_alias[i].groups; + } + + return res; +} + +#undef __itt_min + +static int __itt_lib_version(lib_t lib) +{ + if (lib == NULL) + return 0; + if (__itt_get_proc(lib, "__itt_api_init")) + return 2; + if (__itt_get_proc(lib, "__itt_api_version")) + return 1; + return 0; +} + +/* It's not used right now! Comment it out to avoid warnings. +static void __itt_reinit_all_pointers(void) +{ + register int i; + // Fill all pointers with initial stubs + for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++) + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].init_func; +} +*/ + +static void __itt_nullify_all_pointers(void) +{ + int i; + /* Nulify all pointers except domain_create, string_handle_create and counter_create */ + for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++) + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func; +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(push) +#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */ +#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */ +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +ITT_EXTERN_C void _N_(fini_ittlib)(void) +{ + __itt_api_fini_t* __itt_api_fini_ptr = NULL; + static volatile TIDT current_thread = 0; + + if (_N_(_ittapi_global).api_initialized) + { + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); + if (_N_(_ittapi_global).api_initialized) + { + if (current_thread == 0) + { + if (PTHREAD_SYMBOLS) current_thread = __itt_thread_id(); + if (_N_(_ittapi_global).lib != NULL) + { + __itt_api_fini_ptr = (__itt_api_fini_t*)(size_t)__itt_get_proc(_N_(_ittapi_global).lib, "__itt_api_fini"); + } + if (__itt_api_fini_ptr) + { + __itt_api_fini_ptr(&_N_(_ittapi_global)); + } + + __itt_nullify_all_pointers(); + + /* TODO: !!! not safe !!! don't support unload so far. + * if (_N_(_ittapi_global).lib != NULL) + * __itt_unload_lib(_N_(_ittapi_global).lib); + * _N_(_ittapi_global).lib = NULL; + */ + _N_(_ittapi_global).api_initialized = 0; + current_thread = 0; + } + } + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); + } +} + +ITT_EXTERN_C int _N_(init_ittlib)(const char* lib_name, __itt_group_id init_groups) +{ + int i; + __itt_group_id groups; +#ifdef ITT_COMPLETE_GROUP + __itt_group_id zero_group = __itt_group_none; +#endif /* ITT_COMPLETE_GROUP */ + static volatile TIDT current_thread = 0; + + if (!_N_(_ittapi_global).api_initialized) + { +#ifndef ITT_SIMPLE_INIT + ITT_MUTEX_INIT_AND_LOCK(_N_(_ittapi_global)); +#endif /* ITT_SIMPLE_INIT */ + + if (!_N_(_ittapi_global).api_initialized) + { + if (current_thread == 0) + { + if (PTHREAD_SYMBOLS) current_thread = __itt_thread_id(); + if (lib_name == NULL) + { + lib_name = __itt_get_lib_name(); + } + groups = __itt_get_groups(); + if (DL_SYMBOLS && (groups != __itt_group_none || lib_name != NULL)) + { + _N_(_ittapi_global).lib = __itt_load_lib((lib_name == NULL) ? ittnotify_lib_name : lib_name); + + if (_N_(_ittapi_global).lib != NULL) + { + __itt_api_init_t* __itt_api_init_ptr; + int lib_version = __itt_lib_version(_N_(_ittapi_global).lib); + + switch (lib_version) + { + case 0: + groups = __itt_group_legacy; + ITT_ATTRIBUTE_FALLTHROUGH; + case 1: + /* Fill all pointers from dynamic library */ + for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++) + { + if (_N_(_ittapi_global).api_list_ptr[i].group & groups & init_groups) + { + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = (void*)__itt_get_proc(_N_(_ittapi_global).lib, _N_(_ittapi_global).api_list_ptr[i].name); + if (*_N_(_ittapi_global).api_list_ptr[i].func_ptr == NULL) + { + /* Restore pointers for function with static implementation */ + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func; + __itt_report_error(__itt_error_no_symbol, lib_name, _N_(_ittapi_global).api_list_ptr[i].name); +#ifdef ITT_COMPLETE_GROUP + zero_group = (__itt_group_id)(zero_group | _N_(_ittapi_global).api_list_ptr[i].group); +#endif /* ITT_COMPLETE_GROUP */ + } + } + else + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func; + } + + if (groups == __itt_group_legacy) + { + /* Compatibility with legacy tools */ + ITTNOTIFY_NAME(thread_ignore) = ITTNOTIFY_NAME(thr_ignore); +#if ITT_PLATFORM==ITT_PLATFORM_WIN + ITTNOTIFY_NAME(sync_createA) = ITTNOTIFY_NAME(sync_set_nameA); + ITTNOTIFY_NAME(sync_createW) = ITTNOTIFY_NAME(sync_set_nameW); +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ + ITTNOTIFY_NAME(sync_create) = ITTNOTIFY_NAME(sync_set_name); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + ITTNOTIFY_NAME(sync_prepare) = ITTNOTIFY_NAME(notify_sync_prepare); + ITTNOTIFY_NAME(sync_cancel) = ITTNOTIFY_NAME(notify_sync_cancel); + ITTNOTIFY_NAME(sync_acquired) = ITTNOTIFY_NAME(notify_sync_acquired); + ITTNOTIFY_NAME(sync_releasing) = ITTNOTIFY_NAME(notify_sync_releasing); + } + +#ifdef ITT_COMPLETE_GROUP + for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++) + if (_N_(_ittapi_global).api_list_ptr[i].group & zero_group) + *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func; +#endif /* ITT_COMPLETE_GROUP */ + break; + case 2: + __itt_api_init_ptr = (__itt_api_init_t*)(size_t)__itt_get_proc(_N_(_ittapi_global).lib, "__itt_api_init"); + if (__itt_api_init_ptr) + __itt_api_init_ptr(&_N_(_ittapi_global), init_groups); + break; + } + } + else + { + __itt_nullify_all_pointers(); + + __itt_report_error(__itt_error_no_module, lib_name, +#if ITT_PLATFORM==ITT_PLATFORM_WIN + __itt_system_error() +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + dlerror() +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + ); + } + } + else + { + __itt_nullify_all_pointers(); + } + _N_(_ittapi_global).api_initialized = 1; + current_thread = 0; + /* !!! Just to avoid unused code elimination !!! */ + if (__itt_fini_ittlib_ptr == _N_(fini_ittlib)) current_thread = 0; + } + } + +#ifndef ITT_SIMPLE_INIT + if (PTHREAD_SYMBOLS) __itt_mutex_unlock(&_N_(_ittapi_global).mutex); +#endif /* ITT_SIMPLE_INIT */ + } + + /* Evaluating if any function ptr is non empty and it's in init_groups */ + for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++) + { + if (*_N_(_ittapi_global).api_list_ptr[i].func_ptr != _N_(_ittapi_global).api_list_ptr[i].null_func && + _N_(_ittapi_global).api_list_ptr[i].group & init_groups) + { + return 1; + } + } + return 0; +} + +ITT_EXTERN_C __itt_error_handler_t* _N_(set_error_handler)(__itt_error_handler_t* handler) +{ + __itt_error_handler_t* prev = (__itt_error_handler_t*)(size_t)_N_(_ittapi_global).error_handler; + _N_(_ittapi_global).error_handler = (void*)(size_t)handler; + return prev; +} + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#pragma warning(pop) +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/** __itt_mark_pt_region functions marks region of interest + * region parameter defines different regions. + * 0 <= region < 8 */ + +#if defined(ITT_API_IPT_SUPPORT) && (ITT_PLATFORM==ITT_PLATFORM_WIN || ITT_PLATFORM==ITT_PLATFORM_POSIX) && !defined(__ANDROID__) +void __itt_pt_mark(__itt_pt_region region); +void __itt_pt_mark_event(__itt_pt_region region); +#endif + +ITT_EXTERN_C void _N_(mark_pt_region_begin)(__itt_pt_region region) +{ +#if defined(ITT_API_IPT_SUPPORT) && (ITT_PLATFORM==ITT_PLATFORM_WIN || ITT_PLATFORM==ITT_PLATFORM_POSIX) && !defined(__ANDROID__) + if (_N_(_ittapi_global).ipt_collect_events == 1) + { + __itt_pt_mark_event(2*region); + } + else + { + __itt_pt_mark(2*region); + } +#else + (void)region; +#endif +} + +ITT_EXTERN_C void _N_(mark_pt_region_end)(__itt_pt_region region) +{ +#if defined(ITT_API_IPT_SUPPORT) && (ITT_PLATFORM==ITT_PLATFORM_WIN || ITT_PLATFORM==ITT_PLATFORM_POSIX) && !defined(__ANDROID__) + if (_N_(_ittapi_global).ipt_collect_events == 1) + { + __itt_pt_mark_event(2*region + 1); + } + else + { + __itt_pt_mark(2*region + 1); + } +#else + (void)region; +#endif +} + diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.h b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.h new file mode 100644 index 00000000000000..2186eca35f1870 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_static.h @@ -0,0 +1,346 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#include "ittnotify_config.h" + +#ifndef ITT_FORMAT_DEFINED +# ifndef ITT_FORMAT +# define ITT_FORMAT +# endif /* ITT_FORMAT */ +# ifndef ITT_NO_PARAMS +# define ITT_NO_PARAMS +# endif /* ITT_NO_PARAMS */ +#endif /* ITT_FORMAT_DEFINED */ + +/* + * parameters for macro expected: + * ITT_STUB(api, type, func_name, arguments, params, func_name_in_dll, group, printf_fmt) + */ +#ifdef __ITT_INTERNAL_INIT + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char *name), (ITT_FORMAT name), domain_createA, __itt_group_structure, "\"%s\"") +ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORMAT name), domain_createW, __itt_group_structure, "\"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_load_with_sections, __itt_group_module, "%p") +ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_unload_with_sections, __itt_group_module, "%p") + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"") +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create, (const char *name), (ITT_FORMAT name), string_handle_create, __itt_group_structure, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_createA, __itt_group_counter, "\"%s\", \"%s\"") +ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), counter_createW, __itt_group_counter, "\"%s\", \"%s\"") +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_counter, counter_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_create, __itt_group_counter, "\"%s\", \"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedA, __itt_group_counter, "\"%s\", \"%s\", %d") +ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedW, __itt_group_counter, "\"%s\", \"%s\", %d") +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typed, __itt_group_counter, "\"%s\", \"%s\", %d") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + + +ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args") +ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args") + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"") +ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name), (ITT_FORMAT name), thread_set_nameW, __itt_group_thread, "\"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name), (ITT_FORMAT name), thread_set_name, __itt_group_thread, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, thread_ignore, (void), (ITT_NO_PARAMS), thread_ignore, __itt_group_thread, "no args") + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setA, __itt_group_thread | __itt_group_legacy, "\"%s\", %d") +ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setW, __itt_group_thread | __itt_group_legacy, "\"%S\", %d") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args") +#endif /* __ITT_INTERNAL_BODY */ + +ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args") + +#else /* __ITT_INTERNAL_INIT */ + +ITT_STUBV(ITTAPI, void, detach, (void), (ITT_NO_PARAMS), detach, __itt_group_control | __itt_group_legacy, "no args") + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x") +ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\", \"%S\", %x") +ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_renameA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"") +ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name), (ITT_FORMAT addr, name), sync_renameW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_create, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_create, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x") +ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_rename, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr), (ITT_FORMAT addr), sync_destroy, __itt_group_sync | __itt_group_fsync, "%p") + +ITT_STUBV(ITTAPI, void, sync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_sync, "%p") +ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_sync, "%p") +ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_sync, "%p") +ITT_STUBV(ITTAPI, void, sync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_sync, "%p") + +ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask), (ITT_FORMAT mask), suppress_push, __itt_group_suppress, "%p") +ITT_STUBV(ITTAPI, void, suppress_pop, (void), (ITT_NO_PARAMS), suppress_pop, __itt_group_suppress, "no args") +ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_mark_range, __itt_group_suppress, "%d, %p, %p, %d") +ITT_STUBV(ITTAPI, void, suppress_clear_range,(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_clear_range,__itt_group_suppress, "%d, %p, %p, %d") + +ITT_STUBV(ITTAPI, void, fsync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_fsync, "%p") +ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_fsync, "%p") +ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_fsync, "%p") +ITT_STUBV(ITTAPI, void, fsync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_fsync, "%p") + +ITT_STUBV(ITTAPI, void, model_site_begin, (__itt_model_site *site, __itt_model_site_instance *instance, const char *name), (ITT_FORMAT site, instance, name), model_site_begin, __itt_group_model, "%p, %p, \"%s\"") +ITT_STUBV(ITTAPI, void, model_site_end, (__itt_model_site *site, __itt_model_site_instance *instance), (ITT_FORMAT site, instance), model_site_end, __itt_group_model, "%p, %p") +ITT_STUBV(ITTAPI, void, model_task_begin, (__itt_model_task *task, __itt_model_task_instance *instance, const char *name), (ITT_FORMAT task, instance, name), model_task_begin, __itt_group_model, "%p, %p, \"%s\"") +ITT_STUBV(ITTAPI, void, model_task_end, (__itt_model_task *task, __itt_model_task_instance *instance), (ITT_FORMAT task, instance), model_task_end, __itt_group_model, "%p, %p") +ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock), (ITT_FORMAT lock), model_lock_acquire, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock), (ITT_FORMAT lock), model_lock_release, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size), (ITT_FORMAT addr, size), model_record_allocation, __itt_group_model, "%p, %d") +ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr), (ITT_FORMAT addr), model_record_deallocation, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_induction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_induction_uses, __itt_group_model, "%p, %d") +ITT_STUBV(ITTAPI, void, model_reduction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_reduction_uses, __itt_group_model, "%p, %d") +ITT_STUBV(ITTAPI, void, model_observe_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_observe_uses, __itt_group_model, "%p, %d") +ITT_STUBV(ITTAPI, void, model_clear_uses, (void* addr), (ITT_FORMAT addr), model_clear_uses, __itt_group_model, "%p") + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name), (ITT_FORMAT name), model_site_beginW, __itt_group_model, "\"%s\"") +ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name), (ITT_FORMAT name), model_task_beginW, __itt_group_model, "\"%s\"") +ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name), (ITT_FORMAT name), model_iteration_taskW, __itt_group_model, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name), (ITT_FORMAT name), model_site_beginA, __itt_group_model, "\"%s\"") +ITT_STUBV(ITTAPI, void, model_site_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_site_beginAL, __itt_group_model, "\"%s\", %d") +ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name), (ITT_FORMAT name), model_task_beginA, __itt_group_model, "\"%s\"") +ITT_STUBV(ITTAPI, void, model_task_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_task_beginAL, __itt_group_model, "\"%s\", %d") +ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name), (ITT_FORMAT name), model_iteration_taskA, __itt_group_model, "\"%s\"") +ITT_STUBV(ITTAPI, void, model_iteration_taskAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_iteration_taskAL, __itt_group_model, "\"%s\", %d") +ITT_STUBV(ITTAPI, void, model_site_end_2, (void), (ITT_NO_PARAMS), model_site_end_2, __itt_group_model, "no args") +ITT_STUBV(ITTAPI, void, model_task_end_2, (void), (ITT_NO_PARAMS), model_task_end_2, __itt_group_model, "no args") +ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock), (ITT_FORMAT lock), model_lock_acquire_2, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock), (ITT_FORMAT lock), model_lock_release_2, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t count), (ITT_FORMAT count), model_aggregate_task, __itt_group_model, "%d") +ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x), (ITT_FORMAT x), model_disable_push, __itt_group_model, "%p") +ITT_STUBV(ITTAPI, void, model_disable_pop, (void), (ITT_NO_PARAMS), model_disable_pop, __itt_group_model, "no args") +#endif /* __ITT_INTERNAL_BODY */ + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_createA, __itt_group_heap, "\"%s\", \"%s\"") +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), heap_function_createW, __itt_group_heap, "\"%s\", \"%s\"") +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_create, __itt_group_heap, "\"%s\", \"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* __ITT_INTERNAL_BODY */ +ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized), (ITT_FORMAT h, size, initialized), heap_allocate_begin, __itt_group_heap, "%p, %lu, %d") +ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized), (ITT_FORMAT h, addr, size, initialized), heap_allocate_end, __itt_group_heap, "%p, %p, %lu, %d") +ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_begin, __itt_group_heap, "%p, %p") +ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_end, __itt_group_heap, "%p, %p") +ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_size, initialized), heap_reallocate_begin, __itt_group_heap, "%p, %p, %lu, %d") +ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_addr, new_size, initialized), heap_reallocate_end, __itt_group_heap, "%p, %p, %p, %lu, %d") +ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void), (ITT_NO_PARAMS), heap_internal_access_begin, __itt_group_heap, "no args") +ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void), (ITT_NO_PARAMS), heap_internal_access_end, __itt_group_heap, "no args") +ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void), (ITT_NO_PARAMS), heap_record_memory_growth_begin, __itt_group_heap, "no args") +ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void), (ITT_NO_PARAMS), heap_record_memory_growth_end, __itt_group_heap, "no args") +ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask), (ITT_FORMAT reset_mask), heap_reset_detection, __itt_group_heap, "%u") +ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask), (ITT_FORMAT record_mask), heap_record, __itt_group_heap, "%u") + +ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_create, __itt_group_structure, "%p, %lu") +ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_destroy, __itt_group_structure, "%p, %lu") + +ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void), (ITT_NO_PARAMS), get_timestamp, __itt_group_structure, "no args") + +ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), region_begin, __itt_group_structure, "%p, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), region_end, __itt_group_structure, "%p, %lu") + +#ifndef __ITT_INTERNAL_BODY +ITT_STUBV(ITTAPI, void, frame_begin_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_begin_v3, __itt_group_structure, "%p, %p") +ITT_STUBV(ITTAPI, void, frame_end_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_end_v3, __itt_group_structure, "%p, %p") +ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end), (ITT_FORMAT domain, id, begin, end), frame_submit_v3, __itt_group_structure, "%p, %p, %lu, %lu") +#endif /* __ITT_INTERNAL_BODY */ + +ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_group, __itt_group_structure, "%p, %lu, %lu, %p") + +ITT_STUBV(ITTAPI, void, task_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin, __itt_group_structure, "%p, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parent, void* fn), (ITT_FORMAT domain, id, parent, fn), task_begin_fn, __itt_group_structure, "%p, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain), (ITT_FORMAT domain), task_end, __itt_group_structure, "%p") + +ITT_STUBV(ITTAPI, void, counter_inc_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_inc_v3, __itt_group_structure, "%p, %p") +ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_inc_delta_v3, __itt_group_structure, "%p, %p, %lu") +ITT_STUBV(ITTAPI, void, counter_dec_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_dec_v3, __itt_group_structure, "%p, %p") +ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_dec_delta_v3, __itt_group_structure, "%p, %p, %lu") + +ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, id, name, scope), marker, __itt_group_structure, "%p, %lu, %p, %d") + +ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, id, key, type, count, data), metadata_add, __itt_group_structure, "%p, %lu, %p, %d, %lu, %p") +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addA, __itt_group_structure, "%p, %lu, %p, %p, %lu") +ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addW, __itt_group_structure, "%p, %lu, %p, %p, %lu") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_add, __itt_group_structure, "%p, %lu, %p, %p, %lu") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, relation, tail), relation_add_to_current, __itt_group_structure, "%p, %lu, %p") +ITT_STUBV(ITTAPI, void, relation_add, (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, head, relation, tail), relation_add, __itt_group_structure, "%p, %p, %lu, %p") + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_createA, __itt_group_mark | __itt_group_legacy, "\"%s\", %d") +ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), event_createW, __itt_group_mark | __itt_group_legacy, "\"%S\", %d") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_create, __itt_group_mark | __itt_group_legacy, "\"%s\", %d") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event), (ITT_FORMAT event), event_start, __itt_group_mark | __itt_group_legacy, "%d") +ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event), (ITT_FORMAT event), event_end, __itt_group_mark | __itt_group_legacy, "%d") +#endif /* __ITT_INTERNAL_BODY */ + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", \"%s\", %x") +ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", \"%S\", %x") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "p, \"%s\", \"%s\", %x") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x") +ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *p, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", %d, \"%S\", %d, %x") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *p), (ITT_FORMAT p), notify_sync_prepare, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p") +ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *p), (ITT_FORMAT p), notify_sync_cancel, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p") +ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *p), (ITT_FORMAT p), notify_sync_acquired, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p") +ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *p), (ITT_FORMAT p), notify_sync_releasing, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p") +#endif /* __ITT_INTERNAL_BODY */ + +ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_read, __itt_group_legacy, "%p, %lu") +ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_write, __itt_group_legacy, "%p, %lu") +ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_update, __itt_group_legacy, "%p, %lu") + +ITT_STUB(LIBITTAPI, __itt_state_t, state_get, (void), (ITT_NO_PARAMS), state_get, __itt_group_legacy, "no args") +ITT_STUB(LIBITTAPI, __itt_state_t, state_set, (__itt_state_t s), (ITT_FORMAT s), state_set, __itt_group_legacy, "%d") +ITT_STUB(LIBITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s), (ITT_FORMAT p, s), obj_mode_set, __itt_group_legacy, "%d, %d") +ITT_STUB(LIBITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s), (ITT_FORMAT p, s), thr_mode_set, __itt_group_legacy, "%d, %d") + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain), (ITT_FORMAT domain), frame_createA, __itt_group_frame, "\"%s\"") +ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMAT domain), frame_createW, __itt_group_frame, "\"%s\"") +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name), (ITT_FORMAT name), pt_region_createA, __itt_group_structure, "\"%s\"") +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name), (ITT_FORMAT name), pt_region_createW, __itt_group_structure, "\"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name), (ITT_FORMAT name), pt_region_create, __itt_group_structure, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* __ITT_INTERNAL_BODY */ +ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p") +ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p") + +ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id), (ITT_FORMAT id), counter_destroy, __itt_group_counter, "%p") +ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id), (ITT_FORMAT id), counter_inc, __itt_group_counter, "%p") +ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_inc_delta, __itt_group_counter, "%p, %lu") +ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id), (ITT_FORMAT id), counter_dec, __itt_group_counter, "%p") +ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_dec_delta, __itt_group_counter, "%p, %lu") +ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr), (ITT_FORMAT id, value_ptr), counter_set_value, __itt_group_counter, "%p, %p") +ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr), (ITT_FORMAT id, clock_domain, timestamp, value_ptr), counter_set_value_ex, __itt_group_counter, "%p, %p, %llu, %p") + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name), (ITT_FORMAT name), mark_createA, __itt_group_mark, "\"%s\"") +ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name), (ITT_FORMAT name), mark_createW, __itt_group_mark, "\"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name), (ITT_FORMAT name), mark_create, __itt_group_mark, "\"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* __ITT_INTERNAL_BODY */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), markA, __itt_group_mark, "%d, \"%s\"") +ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), markW, __itt_group_mark, "%d, \"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark, __itt_group_mark, "%d, \"%s\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_off, __itt_group_mark, "%d") +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_globalA, __itt_group_mark, "%d, \"%s\"") +ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), mark_globalW, __itt_group_mark, "%d, \"%S\"") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_global, __itt_group_mark, "%d, \"%S\"") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_global_off, __itt_group_mark, "%d") + +#ifndef __ITT_INTERNAL_BODY +ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void), (ITT_NO_PARAMS), stack_caller_create, __itt_group_stitch, "no args") +#endif /* __ITT_INTERNAL_BODY */ +ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id), (ITT_FORMAT id), stack_caller_destroy, __itt_group_stitch, "%p") +ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id), (ITT_FORMAT id), stack_callee_enter, __itt_group_stitch, "%p") +ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id), (ITT_FORMAT id), stack_callee_leave, __itt_group_stitch, "%p") + +ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data), (ITT_FORMAT fn, fn_data), clock_domain_create, __itt_group_structure, "%p, %p") +ITT_STUBV(ITTAPI, void, clock_domain_reset, (void), (ITT_NO_PARAMS), clock_domain_reset, __itt_group_structure, "no args") +ITT_STUBV(ITTAPI, void, id_create_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_create_ex, __itt_group_structure, "%p, %p, %lu, %lu") +ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_destroy_ex, __itt_group_structure, "%p, %p, %lu, %lu") +ITT_STUBV(ITTAPI, void, task_begin_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_begin_fn_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, fn), task_begin_fn_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_end_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp), (ITT_FORMAT domain, clock_domain, timestamp), task_end_ex, __itt_group_structure, "%p, %p, %lu") +ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin_overlapped, __itt_group_structure, "%p, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p") +ITT_STUBV(ITTAPI, void, task_end_overlapped, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), task_end_overlapped, __itt_group_structure, "%p, %lu") +ITT_STUBV(ITTAPI, void, task_end_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), task_end_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu") +ITT_STUBV(ITTAPI, void, marker_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, clock_domain, timestamp, id, name, scope), marker_ex, __itt_group_structure, "%p, %p, %lu, %lu, %p, %d") +ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, scope, key, type, count, data), metadata_add_with_scope, __itt_group_structure, "%p, %d, %p, %d, %lu, %p") +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeA, __itt_group_structure, "%p, %d, %p, %p, %lu") +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeW, __itt_group_structure, "%p, %d, %p, %p, %lu") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scope, __itt_group_structure, "%p, %d, %p, %p, %lu") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, relation, tail), relation_add_to_current_ex, __itt_group_structure, "%p, %p, %lu, %d, %lu") +ITT_STUBV(ITTAPI, void, relation_add_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, head, relation, tail), relation_add_ex, __itt_group_structure, "%p, %p, %lu, %lu, %d, %lu") +ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type), (ITT_FORMAT name, track_group_type), track_group_create, __itt_group_structure, "%p, %d") +ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type), (ITT_FORMAT track_group, name, track_type), track_create, __itt_group_structure, "%p, %p, %d") +ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track), (ITT_FORMAT track), set_track, __itt_group_structure, "%p") + +#ifndef __ITT_INTERNAL_BODY +ITT_STUB(ITTAPI, const char*, api_version, (void), (ITT_NO_PARAMS), api_version, __itt_group_all & ~__itt_group_legacy, "no args") +#endif /* __ITT_INTERNAL_BODY */ + +#ifndef __ITT_INTERNAL_BODY +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveA, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d") +ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveW, __itt_group_arrays, "%p, %d, %p, %d, \"%S\", %d") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_save, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#endif /* __ITT_INTERNAL_BODY */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_module, "%p, %p, %p") +ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_module, "%p, %p, %p") +#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_module, "%p, %p, %p") +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p") + + +#endif /* __ITT_INTERNAL_INIT */ diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_types.h b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_types.h new file mode 100644 index 00000000000000..7346c8032f626f --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittnotify_types.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#ifndef _ITTNOTIFY_TYPES_H_ +#define _ITTNOTIFY_TYPES_H_ + +typedef enum ___itt_group_id +{ + __itt_group_none = 0, + __itt_group_legacy = 1<<0, + __itt_group_control = 1<<1, + __itt_group_thread = 1<<2, + __itt_group_mark = 1<<3, + __itt_group_sync = 1<<4, + __itt_group_fsync = 1<<5, + __itt_group_jit = 1<<6, + __itt_group_model = 1<<7, + __itt_group_splitter_min = 1<<7, + __itt_group_counter = 1<<8, + __itt_group_frame = 1<<9, + __itt_group_stitch = 1<<10, + __itt_group_heap = 1<<11, + __itt_group_splitter_max = 1<<12, + __itt_group_structure = 1<<12, + __itt_group_suppress = 1<<13, + __itt_group_arrays = 1<<14, + __itt_group_module = 1<<15, + __itt_group_all = -1 +} __itt_group_id; + +#pragma pack(push, 8) + +typedef struct ___itt_group_list +{ + __itt_group_id id; + const char* name; +} __itt_group_list; + +#pragma pack(pop) + +#define ITT_GROUP_LIST(varname) \ + static __itt_group_list varname[] = { \ + { __itt_group_all, "all" }, \ + { __itt_group_control, "control" }, \ + { __itt_group_thread, "thread" }, \ + { __itt_group_mark, "mark" }, \ + { __itt_group_sync, "sync" }, \ + { __itt_group_fsync, "fsync" }, \ + { __itt_group_jit, "jit" }, \ + { __itt_group_model, "model" }, \ + { __itt_group_counter, "counter" }, \ + { __itt_group_frame, "frame" }, \ + { __itt_group_stitch, "stitch" }, \ + { __itt_group_heap, "heap" }, \ + { __itt_group_structure, "structure" }, \ + { __itt_group_suppress, "suppress" }, \ + { __itt_group_arrays, "arrays" }, \ + { __itt_group_module, "module" }, \ + { __itt_group_none, NULL } \ + } + +#endif /* _ITTNOTIFY_TYPES_H_ */ diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.S b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.S new file mode 100644 index 00000000000000..7568bc8a64a459 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.S @@ -0,0 +1,764 @@ +/* + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + Contact Information: + http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ + + BSD LICENSE + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +// ///////////////////////////////////////////////////////////////////////// +////// Intel Processor Trace Marker Functionality +//////////////////////////////////////////////////////////////////////////// + + .text + .align 16 + .globl __itt_pt_mark + .globl __itt_pt_event + .globl __itt_pt_mark_event + .globl __itt_pt_mark_threshold + .globl __itt_pt_byte + .globl __itt_pt_write + +/// void __itt_pt_mark(unsigned char index); +__itt_pt_mark: + movzbl 4(%esp), %eax +// and $0xff, %eax + lea __itt_pt_mark_call_table(,%eax,4), %eax + jmp *%eax + .align 4 + + .long 0, 1, 2, 3 // GUID + .long 0xfadefade + +__itt_pt_mark_call_table: +/// .fill 256,4,(0x0000c2c3 | (( . - __itt_pt_mark_call_table) << 14)) + ret + ret $0x0 + ret + ret $0x1 + ret + ret $0x2 + ret + ret $0x3 + ret + ret $0x4 + ret + ret $0x5 + ret + ret $0x6 + ret + ret $0x7 + ret + ret $0x8 + ret + ret $0x9 + ret + ret $0xa + ret + ret $0xb + ret + ret $0xc + ret + ret $0xd + ret + ret $0xe + ret + ret $0xf + + ret + ret $0x10 + ret + ret $0x11 + ret + ret $0x12 + ret + ret $0x13 + ret + ret $0x14 + ret + ret $0x15 + ret + ret $0x16 + ret + ret $0x17 + ret + ret $0x18 + ret + ret $0x19 + ret + ret $0x1a + ret + ret $0x1b + ret + ret $0x1c + ret + ret $0x1d + ret + ret $0x1e + ret + ret $0x1f + + ret + ret $0x20 + ret + ret $0x21 + ret + ret $0x22 + ret + ret $0x23 + ret + ret $0x24 + ret + ret $0x25 + ret + ret $0x26 + ret + ret $0x27 + ret + ret $0x28 + ret + ret $0x29 + ret + ret $0x2a + ret + ret $0x2b + ret + ret $0x2c + ret + ret $0x2d + ret + ret $0x2e + ret + ret $0x2f + + ret + ret $0x30 + ret + ret $0x31 + ret + ret $0x32 + ret + ret $0x33 + ret + ret $0x34 + ret + ret $0x35 + ret + ret $0x36 + ret + ret $0x37 + ret + ret $0x38 + ret + ret $0x39 + ret + ret $0x3a + ret + ret $0x3b + ret + ret $0x3c + ret + ret $0x3d + ret + ret $0x3e + ret + ret $0x3f + + ret + ret $0x40 + ret + ret $0x41 + ret + ret $0x42 + ret + ret $0x43 + ret + ret $0x44 + ret + ret $0x45 + ret + ret $0x46 + ret + ret $0x47 + ret + ret $0x48 + ret + ret $0x49 + ret + ret $0x4a + ret + ret $0x4b + ret + ret $0x4c + ret + ret $0x4d + ret + ret $0x4e + ret + ret $0x4f + + ret + ret $0x50 + ret + ret $0x51 + ret + ret $0x52 + ret + ret $0x53 + ret + ret $0x54 + ret + ret $0x55 + ret + ret $0x56 + ret + ret $0x57 + ret + ret $0x58 + ret + ret $0x59 + ret + ret $0x5a + ret + ret $0x5b + ret + ret $0x5c + ret + ret $0x5d + ret + ret $0x5e + ret + ret $0x5f + + ret + ret $0x60 + ret + ret $0x61 + ret + ret $0x62 + ret + ret $0x63 + ret + ret $0x64 + ret + ret $0x65 + ret + ret $0x66 + ret + ret $0x67 + ret + ret $0x68 + ret + ret $0x69 + ret + ret $0x6a + ret + ret $0x6b + ret + ret $0x6c + ret + ret $0x6d + ret + ret $0x6e + ret + ret $0x6f + + ret + ret $0x70 + ret + ret $0x71 + ret + ret $0x72 + ret + ret $0x73 + ret + ret $0x74 + ret + ret $0x75 + ret + ret $0x76 + ret + ret $0x77 + ret + ret $0x78 + ret + ret $0x79 + ret + ret $0x7a + ret + ret $0x7b + ret + ret $0x7c + ret + ret $0x7d + ret + ret $0x7e + ret + ret $0x7f + + ret + ret $0x80 + ret + ret $0x81 + ret + ret $0x82 + ret + ret $0x83 + ret + ret $0x84 + ret + ret $0x85 + ret + ret $0x86 + ret + ret $0x87 + ret + ret $0x88 + ret + ret $0x89 + ret + ret $0x8a + ret + ret $0x8b + ret + ret $0x8c + ret + ret $0x8d + ret + ret $0x8e + ret + ret $0x8f + + ret + ret $0x90 + ret + ret $0x91 + ret + ret $0x92 + ret + ret $0x93 + ret + ret $0x94 + ret + ret $0x95 + ret + ret $0x96 + ret + ret $0x97 + ret + ret $0x98 + ret + ret $0x99 + ret + ret $0x9a + ret + ret $0x9b + ret + ret $0x9c + ret + ret $0x9d + ret + ret $0x9e + ret + ret $0x9f + + ret + ret $0xa0 + ret + ret $0xa1 + ret + ret $0xa2 + ret + ret $0xa3 + ret + ret $0xa4 + ret + ret $0xa5 + ret + ret $0xa6 + ret + ret $0xa7 + ret + ret $0xa8 + ret + ret $0xa9 + ret + ret $0xaa + ret + ret $0xab + ret + ret $0xac + ret + ret $0xad + ret + ret $0xae + ret + ret $0xaf + + ret + ret $0xb0 + ret + ret $0xb1 + ret + ret $0xb2 + ret + ret $0xb3 + ret + ret $0xb4 + ret + ret $0xb5 + ret + ret $0xb6 + ret + ret $0xb7 + ret + ret $0xb8 + ret + ret $0xb9 + ret + ret $0xba + ret + ret $0xbb + ret + ret $0xbc + ret + ret $0xbd + ret + ret $0xbe + ret + ret $0xbf + + ret + ret $0xc0 + ret + ret $0xc1 + ret + ret $0xc2 + ret + ret $0xc3 + ret + ret $0xc4 + ret + ret $0xc5 + ret + ret $0xc6 + ret + ret $0xc7 + ret + ret $0xc8 + ret + ret $0xc9 + ret + ret $0xca + ret + ret $0xcb + ret + ret $0xcc + ret + ret $0xcd + ret + ret $0xce + ret + ret $0xcf + + ret + ret $0xd0 + ret + ret $0xd1 + ret + ret $0xd2 + ret + ret $0xd3 + ret + ret $0xd4 + ret + ret $0xd5 + ret + ret $0xd6 + ret + ret $0xd7 + ret + ret $0xd8 + ret + ret $0xd9 + ret + ret $0xda + ret + ret $0xdb + ret + ret $0xdc + ret + ret $0xdd + ret + ret $0xde + ret + ret $0xdf + + ret + ret $0xe0 + ret + ret $0xe1 + ret + ret $0xe2 + ret + ret $0xe3 + ret + ret $0xe4 + ret + ret $0xe5 + ret + ret $0xe6 + ret + ret $0xe7 + ret + ret $0xe8 + ret + ret $0xe9 + ret + ret $0xea + ret + ret $0xeb + ret + ret $0xec + ret + ret $0xed + ret + ret $0xee + ret + ret $0xef + + ret + ret $0xf0 + ret + ret $0xf1 + ret + ret $0xf2 + ret + ret $0xf3 + ret + ret $0xf4 + ret + ret $0xf5 + ret + ret $0xf6 + ret + ret $0xf7 + ret + ret $0xf8 + ret + ret $0xf9 + ret + ret $0xfa + ret + ret $0xfb + ret + ret $0xfc + ret + ret $0xfd + ret + ret $0xfe + ret + ret $0xff + + .align 16 + +__itt_pt_byte: + + movl 4(%esp), %ecx + +__itt_pt_byte_: + + and $0xff, %ecx + lea __itt_pt_byte_call_table(,%ecx,1), %ecx + jmp *%ecx + + .align 4 + + .long 0, 1, 2, 3 // GUID + .long 0xfadedeaf + +__itt_pt_byte_call_table: + + .fill 256,1,0xc3 + + .align 16 + +__itt_pt_event: + + push %ecx + mov 8(%esp), %ecx + rdpmc + + mov %al,%cl + call __itt_pt_byte_ + shr $8,%eax + mov %al,%cl + call __itt_pt_byte_ + shr $8,%eax + mov %al,%cl + call __itt_pt_byte_ + shr $8,%eax + mov %al,%cl + call __itt_pt_byte_ + + mov %dl,%cl + call __itt_pt_byte_ + shr $8,%edx + mov %dl,%cl + call __itt_pt_byte_ + shr $8,%edx + mov %dl,%cl + call __itt_pt_byte_ + shr $8,%edx + mov %dl,%cl + call __itt_pt_byte_ + + pop %ecx + ret + + .align 16 + +__itt_pt_mark_event: + + testl $1,4(%esp) + jnz odd + pushl $0 + call __itt_pt_event + add $2,%esp + jmp __itt_pt_mark + +odd: + pushl 4(%esp) + call __itt_pt_mark + add $2,%esp + movl $0,4(%esp) + jmp __itt_pt_event + + + .align 16 + +__itt_pt_flush: + + lea __itt_pt_mark_flush_1,%eax + jmp *%eax + + .align 16 + nop +__itt_pt_mark_flush_1: + lea __itt_pt_mark_flush_2,%eax + jmp *%eax + + .align 16 + nop + nop +__itt_pt_mark_flush_2: + lea __itt_pt_mark_flush_3,%eax + jmp *%eax + + .align 16 + nop + nop + nop +__itt_pt_mark_flush_3: + ret + + .align 16 + +// int __itt_pt_mark_threshold(unsigned char index, unsigned long long* tmp, int threshold); + +__itt_pt_mark_threshold: + // 4(%esp) == index + // 8(%esp) == tmp + // 12(%esp) == threshold + xor %edx,%edx + xor %eax,%eax + + testl $1,4(%esp) + jnz mark_end +mark_begin: + mov $((1 << 30) + 1),%ecx + rdpmc + mov 8(%esp), %ecx + mov %eax, (%ecx) + mov %edx,4(%ecx) + jmp __itt_pt_mark +mark_end: + mov $((1 << 30) + 1),%ecx + rdpmc + mov 8(%esp), %ecx + sub (%ecx), %eax + sbb 4(%ecx), %edx + + sub 12(%esp), %eax // threshold + jnc found + sbb $0, %edx + jnc found + jmp __itt_pt_mark +found: + call __itt_pt_mark + jmp __itt_pt_flush + +// PTWRITE + + .align 16 + +// void __itt_pt_write(unsigned long long value); + + .long 0, 1, 2, 3 // GUID + +__itt_pt_write: + +// ptwrite dword ptr [esp + 4] + .byte 0xF3, 0x0F, 0xAE, 0x64, 0x24, 0x04 + ret diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.asm b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.asm new file mode 100644 index 00000000000000..5fde394e9e174f --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark32.asm @@ -0,0 +1,255 @@ +COMMENT @ + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + Contact Information: + http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ + + BSD LICENSE + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ + +;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; ;;; Intel Processor Trace Marker Functionality +;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +.686p +.xmm +.model FLAT + +_TEXT segment + + public ___itt_pt_mark + public ___itt_pt_event + public ___itt_pt_mark_event + public ___itt_pt_mark_threshold + public ___itt_pt_write + public ___itt_pt_byte + + align 10h + +;;; void __itt_pt_mark(unsigned char index); + +___itt_pt_mark proc near + + movzx eax,byte ptr [esp + 4] + lea eax,__itt_pt_mark_call_table[eax * 4] + jmp eax + + align 04h + + dd 0, 1, 2, 3 ;;; GUID + + dd 0fadefadeh ;;; magic marker + +__itt_pt_mark_call_table: + + dd 256 dup(0000c2c3h OR (( $ - offset __itt_pt_mark_call_table) SHL 14)) + +___itt_pt_mark endp + + +___itt_pt_byte proc near + + mov ecx,[esp + 4] + +___itt_pt_byte_:: + + and ecx,0ffh + lea ecx,__itt_pt_byte_call_table[ecx] + jmp ecx + + align 04h + + dd 0, 1, 2, 3 ;;; GUID + + dd 0fadedeafh ;;; magic marker + +__itt_pt_byte_call_table: + + db 256 dup(0c3h) + +___itt_pt_byte endp + + align 10h + +___itt_pt_event proc near + + push ecx + mov ecx,[esp + 8] + rdpmc + + mov cl,al + call ___itt_pt_byte_ + mov cl,ah + call ___itt_pt_byte_ + shr eax,16 + mov cl,al + call ___itt_pt_byte_ + mov cl,ah + call ___itt_pt_byte_ + + mov cl,dl + call ___itt_pt_byte_ + mov cl,dh + call ___itt_pt_byte_ + shr edx,16 + mov cl,dl + call ___itt_pt_byte_ + mov cl,dh + call ___itt_pt_byte_ + + pop ecx + ret + +___itt_pt_event endp + + align 10h + +___itt_pt_mark_event proc near + + test byte ptr [esp + 4],1 + jnz odd + push 0 + call ___itt_pt_event + add esp,4 + jmp ___itt_pt_mark + +odd: + push dword ptr [esp + 4] + call ___itt_pt_mark + add esp,4 + mov dword ptr [esp + 4],0 + jmp ___itt_pt_event + +___itt_pt_mark_event endp + + align 10h + +___itt_pt_flush proc near + + lea eax,offset __itt_pt_mark_flush_1 + jmp eax + + align 10h + nop +__itt_pt_mark_flush_1: + lea eax,offset __itt_pt_mark_flush_2 + jmp eax + + align 10h + nop + nop +__itt_pt_mark_flush_2: + lea eax,offset __itt_pt_mark_flush_3 + jmp eax + + align 10h + nop + nop + nop +__itt_pt_mark_flush_3: + ret + +___itt_pt_flush endp + + align 10h + +;;; int __itt_pt_mark_threshold(unsigned char index, unsigned long long* tmp, int threshold); + +___itt_pt_mark_threshold proc near + test byte ptr [esp + 4],1 ;;; index + jnz mark_end +mark_begin: + mov ecx,(1 SHL 30) + 1 + rdpmc + mov ecx,[esp + 8] ;;; tmp + mov [ecx + 0],eax + mov [ecx + 4],edx + jmp ___itt_pt_mark +mark_end: + mov ecx,(1 SHL 30) + 1 + rdpmc + mov ecx,[esp + 8] ;;; tmp + sub eax,[ecx + 0] + sbb edx,[ecx + 4] + or edx,edx + jnz found + cmp edx,[esp + 12] ;;; threshold + jnc found + jmp ___itt_pt_mark +found: + call ___itt_pt_mark + jmp ___itt_pt_flush + +___itt_pt_mark_threshold endp + +;;; PTWRITE + + align 10h + +;;; void __itt_pt_write(unsigned long long value); + + dd 0, 1, 2, 3 ;;; GUID + +___itt_pt_write proc + +;;; ptwrite dword ptr [esp + 4] + db 0F3h, 0Fh, 0AEh, 64h, 24h, 04h + ret + +___itt_pt_write endp + +;;; + +_TEXT ends + end diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.S b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.S new file mode 100644 index 00000000000000..25b2058d57b138 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.S @@ -0,0 +1,766 @@ +/* + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + Contact Information: + http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ + + BSD LICENSE + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// ///////////////////////////////////////////////////////////////////////// +////// Intel Processor Trace Marker Functionality +//////////////////////////////////////////////////////////////////////////// + + .text + .align 16 + .globl __itt_pt_mark + .globl __itt_pt_event + .globl __itt_pt_mark_event + .globl __itt_pt_mark_threshold + .globl __itt_pt_byte + .globl __itt_pt_write + +/// void __itt_pt_mark(unsigned char index); +__itt_pt_mark: +__itt_pt_mark_int: + and $0xff, %rdi + call __itt_pt_mark_pic +__itt_pt_mark_pic: + popq %rax + lea (__itt_pt_mark_call_table - __itt_pt_mark_pic) (%rax,%rdi,4), %rdi + jmp *%rdi + + .long 0, 1, 2, 3 // GUID + .long 0xfadefade + +__itt_pt_mark_call_table: + retq + retq $0x0 + retq + retq $0x1 + retq + retq $0x2 + retq + retq $0x3 + retq + retq $0x4 + retq + retq $0x5 + retq + retq $0x6 + retq + retq $0x7 + retq + retq $0x8 + retq + retq $0x9 + retq + retq $0xa + retq + retq $0xb + retq + retq $0xc + retq + retq $0xd + retq + retq $0xe + retq + retq $0xf + + retq + retq $0x10 + retq + retq $0x11 + retq + retq $0x12 + retq + retq $0x13 + retq + retq $0x14 + retq + retq $0x15 + retq + retq $0x16 + retq + retq $0x17 + retq + retq $0x18 + retq + retq $0x19 + retq + retq $0x1a + retq + retq $0x1b + retq + retq $0x1c + retq + retq $0x1d + retq + retq $0x1e + retq + retq $0x1f + + retq + retq $0x20 + retq + retq $0x21 + retq + retq $0x22 + retq + retq $0x23 + retq + retq $0x24 + retq + retq $0x25 + retq + retq $0x26 + retq + retq $0x27 + retq + retq $0x28 + retq + retq $0x29 + retq + retq $0x2a + retq + retq $0x2b + retq + retq $0x2c + retq + retq $0x2d + retq + retq $0x2e + retq + retq $0x2f + + retq + retq $0x30 + retq + retq $0x31 + retq + retq $0x32 + retq + retq $0x33 + retq + retq $0x34 + retq + retq $0x35 + retq + retq $0x36 + retq + retq $0x37 + retq + retq $0x38 + retq + retq $0x39 + retq + retq $0x3a + retq + retq $0x3b + retq + retq $0x3c + retq + retq $0x3d + retq + retq $0x3e + retq + retq $0x3f + + retq + retq $0x40 + retq + retq $0x41 + retq + retq $0x42 + retq + retq $0x43 + retq + retq $0x44 + retq + retq $0x45 + retq + retq $0x46 + retq + retq $0x47 + retq + retq $0x48 + retq + retq $0x49 + retq + retq $0x4a + retq + retq $0x4b + retq + retq $0x4c + retq + retq $0x4d + retq + retq $0x4e + retq + retq $0x4f + + retq + retq $0x50 + retq + retq $0x51 + retq + retq $0x52 + retq + retq $0x53 + retq + retq $0x54 + retq + retq $0x55 + retq + retq $0x56 + retq + retq $0x57 + retq + retq $0x58 + retq + retq $0x59 + retq + retq $0x5a + retq + retq $0x5b + retq + retq $0x5c + retq + retq $0x5d + retq + retq $0x5e + retq + retq $0x5f + + retq + retq $0x60 + retq + retq $0x61 + retq + retq $0x62 + retq + retq $0x63 + retq + retq $0x64 + retq + retq $0x65 + retq + retq $0x66 + retq + retq $0x67 + retq + retq $0x68 + retq + retq $0x69 + retq + retq $0x6a + retq + retq $0x6b + retq + retq $0x6c + retq + retq $0x6d + retq + retq $0x6e + retq + retq $0x6f + + retq + retq $0x70 + retq + retq $0x71 + retq + retq $0x72 + retq + retq $0x73 + retq + retq $0x74 + retq + retq $0x75 + retq + retq $0x76 + retq + retq $0x77 + retq + retq $0x78 + retq + retq $0x79 + retq + retq $0x7a + retq + retq $0x7b + retq + retq $0x7c + retq + retq $0x7d + retq + retq $0x7e + retq + retq $0x7f + + retq + retq $0x80 + retq + retq $0x81 + retq + retq $0x82 + retq + retq $0x83 + retq + retq $0x84 + retq + retq $0x85 + retq + retq $0x86 + retq + retq $0x87 + retq + retq $0x88 + retq + retq $0x89 + retq + retq $0x8a + retq + retq $0x8b + retq + retq $0x8c + retq + retq $0x8d + retq + retq $0x8e + retq + retq $0x8f + + retq + retq $0x90 + retq + retq $0x91 + retq + retq $0x92 + retq + retq $0x93 + retq + retq $0x94 + retq + retq $0x95 + retq + retq $0x96 + retq + retq $0x97 + retq + retq $0x98 + retq + retq $0x99 + retq + retq $0x9a + retq + retq $0x9b + retq + retq $0x9c + retq + retq $0x9d + retq + retq $0x9e + retq + retq $0x9f + + retq + retq $0xa0 + retq + retq $0xa1 + retq + retq $0xa2 + retq + retq $0xa3 + retq + retq $0xa4 + retq + retq $0xa5 + retq + retq $0xa6 + retq + retq $0xa7 + retq + retq $0xa8 + retq + retq $0xa9 + retq + retq $0xaa + retq + retq $0xab + retq + retq $0xac + retq + retq $0xad + retq + retq $0xae + retq + retq $0xaf + + retq + retq $0xb0 + retq + retq $0xb1 + retq + retq $0xb2 + retq + retq $0xb3 + retq + retq $0xb4 + retq + retq $0xb5 + retq + retq $0xb6 + retq + retq $0xb7 + retq + retq $0xb8 + retq + retq $0xb9 + retq + retq $0xba + retq + retq $0xbb + retq + retq $0xbc + retq + retq $0xbd + retq + retq $0xbe + retq + retq $0xbf + + retq + retq $0xc0 + retq + retq $0xc1 + retq + retq $0xc2 + retq + retq $0xc3 + retq + retq $0xc4 + retq + retq $0xc5 + retq + retq $0xc6 + retq + retq $0xc7 + retq + retq $0xc8 + retq + retq $0xc9 + retq + retq $0xca + retq + retq $0xcb + retq + retq $0xcc + retq + retq $0xcd + retq + retq $0xce + retq + retq $0xcf + + retq + retq $0xd0 + retq + retq $0xd1 + retq + retq $0xd2 + retq + retq $0xd3 + retq + retq $0xd4 + retq + retq $0xd5 + retq + retq $0xd6 + retq + retq $0xd7 + retq + retq $0xd8 + retq + retq $0xd9 + retq + retq $0xda + retq + retq $0xdb + retq + retq $0xdc + retq + retq $0xdd + retq + retq $0xde + retq + retq $0xdf + + retq + retq $0xe0 + retq + retq $0xe1 + retq + retq $0xe2 + retq + retq $0xe3 + retq + retq $0xe4 + retq + retq $0xe5 + retq + retq $0xe6 + retq + retq $0xe7 + retq + retq $0xe8 + retq + retq $0xe9 + retq + retq $0xea + retq + retq $0xeb + retq + retq $0xec + retq + retq $0xed + retq + retq $0xee + retq + retq $0xef + + retq + retq $0xf0 + retq + retq $0xf1 + retq + retq $0xf2 + retq + retq $0xf3 + retq + retq $0xf4 + retq + retq $0xf5 + retq + retq $0xf6 + retq + retq $0xf7 + retq + retq $0xf8 + retq + retq $0xf9 + retq + retq $0xfa + retq + retq $0xfb + retq + retq $0xfc + retq + retq $0xfd + retq + retq $0xfe + retq + retq $0xff + + .align 16 + +__itt_pt_byte: +__itt_pt_byte_int: + + and $0xff, %rdi + call __itt_pt_byte_pic +__itt_pt_byte_pic: + popq %rcx + lea (__itt_pt_byte_call_table - __itt_pt_byte_pic) (%rcx,%rdi,1), %rdi + jmp *%rdi + + .align 4 + + .long 0, 1, 2, 3 // GUID + + .long 0xfadedeaf + +__itt_pt_byte_call_table: + + .fill 256,1,0xc3 + + .align 16 + +__itt_pt_event: +__itt_pt_event_int: + + pushq %rcx + mov %rdi,%rcx + rdpmc + + xor %rdi, %rdi + mov %al, %dil + call __itt_pt_byte_int + shr $8, %eax + mov %al, %dil + call __itt_pt_byte_int + shr $8, %eax + mov %al, %dil + call __itt_pt_byte_int + shr $8, %eax + mov %al, %dil + call __itt_pt_byte_int + + mov %dl, %dil + call __itt_pt_byte_int + shr $8, %edx + mov %dl, %dil + call __itt_pt_byte_int + shr $8, %edx + mov %dl, %dil + call __itt_pt_byte_int + shr $8, %edx + mov %dl, %dil + call __itt_pt_byte_int + + popq %rcx + ret + + .align 16 + +__itt_pt_mark_event: + + test $1, %rdi + jnz odd + mov %rdi, %rsi + xor %rdi,%rdi + call __itt_pt_event_int + mov %rsi, %rdi + jmp __itt_pt_mark_int + +odd: + call __itt_pt_mark_int + xor %rdi,%rdi + jmp __itt_pt_event_int + + + .align 16 + +__itt_pt_flush: + + call __itt_pt_flush_pic +__itt_pt_flush_pic: + popq %rdx + lea (__itt_pt_mark_flush_1 - __itt_pt_flush_pic) (%rdx), %rax + jmp *%rax + + .align 16 + nop +__itt_pt_mark_flush_1: + lea (__itt_pt_mark_flush_2 - __itt_pt_flush_pic) (%rdx), %rax + jmp *%rax + + .align 16 + nop + nop +__itt_pt_mark_flush_2: + lea (__itt_pt_mark_flush_3 - __itt_pt_flush_pic) (%rdx), %rax + jmp *%rax + + .align 16 + nop + nop + nop +__itt_pt_mark_flush_3: + ret + + .align 16 + +// int __itt_pt_mark_threshold(unsigned char index, unsigned long long* tmp, int threshold); + +__itt_pt_mark_threshold: + // rdi == index + // rsi == tmp + // rdx == threshold + mov %rdx, %r8 // r8 = threshold + xor %rdx, %rdx + xor %rax, %rax + test $1, %rdi + jnz mark_end +mark_begin: + mov $((1 << 30) + 1),%rcx + rdpmc + shl $32, %rdx + or %rax, %rdx + mov %rdx, (%rsi) + jmp __itt_pt_mark_int +mark_end: + mov $((1 << 30) + 1),%rcx + rdpmc + shl $32, %rdx + or %rax, %rdx + sub (%rsi), %rdx + cmp %r8, %rdx // threshold + jnc found + jmp __itt_pt_mark_int +found: + call __itt_pt_mark_int + jmp __itt_pt_flush + +// PTWRITE + + .align 16 + +// void __itt_pt_write(unsigned long long value); + + .long 0, 1, 2, 3 // GUID + +__itt_pt_write: + +// ptwrite rcx + .byte 0xF3, 0x48, 0x0F, 0xAE, 0xE1 + ret diff --git a/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.asm b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.asm new file mode 100644 index 00000000000000..3ea108d67e9d88 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/ittptmark64.asm @@ -0,0 +1,251 @@ +COMMENT @ + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + Contact Information: + http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ + + BSD LICENSE + + Copyright (c) 2017-2020 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ + +;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; ;;; Intel Processor Trace Marker Functionality +;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +_TEXT segment + + public __itt_pt_mark + public __itt_pt_event + public __itt_pt_mark_event + public __itt_pt_mark_threshold + public __itt_pt_write + public __itt_pt_byte + + align 10h + +;;; void __itt_pt_mark(unsigned char index); + +__itt_pt_mark proc + + and rcx,0ffh + lea r10,offset __itt_pt_mark_call_table + lea rcx,[r10 + rcx * 4] + jmp rcx + + align 04h + + dd 0, 1, 2, 3 ;;; GUID + + dd 0fadefadeh ;;; magic marker + +__itt_pt_mark_call_table: + + dd 256 dup(0000c2c3h OR (( $ - offset __itt_pt_mark_call_table) SHL 14)) + +__itt_pt_mark endp + + align 10h + +__itt_pt_byte proc + + and rcx,0ffh + lea r10,offset __itt_pt_byte_call_table + add rcx,r10 + jmp rcx + + align 04h + + dd 0, 1, 2, 3 ;;; GUID + + dd 0fadedeafh ;;; magic marker + +__itt_pt_byte_call_table: + + db 256 dup(0c3h) + +__itt_pt_byte endp + + align 10h + +__itt_pt_event proc + + rdpmc + + mov cl,al + call __itt_pt_byte + mov cl,ah + call __itt_pt_byte + shr eax,16 + mov cl,al + call __itt_pt_byte + mov cl,ah + call __itt_pt_byte + + mov cl,dl + call __itt_pt_byte + mov cl,dh + call __itt_pt_byte + shr edx,16 + mov cl,dl + call __itt_pt_byte + mov cl,dh + call __itt_pt_byte + + ret + +__itt_pt_event endp + + align 10h + +__itt_pt_mark_event proc + + test rcx,1 + jnz odd + mov r8,rcx + xor rcx,rcx + call __itt_pt_event + mov rcx,r8 + jmp __itt_pt_mark + +odd: + call __itt_pt_mark + xor rcx,rcx + jmp __itt_pt_event + +__itt_pt_mark_event endp + + align 10h + +__itt_pt_flush proc + + lea rax,offset __itt_pt_mark_flush_1 + jmp rax + + align 10h + nop +__itt_pt_mark_flush_1: + lea rax,offset __itt_pt_mark_flush_2 + jmp rax + + align 10h + nop + nop +__itt_pt_mark_flush_2: + lea rax,offset __itt_pt_mark_flush_3 + jmp rax + + align 10h + nop + nop + nop +__itt_pt_mark_flush_3: + ret + +__itt_pt_flush endp + + align 10h + +;;; int __itt_pt_mark_threshold(unsigned char index, unsigned long long* tmp, int threshold); + +__itt_pt_mark_threshold proc + mov r9,rcx ;;; index + mov r10,rdx ;;; tmp + xor rdx,rdx + xor rax,rax + test rcx,1 + jnz mark_end +mark_begin: + mov rcx,(1 SHL 30) + 1 + rdpmc + shl rdx,32 + or rdx,rax + mov [r10],rdx + mov rcx,r9 + jmp __itt_pt_mark +mark_end: + mov rcx,(1 SHL 30) + 1 + rdpmc + shl rdx,32 + or rdx,rax + sub rdx,[r10] + cmp rdx,r8 ;;; threshold + mov rcx,r9 + jnc found + jmp __itt_pt_mark +found: + call __itt_pt_mark + jmp __itt_pt_flush + +__itt_pt_mark_threshold endp + +;;; PTWRITE + + align 10h + +;;; void __itt_pt_write(unsigned long long value); + + dd 0, 1, 2, 3 ;;; GUID + +__itt_pt_write proc + +;;; ptwrite rcx + db 0F3h, 48h, 0Fh, 0AEh, 0E1h + ret + +__itt_pt_write endp + +;;; + +_TEXT ends + end diff --git a/deps/v8/third_party/ittapi/src/ittnotify/jitprofiling.c b/deps/v8/third_party/ittapi/src/ittnotify/jitprofiling.c new file mode 100644 index 00000000000000..9c372db2e8d8e6 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify/jitprofiling.c @@ -0,0 +1,268 @@ +/* + Copyright (C) 2005-2019 Intel Corporation + + SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause +*/ + +#include "ittnotify_config.h" + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#include +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ +#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD +#include +#endif +#include + +#include "jitprofiling.h" + +static const char rcsid[] = "\n@(#) $Revision$\n"; + +#define DLL_ENVIRONMENT_VAR "VS_PROFILER" + +#ifndef NEW_DLL_ENVIRONMENT_VAR +#if ITT_ARCH==ITT_ARCH_IA32 +#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER32" +#else +#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER64" +#endif +#endif /* NEW_DLL_ENVIRONMENT_VAR */ + +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define DEFAULT_DLLNAME "JitPI.dll" +HINSTANCE m_libHandle = NULL; +#elif ITT_PLATFORM==ITT_PLATFORM_MAC +#define DEFAULT_DLLNAME "libJitPI.dylib" +void* m_libHandle = NULL; +#else +#define DEFAULT_DLLNAME "libJitPI.so" +void* m_libHandle = NULL; +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + +/* default location of JIT profiling agent on Android */ +#define ANDROID_JIT_AGENT_PATH "/data/intel/libittnotify.so" + +/* the function pointers */ +typedef unsigned int(JITAPI *TPInitialize)(void); +static TPInitialize FUNC_Initialize=NULL; + +typedef unsigned int(JITAPI *TPNotify)(unsigned int, void*); +static TPNotify FUNC_NotifyEvent=NULL; + +static iJIT_IsProfilingActiveFlags executionMode = iJIT_NOTHING_RUNNING; + +/* end collector dll part. */ + +/* loadiJIT_Funcs() : this function is called just in the beginning + * and is responsible to load the functions from BistroJavaCollector.dll + * result: + * on success: the functions loads, iJIT_DLL_is_missing=0, return value = 1 + * on failure: the functions are NULL, iJIT_DLL_is_missing=1, return value = 0 + */ +static int loadiJIT_Funcs(void); + +/* global representing whether the collector can't be loaded */ +static int iJIT_DLL_is_missing = 0; + +ITT_EXTERN_C int JITAPI +iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData) +{ + int ReturnValue = 0; + + /* initialization part - the collector has not been loaded yet. */ + if (!FUNC_NotifyEvent) + { + if (iJIT_DLL_is_missing) + return 0; + + if (!loadiJIT_Funcs()) + return 0; + } + + if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED || + event_type == iJVM_EVENT_TYPE_METHOD_UPDATE) + { + if (((piJIT_Method_Load)EventSpecificData)->method_id == 0) + return 0; + } + else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2) + { + if (((piJIT_Method_Load_V2)EventSpecificData)->method_id == 0) + return 0; + } + else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3) + { + if (((piJIT_Method_Load_V3)EventSpecificData)->method_id == 0) + return 0; + } + else if (event_type == iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED) + { + if (((piJIT_Method_Inline_Load)EventSpecificData)->method_id == 0 || + ((piJIT_Method_Inline_Load)EventSpecificData)->parent_method_id == 0) + return 0; + } + + ReturnValue = (int)FUNC_NotifyEvent(event_type, EventSpecificData); + + return ReturnValue; +} + +ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive() +{ + if (!iJIT_DLL_is_missing) + { + loadiJIT_Funcs(); + } + + return executionMode; +} + +/* This function loads the collector dll and the relevant functions. + * on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1 + * on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0 + */ +static int loadiJIT_Funcs() +{ + static int bDllWasLoaded = 0; + char *dllName = (char*)rcsid; /* !! Just to avoid unused code elimination */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN + DWORD dNameLength = 0; +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + + if(bDllWasLoaded) + { + /* dll was already loaded, no need to do it for the second time */ + return 1; + } + + /* Assumes that the DLL will not be found */ + iJIT_DLL_is_missing = 1; + FUNC_NotifyEvent = NULL; + + if (m_libHandle) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + FreeLibrary(m_libHandle); +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + dlclose(m_libHandle); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + m_libHandle = NULL; + } + + /* Try to get the dll name from the environment */ +#if ITT_PLATFORM==ITT_PLATFORM_WIN + dNameLength = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, NULL, 0); + if (dNameLength) + { + DWORD envret = 0; + dllName = (char*)malloc(sizeof(char) * (dNameLength + 1)); + if(dllName != NULL) + { + envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, + dllName, dNameLength); + if (envret) + { + /* Try to load the dll from the PATH... */ + m_libHandle = LoadLibraryExA(dllName, + NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } + free(dllName); + } + } else { + /* Try to use old VS_PROFILER variable */ + dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0); + if (dNameLength) + { + DWORD envret = 0; + dllName = (char*)malloc(sizeof(char) * (dNameLength + 1)); + if(dllName != NULL) + { + envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, + dllName, dNameLength); + if (envret) + { + /* Try to load the dll from the PATH... */ + m_libHandle = LoadLibraryA(dllName); + } + free(dllName); + } + } + } +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + dllName = getenv(NEW_DLL_ENVIRONMENT_VAR); + if (!dllName) + dllName = getenv(DLL_ENVIRONMENT_VAR); +#if defined(__ANDROID__) || defined(ANDROID) + if (!dllName) + dllName = ANDROID_JIT_AGENT_PATH; +#endif + if (dllName) + { + /* Try to load the dll from the PATH... */ + if (DL_SYMBOLS) + { + m_libHandle = dlopen(dllName, RTLD_LAZY); + } + } +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + + if (!m_libHandle) + { +#if ITT_PLATFORM==ITT_PLATFORM_WIN + m_libHandle = LoadLibraryA(DEFAULT_DLLNAME); +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + if (DL_SYMBOLS) + { + m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY); + } +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + } + + /* if the dll wasn't loaded - exit. */ + if (!m_libHandle) + { + iJIT_DLL_is_missing = 1; /* don't try to initialize + * JIT agent the second time + */ + return 0; + } + +#if ITT_PLATFORM==ITT_PLATFORM_WIN + FUNC_NotifyEvent = (TPNotify)GetProcAddress(m_libHandle, "NotifyEvent"); +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + FUNC_NotifyEvent = (TPNotify)dlsym(m_libHandle, "NotifyEvent"); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + if (!FUNC_NotifyEvent) + { + FUNC_Initialize = NULL; + return 0; + } + +#if ITT_PLATFORM==ITT_PLATFORM_WIN + FUNC_Initialize = (TPInitialize)GetProcAddress(m_libHandle, "Initialize"); +#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + FUNC_Initialize = (TPInitialize)dlsym(m_libHandle, "Initialize"); +#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ + if (!FUNC_Initialize) + { + FUNC_NotifyEvent = NULL; + return 0; + } + + executionMode = (iJIT_IsProfilingActiveFlags)FUNC_Initialize(); + + bDllWasLoaded = 1; + iJIT_DLL_is_missing = 0; /* DLL is ok. */ + + return 1; +} + +ITT_EXTERN_C unsigned int JITAPI iJIT_GetNewMethodID() +{ + static unsigned int methodID = 1; + + if (methodID == 0) + return 0; /* ERROR : this is not a valid value */ + + return methodID++; +} diff --git a/deps/v8/third_party/ittapi/src/ittnotify_refcol/Makefile b/deps/v8/third_party/ittapi/src/ittnotify_refcol/Makefile new file mode 100644 index 00000000000000..5500c92306b8de --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify_refcol/Makefile @@ -0,0 +1,14 @@ +INCLUDE_DIR = ../../include/ +SRC_DIR = ../ittnotify/ +SOURCE_NAME = itt_refcol_impl.c +OBJ_NAME = itt_refcol_impl.o +LIB_NAME = libittrefcol.so +CC ?= gcc +CFLAGS = -I$(INCLUDE_DIR) -I$(SRC_DIR) + +build: + $(CC) -fPIC $(CFLAGS) -c $(SOURCE_NAME) + $(CC) -shared -o $(LIB_NAME) $(OBJ_NAME) + +clean: + rm $(OBJ_NAME) $(LIB_NAME) diff --git a/deps/v8/third_party/ittapi/src/ittnotify_refcol/README.md b/deps/v8/third_party/ittapi/src/ittnotify_refcol/README.md new file mode 100644 index 00000000000000..a6180b0536a89f --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify_refcol/README.md @@ -0,0 +1,26 @@ +This is a reference implementation of the ITT API _dynamic part_ +that performs tracing data from ITT API functions calls to log files. + +To use this solution it is requered to build it like a shared library and add +full library path to the `INTEL_LIBITTNOTIFY64/INTEL_LIBITTNOTIFY32` environment variable: +``` +make +export INTEL_LIBITTNOTIFY64=/libittnotify_refcol.so +``` + +Temp directory is used by default to save log files. +To change log directory use the `INTEL_LIBITTNOTIFY_LOG_DIR` environment variable: +``` +export INTEL_LIBITTNOTIFY_LOG_DIR= +``` + +This implementation adds logging of some of the ITT API functions calls. +Adding logging of the other ITT API functions calls are welcome. +The solution provides 4 functions with different log levels +that takes printf format for logging: +``` +LOG_FUNC_CALL_INFO(const char *msg_format, ...); +LOG_FUNC_CALL_WARN(const char *msg_format, ...); +LOG_FUNC_CALL_ERROR(const char *msg_format, ...); +LOG_FUNC_CALL_FATAL(const char *msg_format, ...); +``` diff --git a/deps/v8/third_party/ittapi/src/ittnotify_refcol/itt_refcol_impl.c b/deps/v8/third_party/ittapi/src/ittnotify_refcol/itt_refcol_impl.c new file mode 100644 index 00000000000000..e463408ee67504 --- /dev/null +++ b/deps/v8/third_party/ittapi/src/ittnotify_refcol/itt_refcol_impl.c @@ -0,0 +1,277 @@ +#include +#include +#include +#include +#include + +#define INTEL_NO_MACRO_BODY +#define INTEL_ITTNOTIFY_API_PRIVATE +#include "ittnotify.h" +#include "ittnotify_config.h" + +#define LOG_BUFFER_MAX_SIZE 256 + +static const char* env_log_dir = "INTEL_LIBITTNOTIFY_LOG_DIR"; +static const char* log_level_str[] = {"INFO", "WARN", "ERROR", "FATAL_ERROR"}; + +enum { + LOG_LVL_INFO, + LOG_LVL_WARN, + LOG_LVL_ERROR, + LOG_LVL_FATAL +}; + +static struct ref_collector_logger { + char* file_name; + uint8_t init_state; +} g_ref_collector_logger = {NULL, 0}; + +char* log_file_name_generate() +{ + time_t time_now = time(NULL); + struct tm* time_info = localtime(&time_now); + char* log_file_name = malloc(sizeof(char) * (LOG_BUFFER_MAX_SIZE/2)); + + sprintf(log_file_name,"libittnotify_refcol_%d%d%d%d%d%d.log", + time_info->tm_year+1900, time_info->tm_mon+1, time_info->tm_mday, + time_info->tm_hour, time_info->tm_min, time_info->tm_sec); + + return log_file_name; +} + +void ref_col_init() +{ + if (!g_ref_collector_logger.init_state) + { + static char file_name_buffer[LOG_BUFFER_MAX_SIZE*2]; + char* log_dir = getenv(env_log_dir); + char* log_file = log_file_name_generate(); + + if (log_dir != NULL) + { + #ifdef _WIN32 + sprintf(file_name_buffer,"%s\\%s", log_dir, log_file); + #else + sprintf(file_name_buffer,"%s/%s", log_dir, log_file); + #endif + } + else + { + #ifdef _WIN32 + char* temp_dir = getenv("TEMP"); + if (temp_dir != NULL) + { + sprintf(file_name_buffer,"%s\\%s", temp_dir, log_file); + } + #else + sprintf(file_name_buffer,"/tmp/%s", log_file); + #endif + } + + g_ref_collector_logger.file_name = file_name_buffer; + g_ref_collector_logger.init_state = 1; + } +} + +static void fill_func_ptr_per_lib(__itt_global* p) +{ + __itt_api_info* api_list = (__itt_api_info*)p->api_list_ptr; + + for (int i = 0; api_list[i].name != NULL; i++) + { + *(api_list[i].func_ptr) = (void*)__itt_get_proc(p->lib, api_list[i].name); + if (*(api_list[i].func_ptr) == NULL) + { + *(api_list[i].func_ptr) = api_list[i].null_func; + } + } +} + +ITT_EXTERN_C void ITTAPI __itt_api_init(__itt_global* p, __itt_group_id init_groups) +{ + if (p != NULL) + { + fill_func_ptr_per_lib(p); + ref_col_init(); + } + else + { + printf("ERROR: Failed to initialize dynamic library\n"); + } +} + +void log_func_call(uint8_t log_level, const char* function_name, const char* message_format, ...) +{ + if (g_ref_collector_logger.init_state) + { + FILE * pLogFile = NULL; + char log_buffer[LOG_BUFFER_MAX_SIZE]; + uint32_t result_len = 0; + va_list message_args; + + result_len += sprintf(log_buffer, "[%s] %s(...) - ", log_level_str[log_level] ,function_name); + va_start(message_args, message_format); + vsnprintf(log_buffer + result_len, LOG_BUFFER_MAX_SIZE - result_len, message_format, message_args); + + pLogFile = fopen(g_ref_collector_logger.file_name, "a"); + if (!pLogFile) + { + printf("ERROR: Cannot open file: %s\n", g_ref_collector_logger.file_name); + return; + } + fprintf(pLogFile, "%s\n", log_buffer); + fclose(pLogFile); + } + else + { + return; + } +} + +#define LOG_FUNC_CALL_INFO(...) log_func_call(LOG_LVL_INFO, __FUNCTION__, __VA_ARGS__) +#define LOG_FUNC_CALL_WARN(...) log_func_call(LOG_LVL_WARN, __FUNCTION__, __VA_ARGS__) +#define LOG_FUNC_CALL_ERROR(...) log_func_call(LOG_LVL_ERROR, __FUNCTION__, __VA_ARGS__) +#define LOG_FUNC_CALL_FATAL(...) log_func_call(LOG_LVL_FATAL, __FUNCTION__, __VA_ARGS__) + +/* ------------------------------------------------------------------------------ */ +/* The code below is a reference implementation of the ITT API dynamic collector. */ +/* This implementation is designed to log ITTAPI functions calls.*/ +/* ------------------------------------------------------------------------------ */ + +char* get_metadata_elements(size_t size, __itt_metadata_type type, void* metadata) +{ + char* metadata_str = malloc(sizeof(char) * LOG_BUFFER_MAX_SIZE); + *metadata_str = '\0'; + + switch (type) + { + case __itt_metadata_u64: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%llu;", metadata_str, ((uint64_t*)metadata)[i]); + break; + case __itt_metadata_s64: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%lld;", metadata_str, ((int64_t*)metadata)[i]); + break; + case __itt_metadata_u32: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%lu;", metadata_str, ((uint32_t*)metadata)[i]); + break; + case __itt_metadata_s32: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%ld;", metadata_str, ((int32_t*)metadata)[i]); + break; + case __itt_metadata_u16: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%u;", metadata_str, ((uint16_t*)metadata)[i]); + break; + case __itt_metadata_s16: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%d;", metadata_str, ((int16_t*)metadata)[i]); + break; + case __itt_metadata_float: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%f;", metadata_str, ((float*)metadata)[i]); + break; + case __itt_metadata_double: + for (uint16_t i = 0; i < size; i++) + sprintf(metadata_str, "%s%lf;", metadata_str, ((double*)metadata)[i]); + break; + default: + printf("ERROR: Unknow metadata type\n"); + } + + return metadata_str; +} + +ITT_EXTERN_C void ITTAPI __itt_pause(void) +{ + LOG_FUNC_CALL_INFO("function call"); +} + +ITT_EXTERN_C void ITTAPI __itt_resume(void) +{ + LOG_FUNC_CALL_INFO("function call"); +} + +ITT_EXTERN_C void ITTAPI __itt_detach(void) +{ + LOG_FUNC_CALL_INFO("function call"); +} + +ITT_EXTERN_C void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id) +{ + if (domain != NULL) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s", domain->nameA); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} + +ITT_EXTERN_C void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id) +{ + if (domain != NULL) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s", domain->nameA); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} + +ITT_EXTERN_C void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id, + __itt_timestamp begin, __itt_timestamp end) +{ + if (domain != NULL) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s, time_begin=%lu, time_end=%llu", + domain->nameA, (uint64_t*)id, begin, end); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} + +ITT_EXTERN_C void ITTAPI __itt_task_begin( + const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name) +{ + if (domain != NULL && name != NULL) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s handle_name=%s", domain->nameA, name->strA); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} + +ITT_EXTERN_C void ITTAPI __itt_task_end(const __itt_domain *domain) +{ + if (domain != NULL) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s", domain->nameA); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} + +ITT_EXTERN_C void __itt_metadata_add(const __itt_domain *domain, __itt_id id, + __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data) +{ + if (domain != NULL && count != 0) + { + LOG_FUNC_CALL_INFO("functions args: domain_name=%s metadata_size=%lu metadata[]=%s", + domain->nameA, count, get_metadata_elements(count, type, data)); + } + else + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + } +} diff --git a/node.gyp b/node.gyp index 5a9f8d1b56487f..1885a8d1ecb983 100644 --- a/node.gyp +++ b/node.gyp @@ -24,6 +24,7 @@ 'node_use_openssl%': 'true', 'node_shared_openssl%': 'false', 'node_v8_options%': '', + 'node_enable_v8_vtunejit%': 'false', 'node_core_target_name%': 'node', 'node_lib_target_name%': 'libnode', 'node_intermediate_lib_type%': 'static_library', diff --git a/node.gypi b/node.gypi index 0b0f05322e7bcc..059df00bcf4e06 100644 --- a/node.gypi +++ b/node.gypi @@ -125,6 +125,14 @@ ], }]], }], + [ 'node_use_bundled_v8=="true" and \ + node_enable_v8_vtunejit=="true" and (target_arch=="x64" or \ + target_arch=="ia32" or target_arch=="x32")', { + 'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ], + 'dependencies': [ + 'tools/v8_gypfiles/v8vtune.gyp:v8_vtune' + ], + }], [ 'node_no_browser_globals=="true"', { 'defines': [ 'NODE_NO_BROWSER_GLOBALS' ], } ], diff --git a/src/api/environment.cc b/src/api/environment.cc index 365dc5c51b29f8..3e2e6a04ddd51e 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -10,7 +10,9 @@ #include "node_v8_platform-inl.h" #include "node_wasm_web_api.h" #include "uv.h" - +#ifdef NODE_ENABLE_VTUNE_PROFILING +#include "../deps/v8/src/third_party/vtune/v8-vtune.h" +#endif #if HAVE_INSPECTOR #include "inspector/worker_inspector.h" // ParentInspectorHandle #endif @@ -224,6 +226,10 @@ void SetIsolateCreateParamsForNode(Isolate::CreateParams* params) { } params->embedder_wrapper_object_index = BaseObject::InternalFields::kSlot; params->embedder_wrapper_type_index = std::numeric_limits::max(); + +#ifdef NODE_ENABLE_VTUNE_PROFILING + params->code_event_handler = vTune::GetVtuneCodeEventHandler(); +#endif } void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) { diff --git a/src/node.cc b/src/node.cc index 03c01a656897f2..235f2eabd71dca 100644 --- a/src/node.cc +++ b/src/node.cc @@ -69,6 +69,10 @@ #include "inspector/worker_inspector.h" // ParentInspectorHandle #endif +#ifdef NODE_ENABLE_VTUNE_PROFILING +#include "../deps/v8/src/third_party/vtune/v8-vtune.h" +#endif + #include "large_pages/node_large_page.h" #if defined(__APPLE__) || defined(__linux__) || defined(_WIN32) diff --git a/tools/license-builder.sh b/tools/license-builder.sh index d9d10f6b68ff45..96b25d9781645a 100755 --- a/tools/license-builder.sh +++ b/tools/license-builder.sh @@ -36,6 +36,8 @@ licenseText="$(tail -n +3 "${rootdir}/deps/cares/LICENSE.md")" addlicense "c-ares" "deps/cares" "$licenseText" licenseText="$(cat "${rootdir}/deps/cjs-module-lexer/LICENSE")" addlicense "cjs-module-lexer" "deps/cjs-module-lexer" "$licenseText" +licenseText="$(cat "${rootdir}/deps/v8/third_party/ittapi/LICENSES/BSD-3-Clause.txt")" +addlicense "ittapi" "deps/v8/third_party/ittapi" "$licenseText" if [ -f "${rootdir}/deps/icu/LICENSE" ]; then # ICU 57 and following. Drop the BOM licenseText="$(sed -e '1s/^[^a-zA-Z ]*ICU/ICU/' -e :a -e 's/<[^>]*>//g;s/ / /g;s/ +$//;/