642b6b95ca
* Support external (i.e. user-defined) trace annotations
- tweaked the python examples to be more balanced
- updated the user-api example to conform to user API changes
- moved the get/set for State and ThreadState to state.{hpp,cpp}
- introduced user-provided trace annotations
- added perfetto python category
- moved coverage impl files around
- created enumerations for mapping category enums to category types
- created enumerations for mapping annotation type enums to annotation values
- moved tracing::add_perfetto_annotations to tracing/annotation.hpp
- utility make_index_sequence_range
- libomnitrace-dl: omnitrace_push_category_region
- libomnitrace-dl: omnitrace_pop_category_region
- libomnitrace-user: omnitrace_user_push_annotated_region
- libomnitrace-user: omnitrace_user_pop_annotated_region
- libpyomnitrace: support extra annotations via annotate_trace config value
- filename
- line
- last attempted instr in bytecode (lasti)
- argcount
- num local variables
- stacksize
- omnitrace-python: -a / --annotate-traces option
* tweak ubuntu-focal workflow
* Fix installation of omnitrace-user headers
* ubuntu-focal-codecov workflow update
- Install texinfo
* Update timemory submodule
110 lines
4.4 KiB
C
110 lines
4.4 KiB
C
// MIT License
|
|
//
|
|
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
// copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
// SOFTWARE.
|
|
|
|
#pragma once
|
|
|
|
// clang-format off
|
|
#define OMNITRACE_VERSION_STRING "@FULL_VERSION_STRING@"
|
|
#define OMNITRACE_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
|
|
#define OMNITRACE_VERSION_MINOR @PROJECT_VERSION_MINOR@
|
|
#define OMNITRACE_VERSION_PATCH @PROJECT_VERSION_PATCH@
|
|
#define OMNITRACE_GIT_DESCRIBE "@OMNITRACE_GIT_DESCRIBE@"
|
|
#define OMNITRACE_GIT_REVISION "@OMNITRACE_GIT_REVISION@"
|
|
|
|
#define OMNITRACE_DEFAULT_ROCM_PATH "@ROCmVersion_DIR@"
|
|
#define OMNITRACE_HIP_VERSION_STRING "@OMNITRACE_HIP_VERSION@"
|
|
#define OMNITRACE_HIP_VERSION_MAJOR @OMNITRACE_HIP_VERSION_MAJOR@
|
|
#define OMNITRACE_HIP_VERSION_MINOR @OMNITRACE_HIP_VERSION_MINOR@
|
|
#define OMNITRACE_HIP_VERSION_PATCH @OMNITRACE_HIP_VERSION_PATCH@
|
|
// clang-format on
|
|
|
|
#define OMNITRACE_VERSION \
|
|
((10000 * OMNITRACE_VERSION_MAJOR) + (100 * OMNITRACE_VERSION_MINOR) + \
|
|
OMNITRACE_VERSION_PATCH)
|
|
|
|
#define OMNITRACE_HIP_VERSION \
|
|
((10000 * OMNITRACE_HIP_VERSION_MAJOR) + (100 * OMNITRACE_HIP_VERSION_MINOR) + \
|
|
OMNITRACE_HIP_VERSION_PATCH)
|
|
|
|
// clang-format off
|
|
#if !defined(OMNITRACE_MAX_THREADS)
|
|
# define OMNITRACE_MAX_THREADS @OMNITRACE_MAX_THREADS@
|
|
#endif
|
|
|
|
#if !defined(OMNITRACE_MAX_UNWIND_DEPTH)
|
|
# define OMNITRACE_MAX_UNWIND_DEPTH @OMNITRACE_MAX_UNWIND_DEPTH@
|
|
#endif
|
|
// clang-format on
|
|
|
|
#if !defined(OMNITRACE_MAX_COUNTERS)
|
|
# define OMNITRACE_MAX_COUNTERS 25
|
|
#endif
|
|
|
|
#if !defined(OMNITRACE_ROCM_LOOK_AHEAD)
|
|
# define OMNITRACE_ROCM_LOOK_AHEAD 128
|
|
#endif
|
|
|
|
#if !defined(OMNITRACE_MAX_ROCM_QUEUES)
|
|
# define OMNITRACE_MAX_ROCM_QUEUES OMNITRACE_MAX_THREADS
|
|
#endif
|
|
|
|
#define OMNITRACE_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
|
#define OMNITRACE_VISIBILITY(MODE) OMNITRACE_ATTRIBUTE(visibility(MODE))
|
|
#define OMNITRACE_PUBLIC_API OMNITRACE_VISIBILITY("default")
|
|
#define OMNITRACE_HIDDEN_API OMNITRACE_VISIBILITY("hidden")
|
|
#define OMNITRACE_INLINE OMNITRACE_ATTRIBUTE(always_inline) inline
|
|
#define OMNITRACE_NOINLINE OMNITRACE_ATTRIBUTE(noinline)
|
|
#define OMNITRACE_HOT OMNITRACE_ATTRIBUTE(hot)
|
|
#define OMNITRACE_COLD OMNITRACE_ATTRIBUTE(cold)
|
|
#define OMNITRACE_CONST OMNITRACE_ATTRIBUTE(const)
|
|
#define OMNITRACE_PURE OMNITRACE_ATTRIBUTE(pure)
|
|
#define OMNITRACE_WEAK OMNITRACE_ATTRIBUTE(weak)
|
|
#define OMNITRACE_PACKED OMNITRACE_ATTRIBUTE(__packed__)
|
|
#define OMNITRACE_PACKED_ALIGN(VAL) OMNITRACE_PACKED OMNITRACE_ATTRIBUTE(__aligned__(VAL))
|
|
|
|
#if defined(OMNITRACE_CI) && OMNITRACE_CI > 0
|
|
# if defined(NDEBUG)
|
|
# undef NDEBUG
|
|
# endif
|
|
# if !defined(DEBUG)
|
|
# define DEBUG 1
|
|
# endif
|
|
# if defined(__cplusplus)
|
|
# include <cassert>
|
|
# else
|
|
# include <assert.h>
|
|
# endif
|
|
#endif
|
|
|
|
#define OMNITRACE_STRINGIZE(X) OMNITRACE_STRINGIZE2(X)
|
|
#define OMNITRACE_STRINGIZE2(X) #X
|
|
#define OMNITRACE_VAR_NAME_COMBINE(X, Y) X##Y
|
|
#define OMNITRACE_VARIABLE(X, Y) OMNITRACE_VAR_NAME_COMBINE(X, Y)
|
|
#define OMNITRACE_LINESTR OMNITRACE_STRINGIZE(__LINE__)
|
|
#define OMNITRACE_ESC(...) __VA_ARGS__
|
|
|
|
#if defined(__cplusplus)
|
|
# if !defined(OMNITRACE_FOLD_EXPRESSION)
|
|
# define OMNITRACE_FOLD_EXPRESSION(...) ((__VA_ARGS__), ...)
|
|
# endif
|
|
#endif
|