|
@@ -41,9 +41,6 @@ struct msm_perf_state {
|
|
int buftot, bufpos;
|
|
int buftot, bufpos;
|
|
|
|
|
|
unsigned long next_jiffies;
|
|
unsigned long next_jiffies;
|
|
-
|
|
|
|
- struct dentry *ent;
|
|
|
|
- struct drm_info_node *node;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
#define SAMPLE_TIME (HZ/4)
|
|
#define SAMPLE_TIME (HZ/4)
|
|
@@ -208,6 +205,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
|
|
{
|
|
{
|
|
struct msm_drm_private *priv = minor->dev->dev_private;
|
|
struct msm_drm_private *priv = minor->dev->dev_private;
|
|
struct msm_perf_state *perf;
|
|
struct msm_perf_state *perf;
|
|
|
|
+ struct dentry *ent;
|
|
|
|
|
|
/* only create on first minor: */
|
|
/* only create on first minor: */
|
|
if (priv->perf)
|
|
if (priv->perf)
|
|
@@ -222,26 +220,14 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
|
|
mutex_init(&perf->read_lock);
|
|
mutex_init(&perf->read_lock);
|
|
priv->perf = perf;
|
|
priv->perf = perf;
|
|
|
|
|
|
- perf->node = kzalloc(sizeof(*perf->node), GFP_KERNEL);
|
|
|
|
- if (!perf->node)
|
|
|
|
- goto fail;
|
|
|
|
-
|
|
|
|
- perf->ent = debugfs_create_file("perf", S_IFREG | S_IRUGO,
|
|
|
|
|
|
+ ent = debugfs_create_file("perf", S_IFREG | S_IRUGO,
|
|
minor->debugfs_root, perf, &perf_debugfs_fops);
|
|
minor->debugfs_root, perf, &perf_debugfs_fops);
|
|
- if (!perf->ent) {
|
|
|
|
|
|
+ if (!ent) {
|
|
DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n",
|
|
DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n",
|
|
minor->debugfs_root);
|
|
minor->debugfs_root);
|
|
goto fail;
|
|
goto fail;
|
|
}
|
|
}
|
|
|
|
|
|
- perf->node->minor = minor;
|
|
|
|
- perf->node->dent = perf->ent;
|
|
|
|
- perf->node->info_ent = NULL;
|
|
|
|
-
|
|
|
|
- mutex_lock(&minor->debugfs_lock);
|
|
|
|
- list_add(&perf->node->list, &minor->debugfs_list);
|
|
|
|
- mutex_unlock(&minor->debugfs_lock);
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
fail:
|
|
fail:
|
|
@@ -259,15 +245,6 @@ void msm_perf_debugfs_cleanup(struct drm_minor *minor)
|
|
|
|
|
|
priv->perf = NULL;
|
|
priv->perf = NULL;
|
|
|
|
|
|
- debugfs_remove(perf->ent);
|
|
|
|
-
|
|
|
|
- if (perf->node) {
|
|
|
|
- mutex_lock(&minor->debugfs_lock);
|
|
|
|
- list_del(&perf->node->list);
|
|
|
|
- mutex_unlock(&minor->debugfs_lock);
|
|
|
|
- kfree(perf->node);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
mutex_destroy(&perf->read_lock);
|
|
mutex_destroy(&perf->read_lock);
|
|
|
|
|
|
kfree(perf);
|
|
kfree(perf);
|