2 * Copyright (C) ARM Limited 2012-2014. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include "gator_events_mali_common.h"
11 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)
17 /* If the counter name is empty ignore it */
18 if (strlen(event_name) != 0) {
19 /* Set up the filesystem entry for this event. */
20 snprintf(buf, sizeof(buf), "ARM_%s_%s", mali_name, event_name);
22 dir = gatorfs_mkdir(sb, root, buf);
25 pr_debug("gator: %s: error creating file system for: %s (%s)", mali_name, event_name, buf);
29 err = gatorfs_create_ulong(sb, dir, "enabled", &counter->enabled);
31 pr_debug("gator: %s: error calling gatorfs_create_ulong for: %s (%s)", mali_name, event_name, buf);
34 err = gatorfs_create_ro_ulong(sb, dir, "key", &counter->key);
36 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
39 if (counter->cores != -1) {
40 err = gatorfs_create_ro_ulong(sb, dir, "cores", &counter->cores);
42 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
47 err = gatorfs_create_ulong(sb, dir, "event", event);
49 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)", mali_name, event_name, buf);
58 extern void gator_mali_initialise_counters(mali_counter counters[], unsigned int n_counters)
62 for (cnt = 0; cnt < n_counters; cnt++) {
63 mali_counter *counter = &counters[cnt];
65 counter->key = gator_events_get_key();