qt5base-lts/mkspecs/features/qt_tracepoints.prf
Rafael Roquetto 48bce2e8f0 Support for LTTNG and ETW tracing
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.

Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-28 19:17:02 +00:00

55 lines
1.7 KiB
Plaintext

# W A R N I N G
# -------------
#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#
qtPrepareTool(QMAKE_TRACEGEN, tracegen)
isEmpty(TRACEGEN_DIR): TRACEGEN_DIR = .
PROVIDER_NAME = qt$$lower($$MODULE)
INCLUDEPATH += $$absolute_path($$TRACEGEN_DIR, $$OUT_PWD)
HEADER_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints_p$${first(QMAKE_EXT_H)}
!force_bootstrap:if(qtConfig(lttng)|qtConfig(etw)) {
SOURCE_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints$${first(QMAKE_EXT_CPP)}
isEmpty(BUILDS)|build_pass {
impl_file_contents = \
"$${LITERAL_HASH}define TRACEPOINT_CREATE_PROBES" \
"$${LITERAL_HASH}define TRACEPOINT_DEFINE" \
"$${LITERAL_HASH}include \"$${HEADER_PATH}\""
write_file($$SOURCE_PATH, impl_file_contents)|error()
}
GENERATED_SOURCES += $$SOURCE_PATH
tracegen.input = TRACEPOINT_PROVIDER
tracegen.output = $$HEADER_PATH
tracegen.variable_out = HEADERS
tracegen.depends += $$QMAKE_TRACEGEN_EXE
tracegen.CONFIG = target_predeps
qtConfig(lttng) {
tracegen.commands = $$QMAKE_TRACEGEN lttng ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
QMAKE_USE_PRIVATE += lttng-ust
} else {
tracegen.commands = $$QMAKE_TRACEGEN etw ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
}
QMAKE_EXTRA_COMPILERS += tracegen
DEFINES += Q_TRACEPOINT
} else {
isEmpty(BUILDS)|build_pass {
header_file_contents = "$${LITERAL_HASH}include <private/qtrace_p.h>"
write_file($$HEADER_PATH, header_file_contents)|error()
}
}