mirror of
https://github.com/elwrcl/intel-hard-graphics.git
synced 2026-10-31 19:08:03 +03:00
init
This commit is contained in:
12511 files changed
+6156641
No files matched your search
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright © 2020 Collabora, Ltd.
|
||||
* Author: Antonio Caggiano <[email protected]>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef ANDROID_LIBPERFETTO
|
||||
#include <perfetto.h>
|
||||
#else
|
||||
#include <perfetto/tracing.h>
|
||||
#include <perfetto/common/gpu_counter_descriptor.gen.h>
|
||||
#include <perfetto/common/gpu_counter_descriptor.pbzero.h>
|
||||
#include <perfetto/config/gpu/gpu_counter_config.pbzero.h>
|
||||
#include <perfetto/trace/clock_snapshot.pbzero.h>
|
||||
#include <perfetto/trace/gpu/gpu_counter_event.pbzero.h>
|
||||
#endif
|
||||
|
||||
#define PPS_LOG PERFETTO_LOG
|
||||
#define PPS_LOG_IMPORTANT PERFETTO_ILOG
|
||||
#define PPS_LOG_ERROR PERFETTO_ELOG
|
||||
#define PPS_LOG_FATAL PERFETTO_FATAL
|
||||
|
||||
namespace pps
|
||||
{
|
||||
enum class State {
|
||||
Stop, // initial state, or stopped by the tracing service
|
||||
Start, // running, sampling data
|
||||
};
|
||||
|
||||
/// @brief Checks whether a return value is valid
|
||||
/// @param res Result from a syscall
|
||||
/// @param msg Message to prepend to strerror
|
||||
/// @return True if ok, false otherwise
|
||||
bool check(int res, const char *msg);
|
||||
|
||||
void make_thread_rt();
|
||||
|
||||
/// @param num Numerator
|
||||
/// @param den Denominator
|
||||
/// @return A ratio between two floating point numbers, or 0 if the denominator is 0
|
||||
constexpr double ratio(double num, double den)
|
||||
{
|
||||
return den > 0.0 ? num / den : 0.0;
|
||||
}
|
||||
|
||||
} // namespace pps
|
||||
Reference in new issue
Block a user