aboutsummaryrefslogtreecommitdiff
path: root/driver/gator_events_mali_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/gator_events_mali_common.c')
-rw-r--r--driver/gator_events_mali_common.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/driver/gator_events_mali_common.c b/driver/gator_events_mali_common.c
index dc58dcf..4f2cce4 100644
--- a/driver/gator_events_mali_common.c
+++ b/driver/gator_events_mali_common.c
@@ -8,26 +8,6 @@
*/
#include "gator_events_mali_common.h"
-static u32 gator_mali_get_id(void)
-{
- return MALI_SUPPORT;
-}
-
-extern const char *gator_mali_get_mali_name(void)
-{
- u32 id = gator_mali_get_id();
-
- switch (id) {
- case MALI_T6xx:
- return "Mali-T6xx";
- case MALI_4xx:
- return "Mali-4xx";
- default:
- pr_debug("gator: Mali-T6xx: unknown Mali ID (%d)\n", id);
- return "Mali-Unknown";
- }
-}
-
extern int gator_mali_create_file_system(const char *mali_name, const char *event_name, struct super_block *sb, struct dentry *root, mali_counter *counter, unsigned long *event)
{
int err;
@@ -42,24 +22,31 @@ extern int gator_mali_create_file_system(const char *mali_name, const char *even
dir = gatorfs_mkdir(sb, root, buf);
if (dir == NULL) {
- pr_debug("gator: Mali-T6xx: error creating file system for: %s (%s)", event_name, buf);
+ pr_debug("gator: %s: error creating file system for: %s (%s)", mali_name, event_name, buf);
return -1;
}
err = gatorfs_create_ulong(sb, dir, "enabled", &counter->enabled);
if (err != 0) {
- pr_debug("gator: Mali-T6xx: error calling gatorfs_create_ulong for: %s (%s)", event_name, buf);
+ pr_debug("gator: %s: error calling gatorfs_create_ulong for: %s (%s)", mali_name, event_name, buf);
return -1;
}
err = gatorfs_create_ro_ulong(sb, dir, "key", &counter->key);
if (err != 0) {
- pr_debug("gator: Mali-T6xx: error calling gatorfs_create_ro_ulong for: %s (%s)", event_name, buf);
+ pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
return -1;
}
+ if (counter->cores != -1) {
+ err = gatorfs_create_ro_ulong(sb, dir, "cores", &counter->cores);
+ if (err != 0) {
+ pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
+ return -1;
+ }
+ }
if (event != NULL) {
err = gatorfs_create_ulong(sb, dir, "event", event);
if (err != 0) {
- pr_debug("gator: Mali-T6xx: error calling gatorfs_create_ro_ulong for: %s (%s)", event_name, buf);
+ pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
return -1;
}
}
@@ -77,5 +64,6 @@ extern void gator_mali_initialise_counters(mali_counter counters[], unsigned int
counter->key = gator_events_get_key();
counter->enabled = 0;
+ counter->cores = -1;
}
}