mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 07:18:06 +02:00
Rather than using always the same metric set, let the user choose when starting the producer with : INTEL_PERFETTO_METRIC_SET=RasterizerAndPixelBackend ./build/src/tool/pps/pps-producer Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rohan Garg <rohan.garg@intel.com> Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13996>
48 lines
982 B
C++
48 lines
982 B
C++
/*
|
|
* Copyright © 2021 Collabora, Ltd.
|
|
* Author: Antonio Caggiano <antonio.caggiano@collabora.com>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "dev/intel_device_info.h"
|
|
#include "perf/intel_perf.h"
|
|
#include "perf/intel_perf_query.h"
|
|
|
|
namespace pps
|
|
{
|
|
class IntelPerf
|
|
{
|
|
public:
|
|
IntelPerf(int drm_fd);
|
|
~IntelPerf();
|
|
|
|
std::vector<struct intel_perf_query_info*> get_queries() const;
|
|
|
|
bool open(uint64_t sampling_period_ns, struct intel_perf_query_info *query);
|
|
void close();
|
|
|
|
bool oa_stream_ready() const;
|
|
ssize_t read_oa_stream(void *buf, size_t bytes) const;
|
|
|
|
int drm_fd = -1;
|
|
|
|
void *ralloc_ctx = nullptr;
|
|
void *ralloc_cfg = nullptr;
|
|
|
|
struct intel_perf_context *ctx = nullptr;
|
|
struct intel_perf_config *cfg = nullptr;
|
|
|
|
// Accumulations are stored here
|
|
struct intel_perf_query_result result = {};
|
|
|
|
struct intel_device_info devinfo = {};
|
|
};
|
|
|
|
} // namespace pps
|