Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix requested_stats_count value cause no performance counters working #1055

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions framework/stats/hwcpipe_stats_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ HWCPipeStatsProvider::HWCPipeStatsProvider(std::set<StatIndex> &requested_stats)
requested_stats.erase(iter.first);
}

requested_stats_count = requested_stats.size();
stat_data_count = stat_data.size();

sampler = std::make_unique<hwcpipe::sampler<>>(config);

if (requested_stats_count > 0)
if (stat_data_count > 0)
{
ec = sampler->start_sampling();
if (ec)
Expand All @@ -156,7 +156,7 @@ HWCPipeStatsProvider::~HWCPipeStatsProvider()
{
std::error_code ec;

if (requested_stats_count > 0)
if (stat_data_count > 0)
{
ec = sampler->stop_sampling();
if (ec)
Expand Down Expand Up @@ -204,7 +204,7 @@ StatsProvider::Counters HWCPipeStatsProvider::sample(float delta_time)
{
Counters res;

if (requested_stats_count < 1)
if (stat_data_count < 1)
{
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion framework/stats/hwcpipe_stats_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class HWCPipeStatsProvider : public StatsProvider
private:
std::unique_ptr<hwcpipe::sampler<>> sampler;

size_t requested_stats_count{0};
size_t stat_data_count{0};

// Only stats which are available and were requested end up in stat_data
StatDataMap stat_data;
Expand Down
Loading