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, struct 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 if (mali_name == NULL)
21 snprintf(buf, sizeof(buf), "ARM_Mali-%s", event_name);
23 snprintf(buf, sizeof(buf), "ARM_Mali-%s_%s", mali_name, event_name);
25 dir = gatorfs_mkdir(sb, root, buf);
28 pr_debug("gator: %s: error creating file system for: %s (%s)\n", mali_name, event_name, buf);
32 err = gatorfs_create_ulong(sb, dir, "enabled", &counter->enabled);
34 pr_debug("gator: %s: error calling gatorfs_create_ulong for: %s (%s)\n", mali_name, event_name, buf);
37 err = gatorfs_create_ro_ulong(sb, dir, "key", &counter->key);
39 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)\n", mali_name, event_name, buf);
42 if (counter->cores != -1) {
43 err = gatorfs_create_ro_ulong(sb, dir, "cores", &counter->cores);
45 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)\n", mali_name, event_name, buf);
50 err = gatorfs_create_ulong(sb, dir, "event", event);
52 pr_debug("gator: %s: error calling gatorfs_create_ro_ulong for: %s (%s)\n", mali_name, event_name, buf);
61 extern void gator_mali_initialise_counters(struct mali_counter counters[], unsigned int n_counters)
65 for (cnt = 0; cnt < n_counters; cnt++) {
66 struct mali_counter *counter = &counters[cnt];
68 counter->key = gator_events_get_key();