mesa/src/tool/pps/pps_counter.cc
Antonio Caggiano 1cc72b2aef pps: Gfx-pps v0.3.0
Add the gfx-pps backbone in `src/pps`.

v2: Simplify supported drivers creation.
v3: No default getter is provided for counters.
v4: Open DRM device in read/write mode.
v5: Wait for datasource to be started.
v6: Set FIFO scheduler while sampling counters.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9652>
2021-05-07 13:41:38 +00:00

33 lines
673 B
C++

/*
* Copyright © 2019-2020 Collabora, Ltd.
* Author: Antonio Caggiano <antonio.caggiano@collabora.com>
* Author: Rohan Garg <rohan.garg@collabora.com>
* Author: Robert Beckett <bob.beckett@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#include "pps_counter.h"
#include <cassert>
#include <cstring>
#include "pps_algorithm.h"
namespace pps
{
Counter::Counter(int32_t id, const std::string &name, int32_t group)
: id {id}
, name {name}
, group {group}
{
assert(id >= 0 && "Invalid counter ID");
assert(group >= 0 && "Invalid group ID");
}
bool Counter::operator==(const Counter &other) const
{
return id == other.id;
}
} // namespace pps