The goal is to check compilation and clang-tidy at CI stage. For both compile and tidy all dependent headers are required. Compilation and tidy-check enabled by the next commit. Done by invoking the following bash commands: cp system/core/libcutils/include/cutils/native_handle.h \ system/core/libcutils/include/cutils/compiler.h \ system/core/libcutils/include/cutils/trace.h \ external/drm_hwcomposer/.ci/android_headers/cutils/ cp external/libdrm/android/gralloc_handle.h \ external/drm_hwcomposer/.ci/android_headers/gralloc_handle.h cp hardware/libhardware/include/hardware/gralloc.h \ hardware/libhardware/include/hardware/hardware.h \ hardware/libhardware/include/hardware/hwcomposer.h \ hardware/libhardware/include/hardware/hwcomposer2.h \ hardware/libhardware/include/hardware/hwcomposer_defs.h \ external/drm_hwcomposer/.ci/android_headers/hardware/ cp system/core/libsync/include/sync/sync.h \ external/drm_hwcomposer/.ci/android_headers/sync/sync.h cp system/core/libsync/include/ndk/sync.h \ external/drm_hwcomposer/.ci/android_headers/ndk/sync.h cp system/core/libsystem/include/system/graphics-base-v1.0.h \ system/core/libsystem/include/system/graphics-base-v1.1.h \ system/core/libsystem/include/system/graphics-base-v1.2.h \ system/core/libsystem/include/system/graphics-base.h \ system/core/libsystem/include/system/graphics-sw.h \ system/core/libsystem/include/system/graphics.h \ external/drm_hwcomposer/.ci/android_headers/system/ cp frameworks/native/libs/ui/include/ui/GraphicBuffer.h \ external/drm_hwcomposer/.ci/android_headers/ui/GraphicBuffer.h cp system/core/libutils/include/utils/Trace.h \ external/drm_hwcomposer/.ci/android_headers/utils/Trace.h Turn off clang-format check for these files. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
62 lines
1.5 KiB
C++
62 lines
1.5 KiB
C++
// clang-format off
|
|
/*
|
|
* Copyright (C) 2012 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef ANDROID_TRACE_H
|
|
#define ANDROID_TRACE_H
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#define ATRACE_NAME(...)
|
|
#define ATRACE_CALL()
|
|
|
|
#else // !_WIN32
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <cutils/trace.h>
|
|
|
|
// See <cutils/trace.h> for more ATRACE_* macros.
|
|
|
|
// ATRACE_NAME traces from its location until the end of its enclosing scope.
|
|
#define _PASTE(x, y) x ## y
|
|
#define PASTE(x, y) _PASTE(x,y)
|
|
#define ATRACE_NAME(name) ::android::ScopedTrace PASTE(___tracer, __LINE__)(ATRACE_TAG, name)
|
|
|
|
// ATRACE_CALL is an ATRACE_NAME that uses the current function name.
|
|
#define ATRACE_CALL() ATRACE_NAME(__FUNCTION__)
|
|
|
|
namespace android {
|
|
|
|
class ScopedTrace {
|
|
public:
|
|
inline ScopedTrace(uint64_t tag, const char* name) : mTag(tag) {
|
|
atrace_begin(mTag, name);
|
|
}
|
|
|
|
inline ~ScopedTrace() {
|
|
atrace_end(mTag);
|
|
}
|
|
|
|
private:
|
|
uint64_t mTag;
|
|
};
|
|
|
|
} // namespace android
|
|
|
|
#endif // _WIN32
|
|
|
|
#endif // ANDROID_TRACE_H
|