#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <drm/drm_file.h>
#include "msm_drv.h"
#include "msm_gpu.h"
struct msm_perf_state { … };
#define SAMPLE_TIME …
static int wait_sample(struct msm_perf_state *perf)
{ … }
static int refill_buf(struct msm_perf_state *perf)
{ … }
static ssize_t perf_read(struct file *file, char __user *buf,
size_t sz, loff_t *ppos)
{ … }
static int perf_open(struct inode *inode, struct file *file)
{ … }
static int perf_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations perf_debugfs_fops = …;
int msm_perf_debugfs_init(struct drm_minor *minor)
{ … }
void msm_perf_debugfs_cleanup(struct msm_drm_private *priv)
{ … }
#endif