summaryrefslogtreecommitdiff
path: root/gxp-usage-stats.h
blob: 2f63557cd74565b816006440431b867180888cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * DSP usage stats header
 *
 * Copyright (C) 2022 Google LLC
 */

#ifndef __GXP_USAGE_STATS_H__
#define __GXP_USAGE_STATS_H__

#include <gcip/gcip-usage-stats.h>

#include "gxp-internal.h"

#define GXP_USAGE_METRIC_VERSION GCIP_USAGE_STATS_V2

/* Stores the usage of DSP which is collected from the GET_USAGE KCI metrics. */
struct gxp_usage_stats {
	struct gxp_dev *gxp;
	struct gcip_usage_stats ustats;
};

/* Parses the buffer from the get_usage KCI and updates the usage_stats of @gxp. */
void gxp_usage_stats_process_buffer(struct gxp_dev *gxp, void *buf);

/* Initializes the usage_stats of gxp to process the get_usage KCI. */
void gxp_usage_stats_init(struct gxp_dev *gxp);

/* Cleans up the usage_stats of gxp which is initialized by `gxp_usage_stats_init`. */
void gxp_usage_stats_exit(struct gxp_dev *gxp);

#endif /* __GXP_USAGE_STATS_H__ */