mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
Merge pull request #26802 from Kumataro:fix26801
3rdparty:ittnotify: update to v3.25.4 #26802 Close https://github.com/opencv/opencv/issues/26801 See https://github.com/opencv/opencv/pull/26797 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
parent
133fda3c56
commit
3e1fafefbe
8
3rdparty/ittnotify/CMakeLists.txt
vendored
8
3rdparty/ittnotify/CMakeLists.txt
vendored
|
|
@ -24,7 +24,6 @@ set(ITT_PUBLIC_HDRS
|
|||
include/ittnotify.h
|
||||
include/jitprofiling.h
|
||||
include/libittnotify.h
|
||||
include/llvm_jit_event_listener.hpp
|
||||
)
|
||||
set(ITT_PRIVATE_HDRS
|
||||
src/ittnotify/disable_warnings.h
|
||||
|
|
@ -39,6 +38,11 @@ set(ITT_SRCS
|
|||
|
||||
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
|
||||
file(STRINGS "src/ittnotify/ittnotify_config.h" API_VERSION_NUM REGEX "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]+)")
|
||||
if(API_VERSION_NUM MATCHES "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]*)")
|
||||
set(ITTNOTIFY_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(HAVE_DL_LIBRARY)
|
||||
target_link_libraries(${ITT_LIBRARY} dl)
|
||||
|
|
@ -64,4 +68,4 @@ if(NOT BUILD_SHARED_LIBS)
|
|||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/BSD-3-Clause.txt src/ittnotify/GPL-2.0-only.txt)
|
||||
|
|
|
|||
744
3rdparty/ittnotify/include/ittnotify.h
vendored
744
3rdparty/ittnotify/include/ittnotify.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _ITTNOTIFY_H_
|
||||
#define _ITTNOTIFY_H_
|
||||
|
||||
|
|
@ -63,7 +11,8 @@
|
|||
@brief Public User API functions and types
|
||||
@mainpage
|
||||
|
||||
The ITT API is used to annotate a user's program with additional information
|
||||
The Instrumentation and Tracing Technology API (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.
|
||||
|
|
@ -141,6 +90,10 @@ The same ID may not be reused for different instances, unless a previous
|
|||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
|
|
@ -148,6 +101,8 @@ The same ID may not be reused for different instances, unless a previous
|
|||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__)
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
|
|
@ -169,6 +124,10 @@ The same ID may not be reused for different instances, unless a previous
|
|||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
|
|
@ -176,6 +135,8 @@ The same ID may not be reused for different instances, unless a previous
|
|||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
|
|
@ -228,7 +189,12 @@ The same ID may not be reused for different instances, unless a previous
|
|||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#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 */
|
||||
/*
|
||||
|
|
@ -289,20 +255,20 @@ The same ID may not be reused for different instances, unless a previous
|
|||
#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)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
|
|
@ -340,7 +306,7 @@ extern "C" {
|
|||
* 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:
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
|
|
@ -355,35 +321,143 @@ void ITTAPI __itt_resume(void);
|
|||
/** @brief Detach collection */
|
||||
void ITTAPI __itt_detach(void);
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_scope
|
||||
* @brief Enumerator for collection scopes
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_scope_host = 1 << 0,
|
||||
__itt_collection_scope_offload = 1 << 1,
|
||||
__itt_collection_scope_all = 0x7FFFFFFF
|
||||
} __itt_collection_scope;
|
||||
|
||||
/** @brief Pause scoped collection */
|
||||
void ITTAPI __itt_pause_scoped(__itt_collection_scope);
|
||||
/** @brief Resume scoped collection */
|
||||
void ITTAPI __itt_resume_scoped(__itt_collection_scope);
|
||||
|
||||
/** @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)
|
||||
ITT_STUBV(ITTAPI, void, pause, (void))
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, resume, (void))
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, detach, (void))
|
||||
#define __itt_pause ITTNOTIFY_VOID(pause)
|
||||
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
|
||||
#define __itt_pause_scoped ITTNOTIFY_VOID(pause_scoped)
|
||||
#define __itt_pause_scoped_ptr ITTNOTIFY_NAME(pause_scoped)
|
||||
#define __itt_resume ITTNOTIFY_VOID(resume)
|
||||
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
|
||||
#define __itt_resume_scoped ITTNOTIFY_VOID(resume_scoped)
|
||||
#define __itt_resume_scoped_ptr ITTNOTIFY_NAME(resume_scoped)
|
||||
#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_pause_ptr 0
|
||||
#define __itt_pause_scoped(scope)
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_resume()
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped(scope)
|
||||
#define __itt_resume_scoped_ptr 0
|
||||
#define __itt_detach()
|
||||
#define __itt_detach_ptr 0
|
||||
#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
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped_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
|
||||
|
|
@ -541,14 +615,26 @@ ITT_STUBV(ITTAPI, void, suppress_pop, (void))
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @enum __itt_model_disable
|
||||
* @brief Enumerator for the disable methods
|
||||
* @enum __itt_suppress_mode
|
||||
* @brief Enumerator for the suppressing modes
|
||||
*/
|
||||
typedef enum __itt_suppress_mode {
|
||||
__itt_unsuppress_range,
|
||||
__itt_suppress_range
|
||||
} __itt_suppress_mode_t;
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_state
|
||||
* @brief Enumerator for collection state.
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_uninitialized = 0, /* uninitialized */
|
||||
__itt_collection_init_fail = 1, /* failed to init */
|
||||
__itt_collection_collector_absent = 2, /* non work state collector is absent */
|
||||
__itt_collection_collector_exists = 3, /* work state collector exists */
|
||||
__itt_collection_init_successful = 4 /* success to init */
|
||||
} __itt_collection_state;
|
||||
|
||||
/**
|
||||
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
|
||||
*/
|
||||
|
|
@ -1496,7 +1582,7 @@ ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr,
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an free begin occurrence.
|
||||
* @brief Record a free begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
|
||||
|
||||
|
|
@ -1516,7 +1602,7 @@ ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an free end occurrence.
|
||||
* @brief Record a free end occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
|
||||
|
||||
|
|
@ -1536,7 +1622,7 @@ ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an reallocation begin occurrence.
|
||||
* @brief Record a reallocation begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
|
||||
|
||||
|
|
@ -1556,7 +1642,7 @@ ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* add
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an reallocation end occurrence.
|
||||
* @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);
|
||||
|
||||
|
|
@ -2692,7 +2778,7 @@ ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info
|
|||
|
||||
/**
|
||||
* @ingroup clockdomains
|
||||
* @brief Recalculate clock domains frequences and clock base timestamps.
|
||||
* @brief Recalculate clock domains frequencies and clock base timestamps.
|
||||
*/
|
||||
void ITTAPI __itt_clock_domain_reset(void);
|
||||
|
||||
|
|
@ -3597,11 +3683,12 @@ ITT_STUBV(ITTAPI, void, enable_attach, (void))
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Module load info
|
||||
* This API is used to report necessary information in case of module relocation
|
||||
* @param[in] start_addr - relocated module start address
|
||||
* @param[in] end_addr - relocated module end address
|
||||
* @param[in] path - file system path to the module
|
||||
* @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);
|
||||
|
|
@ -3656,7 +3743,462 @@ ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const ch
|
|||
#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 */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_histogram
|
||||
{
|
||||
const __itt_domain* domain; /*!< Domain of the histogram*/
|
||||
const char* nameA; /*!< Name of the histogram */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
__itt_metadata_type x_type; /*!< Type of the histogram X axis */
|
||||
__itt_metadata_type y_type; /*!< Type of the histogram Y axis */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_histogram* next;
|
||||
} __itt_histogram;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed histogram instance with given name/domain.
|
||||
* @param[in] domain The domain controlling the call.
|
||||
* @param[in] name The name of the histogram.
|
||||
* @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
|
||||
* @param[in] y_type The type of the Y axis in histogram.
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_histogram_create __itt_histogram_createW
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_histogram_create __itt_histogram_createA
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#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_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
|
||||
#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
|
||||
#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
|
||||
#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
|
||||
#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_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_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Submit statistics for a histogram instance.
|
||||
* @param[in] hist Pointer to the histogram instance to which the histogram statistic is to be dumped.
|
||||
* @param[in] length The number of elements in dumped axis data array.
|
||||
* @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
|
||||
* @param[in] y_data The Y axis dumped data itself.
|
||||
*/
|
||||
void ITTAPI __itt_histogram_submit(__itt_histogram* hist, size_t length, void* x_data, void* y_data);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data))
|
||||
#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
|
||||
#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_histogram_submit(hist, length, x_data, y_data)
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
|
||||
/**
|
||||
* @brief function allows to obtain the current collection state at the moment
|
||||
* @return collection state as a enum __itt_collection_state
|
||||
*/
|
||||
__itt_collection_state __itt_get_collection_state(void);
|
||||
|
||||
/**
|
||||
* @brief function releases resources allocated by ITT API static part
|
||||
* this API should be called from the library destructor
|
||||
* @return void
|
||||
*/
|
||||
void __itt_release_resources(void);
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed counter with given domain pointer, string name and counter type
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_counter ITTAPI __itt_counter_createA_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
|
||||
__itt_counter ITTAPI __itt_counter_createW_v3(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_counter_create_v3 __itt_counter_createW_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createW_v3_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_counter_create_v3 __itt_counter_createA_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createA_v3_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_counter ITTAPI __itt_counter_create_v3(const __itt_domain* domain, const char* name, __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_createA_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3 ITTNOTIFY_DATA(counter_createA_v3)
|
||||
#define __itt_counter_createA_v3_ptr ITTNOTIFY_NAME(counter_createA_v3)
|
||||
#define __itt_counter_createW_v3 ITTNOTIFY_DATA(counter_createW_v3)
|
||||
#define __itt_counter_createW_v3_ptr ITTNOTIFY_NAME(counter_createW_v3)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3 ITTNOTIFY_DATA(counter_create_v3)
|
||||
#define __itt_counter_create_v3_ptr ITTNOTIFY_NAME(counter_create_v3)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_createA_v3_ptr 0
|
||||
#define __itt_counter_createW_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_typedW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_v3_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_v3_ptr 0
|
||||
#define __itt_counter_createW_v3_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Set the counter value api
|
||||
*/
|
||||
void ITTAPI __itt_counter_set_value_v3(__itt_counter counter, void *value_ptr);
|
||||
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr))
|
||||
#define __itt_counter_set_value_v3 ITTNOTIFY_VOID(counter_set_value_v3)
|
||||
#define __itt_counter_set_value_v3_ptr ITTNOTIFY_NAME(counter_set_value_v3)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_counter_set_value_v3(counter, value_ptr)
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief describes the type of context metadata
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_context_unknown = 0, /*!< Undefined type */
|
||||
__itt_context_nameA, /*!< ASCII string char* type */
|
||||
__itt_context_nameW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_deviceA, /*!< ASCII string char* type */
|
||||
__itt_context_deviceW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_unitsA, /*!< ASCII string char* type */
|
||||
__itt_context_unitsW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_pci_addrA, /*!< ASCII string char* type */
|
||||
__itt_context_pci_addrW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_tid, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_max_val, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_bandwidth_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_latency_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_occupancy_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_on_thread_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_is_abs_val_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_instructions_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_cycles_flag /*!< Unsigned 64-bit integer type */
|
||||
} __itt_context_type;
|
||||
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_context_name __itt_context_nameW
|
||||
# define __itt_context_device __itt_context_deviceW
|
||||
# define __itt_context_units __itt_context_unitsW
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrW
|
||||
#else /* UNICODE || _UNICODE */
|
||||
# define __itt_context_name __itt_context_nameA
|
||||
# define __itt_context_device __itt_context_deviceA
|
||||
# define __itt_context_units __itt_context_unitsA
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrA
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_context_metadata
|
||||
{
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
void* value; /*!< Pointer to context metadata value itself */
|
||||
} __itt_context_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_counter_metadata
|
||||
{
|
||||
__itt_counter counter; /*!< Associated context metadata counter */
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
const char* str_valueA; /*!< String context metadata value */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* str_valueW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* str_valueW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
unsigned long long value; /*!< Numeric context metadata value */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_counter_metadata* next;
|
||||
} __itt_counter_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Bind context metadata to counter instance
|
||||
* @param[in] counter Pointer to the counter instance to which the context metadata is to be associated.
|
||||
* @param[in] length The number of elements in context metadata array.
|
||||
* @param[in] metadata The context metadata itself.
|
||||
*/
|
||||
void ITTAPI __itt_bind_context_metadata_to_counter(__itt_counter counter, size_t length, __itt_context_metadata* metadata);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata))
|
||||
#define __itt_bind_context_metadata_to_counter ITTNOTIFY_VOID(bind_context_metadata_to_counter)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr ITTNOTIFY_NAME(bind_context_metadata_to_counter)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_bind_context_metadata_to_counter(counter, length, metadata)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
@ -4005,7 +4547,7 @@ ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
|
|||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
|
||||
* @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);
|
||||
|
||||
|
|
|
|||
98
3rdparty/ittnotify/include/jitprofiling.h
vendored
98
3rdparty/ittnotify/include/jitprofiling.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef __JITPROFILING_H__
|
||||
#define __JITPROFILING_H__
|
||||
|
|
@ -66,7 +14,7 @@
|
|||
* 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
|
||||
* by tools like Intel(R) VTune(TM) Profiler to display performance metrics
|
||||
* associated with JIT-compiled code.
|
||||
*
|
||||
* These APIs can be used to\n
|
||||
|
|
@ -97,16 +45,16 @@
|
|||
* * 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
|
||||
* memory region is treated as unloaded. VTune Profiler 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 same assembly instruction (code location), then VTune Profiler 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
|
||||
* specifying different module names, then the VTune Profiler 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)
|
||||
|
|
@ -143,18 +91,18 @@
|
|||
* 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
|
||||
* only for line number table information. So, the VTune Profiler 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
|
||||
* VTune Profiler 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.
|
||||
* discarded but VTune Profiler 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.
|
||||
|
|
@ -293,7 +241,7 @@ typedef enum _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
|
||||
* Intel(R) VTune(TM) Profiler 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
|
||||
|
|
@ -304,7 +252,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
|
|||
* 18 1
|
||||
* 21 30
|
||||
*
|
||||
* VTune Amplifier constructs the following table using the client data
|
||||
* VTune Profiler constructs the following table using the client data
|
||||
*
|
||||
* Code subrange Line number
|
||||
* 0-1 2
|
||||
|
|
@ -428,7 +376,7 @@ typedef struct _iJIT_Method_Load_V2
|
|||
|
||||
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
|
||||
different JIT engines. VTune Profiler will display
|
||||
reported methods grouped by specific module. */
|
||||
|
||||
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
|
||||
|
|
@ -480,7 +428,7 @@ typedef struct _iJIT_Method_Load_V3
|
|||
|
||||
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
|
||||
* different JIT engines. VTune Profiler will display
|
||||
* reported methods grouped by specific module. */
|
||||
|
||||
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
|
||||
|
|
@ -490,9 +438,9 @@ typedef struct _iJIT_Method_Load_V3
|
|||
* engine generates 64-bit code.
|
||||
*
|
||||
* If JIT engine reports both 32-bit and 64-bit types
|
||||
* of methods then VTune Amplifier splits the methods
|
||||
* of methods then VTune Profiler splits the methods
|
||||
* with the same module name but with different
|
||||
* architectures in two different modules. VTune Amplifier
|
||||
* architectures in two different modules. VTune Profiler
|
||||
* modifies the original name provided with a 64-bit method
|
||||
* version by ending it with '(64)' */
|
||||
|
||||
|
|
@ -561,9 +509,9 @@ typedef enum _iJIT_SegmentType
|
|||
iJIT_CT_CODE, /**<\brief Executable code. */
|
||||
|
||||
iJIT_CT_DATA, /**<\brief Data (not executable code).
|
||||
* VTune Amplifier uses the format string
|
||||
* VTune Profiler uses the format string
|
||||
* (see iJIT_Method_Update) to represent
|
||||
* this data in the VTune Amplifier GUI */
|
||||
* this data in the VTune Profiler GUI */
|
||||
|
||||
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
|
||||
* Can be used for the following
|
||||
|
|
@ -580,11 +528,11 @@ typedef enum _iJIT_SegmentType
|
|||
* 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
|
||||
* On the first Update event, VTune Profiler 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
|
||||
* adds the modified range to the original method. For next update events, VTune Profiler
|
||||
* 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
|
||||
* Eventually, VTune Profiler 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
|
||||
|
|
@ -673,7 +621,7 @@ 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
|
||||
* Intel(R) VTune(TM) Profiler collector. This API needs to be called
|
||||
* after JIT compilation and before the first entry into the JIT-compiled
|
||||
* code.
|
||||
*
|
||||
|
|
|
|||
113
3rdparty/ittnotify/include/legacy/ittnotify.h
vendored
113
3rdparty/ittnotify/include/legacy/ittnotify.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _LEGACY_ITTNOTIFY_H_
|
||||
#define _LEGACY_ITTNOTIFY_H_
|
||||
|
||||
|
|
@ -80,6 +28,10 @@
|
|||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
|
|
@ -87,6 +39,8 @@
|
|||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
|
|
@ -108,6 +62,10 @@
|
|||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
|
|
@ -115,6 +73,8 @@
|
|||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
|
|
@ -167,7 +127,12 @@
|
|||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#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 */
|
||||
/*
|
||||
|
|
@ -219,20 +184,20 @@
|
|||
#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)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? (void)0 : (!(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 == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(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 == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
|
|
@ -269,7 +234,7 @@ extern "C" {
|
|||
* 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:
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
|
|
@ -1005,9 +970,9 @@ ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain))
|
|||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @brief Record an frame begin occurrence. */
|
||||
/** @brief Record a frame begin occurrence. */
|
||||
void ITTAPI __itt_frame_begin(__itt_frame frame);
|
||||
/** @brief Record an frame end occurrence. */
|
||||
/** @brief Record a frame end occurrence. */
|
||||
void ITTAPI __itt_frame_end (__itt_frame frame);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
|
|
|
|||
60
3rdparty/ittnotify/include/libittnotify.h
vendored
60
3rdparty/ittnotify/include/libittnotify.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef _LIBITTNOTIFY_H_
|
||||
#define _LIBITTNOTIFY_H_
|
||||
|
|
|
|||
|
|
@ -1,241 +0,0 @@
|
|||
/* <copyright>
|
||||
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-2014 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-2014 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.
|
||||
</copyright> */
|
||||
|
||||
/*
|
||||
* This file implements an interface bridge from Low-Level Virtual Machine
|
||||
* llvm::JITEventListener to Intel JIT Profiling API. It passes the function
|
||||
* and line information to the appropriate functions in the JIT profiling
|
||||
* interface so that any LLVM-based JIT engine can emit the JIT code
|
||||
* notifications that the profiler will receive.
|
||||
*
|
||||
* Usage model:
|
||||
*
|
||||
* 1. Register the listener implementation instance with the execution engine:
|
||||
*
|
||||
* #include <llvm_jit_event_listener.hpp>
|
||||
* ...
|
||||
* ExecutionEngine *TheExecutionEngine;
|
||||
* ...
|
||||
* TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
* ...
|
||||
* __itt_llvm_jit_event_listener jitListener;
|
||||
* TheExecutionEngine->RegisterJITEventListener(&jitListener);
|
||||
* ...
|
||||
*
|
||||
* 2. When compiling make sure to add the ITT API include directory to the
|
||||
* compiler include directories, ITT API library directory to the linker
|
||||
* library directories and link with jitprofling static library.
|
||||
*/
|
||||
|
||||
#ifndef __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
#define __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
#include <llvm/Function.h>
|
||||
#include <llvm/ExecutionEngine/JITEventListener.h>
|
||||
#include <llvm/ADT/StringRef.h>
|
||||
#include <llvm/Analysis/DebugInfo.h>
|
||||
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
|
||||
// Uncomment the line below to turn on logging to stderr
|
||||
#define JITPROFILING_DEBUG_ENABLE
|
||||
|
||||
// Some elementary logging support
|
||||
#ifdef JITPROFILING_DEBUG_ENABLE
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
static void _jit_debug(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
// Use the macro as JITDEBUG(("foo: %d", foo_val));
|
||||
#define JITDEBUG(x) \
|
||||
do { \
|
||||
_jit_debug("jit-listener: "); \
|
||||
_jit_debug x; \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define JITDEBUG(x)
|
||||
#endif
|
||||
|
||||
// LLVM JIT event listener, translates the notifications to the JIT profiling
|
||||
// API information.
|
||||
class __itt_llvm_jit_event_listener : public llvm::JITEventListener
|
||||
{
|
||||
public:
|
||||
__itt_llvm_jit_event_listener() {}
|
||||
|
||||
public:
|
||||
virtual void NotifyFunctionEmitted(const llvm::Function &F,
|
||||
void *Code, size_t Size, const EmittedFunctionDetails &Details)
|
||||
{
|
||||
std::string name = F.getName().str();
|
||||
JITDEBUG(("function jitted:\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)Code));
|
||||
JITDEBUG((" name=`%s'\n", name.c_str()));
|
||||
JITDEBUG((" code-size=%d\n", (int)Size));
|
||||
JITDEBUG((" line-infos-count=%d\n", Details.LineStarts.size()));
|
||||
|
||||
// The method must not be in the map - the entry must have been cleared
|
||||
// from the map in NotifyFreeingMachineCode in case of rejitting.
|
||||
assert(m_addr2MethodId.find(Code) == m_addr2MethodId.end());
|
||||
|
||||
int mid = iJIT_GetNewMethodID();
|
||||
m_addr2MethodId[Code] = mid;
|
||||
|
||||
iJIT_Method_Load mload;
|
||||
memset(&mload, 0, sizeof mload);
|
||||
mload.method_id = mid;
|
||||
|
||||
// Populate the method size and name information
|
||||
// TODO: The JIT profiling API should have members as const char pointers.
|
||||
mload.method_name = (char*)name.c_str();
|
||||
mload.method_load_address = Code;
|
||||
mload.method_size = (unsigned int)Size;
|
||||
|
||||
// Populate line information now.
|
||||
// From the JIT API documentation it is not quite clear whether the
|
||||
// line information can be given in ranges, so we'll populate it for
|
||||
// every byte of the function, hmm.
|
||||
std::string srcFilePath;
|
||||
std::vector<LineNumberInfo> lineInfos;
|
||||
char *addr = (char*)Code;
|
||||
char *lineAddr = addr; // Exclusive end point at which current
|
||||
// line info changes.
|
||||
const llvm::DebugLoc* loc = 0; // Current line info
|
||||
int lineIndex = -1; // Current index into the line info table
|
||||
for (int i = 0; i < Size; ++i, ++addr) {
|
||||
while (addr >= lineAddr) {
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
loc = &Details.LineStarts[lineIndex].Loc;
|
||||
std::string p = getSrcFilePath(F.getContext(), *loc);
|
||||
assert(srcFilePath.empty() || p == srcFilePath);
|
||||
srcFilePath = p;
|
||||
} else {
|
||||
loc = NULL;
|
||||
}
|
||||
lineIndex++;
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
lineAddr = (char*)Details.LineStarts[lineIndex].Address;
|
||||
} else {
|
||||
lineAddr = addr + Size;
|
||||
}
|
||||
}
|
||||
if (loc) {
|
||||
int line = loc->getLine();
|
||||
LineNumberInfo info = { i, line };
|
||||
lineInfos.push_back(info);
|
||||
JITDEBUG((" addr 0x%08x -> line %d\n", addr, line));
|
||||
}
|
||||
}
|
||||
if (!lineInfos.empty()) {
|
||||
mload.line_number_size = lineInfos.size();
|
||||
JITDEBUG((" translated to %d line infos to JIT", (int)lineInfos.size()));
|
||||
mload.line_number_table = &lineInfos[0];
|
||||
mload.source_file_name = (char*)srcFilePath.c_str();
|
||||
}
|
||||
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &mload);
|
||||
}
|
||||
|
||||
virtual void NotifyFreeingMachineCode(void *OldPtr)
|
||||
{
|
||||
JITDEBUG(("function unjitted\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)OldPtr));
|
||||
Addr2MethodId::iterator it = m_addr2MethodId.find(OldPtr);
|
||||
assert(it != m_addr2MethodId.end());
|
||||
iJIT_Method_Id mid = { it->second };
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, &mid);
|
||||
m_addr2MethodId.erase(it);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string getSrcFilePath(const llvm::LLVMContext& ctx, const llvm::DebugLoc& loc)
|
||||
{
|
||||
llvm::MDNode* node = loc.getAsMDNode(ctx);
|
||||
llvm::DILocation srcLoc(node);
|
||||
return srcLoc.getDirectory().str() + "/" + srcLoc.getFilename().str();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Don't copy
|
||||
__itt_llvm_jit_event_listener(const __itt_llvm_jit_event_listener&);
|
||||
__itt_llvm_jit_event_listener& operator=(const __itt_llvm_jit_event_listener&);
|
||||
|
||||
private:
|
||||
typedef std::vector<LineNumberInfo> LineInfoList;
|
||||
|
||||
// The method unload notification in VTune JIT profiling API takes the
|
||||
// method ID, not method address so have to maintain the mapping. Is
|
||||
// there a more efficient and simple way to do this like attaching the
|
||||
// method ID information somehow to the LLVM function instance?
|
||||
//
|
||||
// TODO: It would be more convenient for the JIT API to take the method
|
||||
// address, not method ID.
|
||||
typedef std::map<const void*, int> Addr2MethodId;
|
||||
Addr2MethodId m_addr2MethodId;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
Copyright (c) 2011, Intel Corporation
|
||||
All rights reserved.
|
||||
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:
|
||||
• 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 the 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.
|
||||
|
||||
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.
|
||||
|
|
@ -1,65 +1,103 @@
|
|||
The GNU General Public License (GPL)
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
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 Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
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.
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
Copyright (C) < yyyy> <name of author>
|
||||
|
||||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
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.
|
||||
signature of Ty Coon, 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 Library General Public License instead of this License.
|
||||
|
||||
<signature of Ty Coon>, 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.
|
||||
|
|
@ -1,71 +1,23 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
|
||||
#if defined _MSC_VER
|
||||
|
||||
#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
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if defined __INTEL_COMPILER
|
||||
|
|
|
|||
277
3rdparty/ittnotify/src/ittnotify/ittnotify_config.h
vendored
277
3rdparty/ittnotify/src/ittnotify/ittnotify_config.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _ITTNOTIFY_CONFIG_H_
|
||||
#define _ITTNOTIFY_CONFIG_H_
|
||||
|
||||
|
|
@ -75,6 +23,10 @@
|
|||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
|
|
@ -82,6 +34,8 @@
|
|||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
|
|
@ -103,6 +57,10 @@
|
|||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
|
|
@ -110,6 +68,8 @@
|
|||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
|
|
@ -162,7 +122,12 @@
|
|||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#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 */
|
||||
/*
|
||||
|
|
@ -188,6 +153,10 @@
|
|||
# define ITT_ARCH_IA32E 2
|
||||
#endif /* ITT_ARCH_IA32E */
|
||||
|
||||
#ifndef ITT_ARCH_IA64
|
||||
# define ITT_ARCH_IA64 3
|
||||
#endif /* ITT_ARCH_IA64 */
|
||||
|
||||
#ifndef ITT_ARCH_ARM
|
||||
# define ITT_ARCH_ARM 4
|
||||
#endif /* ITT_ARCH_ARM */
|
||||
|
|
@ -196,9 +165,9 @@
|
|||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
|
||||
# define ITT_ARCH_AARCH64 6
|
||||
#endif /* ITT_ARCH_AARCH64 */
|
||||
#ifndef ITT_ARCH_ARM64
|
||||
# define ITT_ARCH_ARM64 6
|
||||
#endif /* ITT_ARCH_ARM64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
|
|
@ -210,7 +179,7 @@
|
|||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __aarch64__
|
||||
# define ITT_ARCH ITT_ARCH_AARCH64
|
||||
# define ITT_ARCH ITT_ARCH_ARM64
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
|
|
@ -239,10 +208,10 @@
|
|||
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
|
||||
|
||||
/* Replace with snapshot date YYYYMMDD for promotion build. */
|
||||
#define API_VERSION_BUILD 20151119
|
||||
#define API_VERSION_BUILD 20250113
|
||||
|
||||
#ifndef API_VERSION_NUM
|
||||
#define API_VERSION_NUM 0.0.0
|
||||
#define API_VERSION_NUM 3.25.4
|
||||
#endif /* API_VERSION_NUM */
|
||||
|
||||
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
|
||||
|
|
@ -254,7 +223,11 @@
|
|||
typedef HMODULE lib_t;
|
||||
typedef DWORD TIDT;
|
||||
typedef CRITICAL_SECTION mutex_t;
|
||||
#ifdef __cplusplus
|
||||
#define MUTEX_INITIALIZER {}
|
||||
#else
|
||||
#define MUTEX_INITIALIZER { 0 }
|
||||
#endif
|
||||
#define strong_alias(name, aliasname) /* empty for Windows */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <dlfcn.h>
|
||||
|
|
@ -282,13 +255,13 @@ typedef pthread_mutex_t mutex_t;
|
|||
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
|
||||
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
|
||||
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
|
||||
#define __itt_mutex_destroy(mutex) DeleteCriticalSection(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
|
||||
|
|
@ -298,6 +271,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
|||
{
|
||||
return InterlockedIncrement(ptr);
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return InterlockedCompareExchange(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
#define DL_SYMBOLS (1)
|
||||
|
|
@ -327,6 +307,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
|||
}
|
||||
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
|
||||
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
|
||||
#define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex)
|
||||
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
|
||||
#define __itt_unload_lib(handle) dlclose(handle)
|
||||
#define __itt_system_error() errno
|
||||
|
|
@ -341,10 +322,18 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
|||
#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) strncpy(s1, s2, b)
|
||||
#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
|
||||
|
|
@ -360,12 +349,12 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
|||
{
|
||||
long result;
|
||||
__asm__ __volatile__("lock\nxadd %0,%1"
|
||||
: "=r"(result),"=m"(*(int*)ptr)
|
||||
: "0"(addend), "m"(*(int*)ptr)
|
||||
: "=r"(result),"=m"(*(volatile int*)ptr)
|
||||
: "0"(addend), "m"(*(volatile int*)ptr)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#else
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
|
|
@ -375,6 +364,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
|||
{
|
||||
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return __sync_val_compare_and_swap(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
void* dlopen(const char*, int) __attribute__((weak));
|
||||
|
|
@ -394,10 +390,20 @@ pthread_t pthread_self(void) __attribute__((weak));
|
|||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
typedef enum {
|
||||
__itt_collection_normal = 0,
|
||||
__itt_collection_paused = 1
|
||||
} __itt_collection_state;
|
||||
/* strdup() is not included into C99 which results in a compiler warning about
|
||||
* implicitly declared symbol. To avoid the issue strdup is implemented
|
||||
* manually.
|
||||
*/
|
||||
#define ITT_STRDUP_MAX_STRING_SIZE 4096
|
||||
#define __itt_fstrdup(s, new_s) do { \
|
||||
if (s != NULL) { \
|
||||
size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE); \
|
||||
new_s = (char *)malloc(s_len + 1); \
|
||||
if (new_s != NULL) { \
|
||||
__itt_fstrcpyn(new_s, s_len + 1, s, s_len); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
typedef enum {
|
||||
__itt_thread_normal = 0,
|
||||
|
|
@ -463,6 +469,10 @@ typedef struct __itt_counter_info
|
|||
|
||||
struct ___itt_domain;
|
||||
struct ___itt_string_handle;
|
||||
struct ___itt_histogram;
|
||||
struct ___itt_counter_metadata;
|
||||
|
||||
#include "ittnotify.h"
|
||||
|
||||
typedef struct ___itt_global
|
||||
{
|
||||
|
|
@ -484,7 +494,10 @@ typedef struct ___itt_global
|
|||
struct ___itt_domain* domain_list;
|
||||
struct ___itt_string_handle* string_list;
|
||||
__itt_collection_state state;
|
||||
__itt_counter_info_t* counter_list;
|
||||
__itt_counter_info_t* counter_list;
|
||||
unsigned int ipt_collect_events;
|
||||
struct ___itt_histogram* histogram_list;
|
||||
struct ___itt_counter_metadata* counter_metadata_list;
|
||||
} __itt_global;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
|
@ -510,7 +523,9 @@ typedef struct ___itt_global
|
|||
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
|
||||
if (h != NULL) { \
|
||||
h->tid = t; \
|
||||
h->nameA = n ? __itt_fstrdup(n) : NULL; \
|
||||
char *n_copy = NULL; \
|
||||
__itt_fstrdup(n, n_copy); \
|
||||
h->nameA = n_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->state = s; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
|
|
@ -543,7 +558,9 @@ typedef struct ___itt_global
|
|||
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; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
|
|
@ -573,7 +590,9 @@ typedef struct ___itt_global
|
|||
#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; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->strA = name_copy; \
|
||||
h->strW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
|
|
@ -591,7 +610,7 @@ typedef struct ___itt_global
|
|||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->domainA = NULL; \
|
||||
h->domainW = name ? _wcsdup(domain) : NULL; \
|
||||
h->domainW = domain ? _wcsdup(domain) : NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
|
|
@ -605,9 +624,13 @@ typedef struct ___itt_global
|
|||
#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; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
|
||||
char *domain_copy = NULL; \
|
||||
__itt_fstrdup(domain, domain_copy); \
|
||||
h->domainA = domain_copy; \
|
||||
h->domainW = NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
|
|
@ -619,4 +642,98 @@ typedef struct ___itt_global
|
|||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_W(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_A(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_NUM(gptr,h,h_tail,counter,type,value) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = value; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_A(gptr,h,h_tail,counter,type,str_valueA) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
char *str_value_copy = NULL; \
|
||||
__itt_fstrdup(str_valueA, str_value_copy); \
|
||||
h->str_valueA = str_value_copy; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_W(gptr,h,h_tail,counter,type,str_valueW) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = str_valueW ? _wcsdup(str_valueW) : NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_CONFIG_H_ */
|
||||
|
|
|
|||
951
3rdparty/ittnotify/src/ittnotify/ittnotify_static.c
vendored
951
3rdparty/ittnotify/src/ittnotify/ittnotify_static.c
vendored
File diff suppressed because it is too large
Load Diff
101
3rdparty/ittnotify/src/ittnotify/ittnotify_static.h
vendored
101
3rdparty/ittnotify/src/ittnotify/ittnotify_static.h
vendored
|
|
@ -1,60 +1,8 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
|
|
@ -81,6 +29,9 @@ ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORM
|
|||
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\"")
|
||||
|
|
@ -105,6 +56,8 @@ ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, con
|
|||
|
||||
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")
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), pause_scoped, __itt_group_control, "%d")
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), resume_scoped, __itt_group_control, "%d")
|
||||
|
||||
#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\"")
|
||||
|
|
@ -121,6 +74,23 @@ ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (IT
|
|||
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")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createA, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createW, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_create, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createA_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createW_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_create_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata), (ITT_FORMAT counter, length, metadata), bind_context_metadata_to_counter, __itt_group_structure, "%p, %lu, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
|
||||
|
|
@ -296,6 +266,13 @@ ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMA
|
|||
#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")
|
||||
|
|
@ -376,14 +353,16 @@ ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, in
|
|||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __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_none, "%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_none, "%p, %p, %p")
|
||||
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_none, "%p, %p, %p")
|
||||
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 */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data), (ITT_FORMAT hist, length, x_data, y_data), histogram_submit, __itt_group_structure, "%p, %lu, %p, %p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr), (ITT_FORMAT counter, value_ptr), counter_set_value_v3, __itt_group_counter, "%p, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_INIT */
|
||||
|
|
|
|||
100
3rdparty/ittnotify/src/ittnotify/ittnotify_types.h
vendored
100
3rdparty/ittnotify/src/ittnotify/ittnotify_types.h
vendored
|
|
@ -1,85 +1,34 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
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_all = -1
|
||||
__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)
|
||||
|
|
@ -109,6 +58,7 @@ typedef struct ___itt_group_list
|
|||
{ __itt_group_structure, "structure" }, \
|
||||
{ __itt_group_suppress, "suppress" }, \
|
||||
{ __itt_group_arrays, "arrays" }, \
|
||||
{ __itt_group_module, "module" }, \
|
||||
{ __itt_group_none, NULL } \
|
||||
}
|
||||
|
||||
|
|
|
|||
140
3rdparty/ittnotify/src/ittnotify/jitprofiling.c
vendored
140
3rdparty/ittnotify/src/ittnotify/jitprofiling.c
vendored
|
|
@ -1,76 +1,24 @@
|
|||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 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-2014 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.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD && ITT_PLATFORM != ITT_PLATFORM_OPENBSD
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
|
||||
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
|
||||
static const char rcsid[] = "\n@(#) $Revision$\n";
|
||||
|
||||
#ifndef NEW_DLL_ENVIRONMENT_VAR
|
||||
#if ITT_ARCH==ITT_ARCH_IA32
|
||||
|
|
@ -81,13 +29,10 @@ static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
|||
#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 */
|
||||
|
||||
|
|
@ -169,6 +114,38 @@ ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
|||
return executionMode;
|
||||
}
|
||||
|
||||
#if ITT_PLATFORM == ITT_PLATFORM_WIN
|
||||
static int isValidAbsolutePath(char *path, size_t maxPathLength)
|
||||
{
|
||||
if (path == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t pathLength = strnlen(path, maxPathLength);
|
||||
if (pathLength == maxPathLength)
|
||||
{
|
||||
/* The strnlen() function returns maxPathLength if there is no null terminating
|
||||
* among the first maxPathLength characters in the string pointed to by path.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pathLength > 2)
|
||||
{
|
||||
if (isalpha(path[0]) && path[1] == ':' && path[2] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (path[0] == '\\' && path[1] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
|
|
@ -212,7 +189,7 @@ static int loadiJIT_Funcs()
|
|||
{
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
if (envret && isValidAbsolutePath(dllName, dNameLength))
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
|
|
@ -220,30 +197,9 @@ static int loadiJIT_Funcs()
|
|||
}
|
||||
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;
|
||||
|
|
@ -251,19 +207,13 @@ static int loadiJIT_Funcs()
|
|||
if (dllName)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
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 */
|
||||
m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/* if the dll wasn't loaded - exit. */
|
||||
if (!m_libHandle)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1722,7 +1722,7 @@ endif()
|
|||
|
||||
if(CV_TRACE OR OPENCV_TRACE)
|
||||
ocv_build_features_string(trace_status EXCLUSIVE
|
||||
IF HAVE_ITT THEN "with Intel ITT"
|
||||
IF HAVE_ITT THEN "with Intel ITT(${ITTNOTIFY_VERSION})"
|
||||
ELSE "built-in")
|
||||
status("")
|
||||
status(" Trace: " OPENCV_TRACE THEN "YES (${trace_status})" ELSE NO)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user