Neil Leeder | b0c8ec5 | 2013-01-07 15:12:45 -0500 | [diff] [blame] | 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/types.h> |
| 14 | #include <linux/uaccess.h> |
| 15 | #include <linux/debugfs.h> |
| 16 | |
| 17 | /* |
| 18 | * Subsequent patches should add an entry to end of this string. |
| 19 | * Format is incrementing sequence number followed by text of |
| 20 | * patch commit title with newline. |
| 21 | * Note trailing ';' is on its own line to simplify addition of |
| 22 | * future strings. |
| 23 | */ |
| 24 | static char *descriptions = |
| 25 | "0 msm: perf: add debug patch logging framework\n" |
Ashwin Chaugule | ff0eb8d | 2013-01-08 15:55:06 -0500 | [diff] [blame] | 26 | "1 Perf: Restore counter after powercollapse for generic ARM PMU's\n" |
Ashwin Chaugule | 20c4e99 | 2013-01-16 11:22:08 -0500 | [diff] [blame] | 27 | "2 Perf: Toggle PMU IRQ when CPU's are hotplugged\n" |
Neil Leeder | f7804d4 | 2013-02-19 16:10:10 -0500 | [diff] [blame] | 28 | "3 Perf: Correct irq for CPU hotplug detection\n" |
Ashwin Chaugule | 692d420 | 2013-02-20 19:12:56 -0500 | [diff] [blame] | 29 | "4 Perf: Check perf activity on correct CPU\n" |
Ashwin Chaugule | 50d5989 | 2013-03-12 12:58:51 -0400 | [diff] [blame] | 30 | "5 Perf: Add DT support for L1 and L2 PMU\n" |
Neil Leeder | 04a9b20 | 2013-03-26 17:00:54 -0400 | [diff] [blame] | 31 | "6 Perf: Add cortex A5 device tree support\n" |
Ashwin Chaugule | 4eaee1a | 2013-03-14 18:37:49 -0400 | [diff] [blame] | 32 | "7 Perf: Add L1 counters to tracepoints\n" |
Neil Leeder | b0c8ec5 | 2013-01-07 15:12:45 -0500 | [diff] [blame] | 33 | ; |
| 34 | |
| 35 | static ssize_t desc_read(struct file *fp, char __user *buf, |
| 36 | size_t count, loff_t *pos) |
| 37 | { |
| 38 | return simple_read_from_buffer(buf, count, pos, descriptions, |
| 39 | strlen(descriptions)); |
| 40 | } |
| 41 | |
| 42 | static const struct file_operations perf_debug_desc_fops = { |
| 43 | .read = desc_read, |
| 44 | }; |
| 45 | |
| 46 | static int msm_perf_debugfs_init(void) |
| 47 | { |
| 48 | int ret = 0; |
| 49 | struct dentry *dir; |
| 50 | struct dentry *file; |
| 51 | |
| 52 | dir = debugfs_create_dir("msm-perf-patches", NULL); |
| 53 | if (IS_ERR_OR_NULL(dir)) { |
| 54 | pr_err("failed to create msm-perf-patches dir in debugfs\n"); |
| 55 | ret = PTR_ERR(dir); |
| 56 | goto init_exit; |
| 57 | } |
| 58 | |
| 59 | file = debugfs_create_file("descriptions", 0444, dir, NULL, |
| 60 | &perf_debug_desc_fops); |
| 61 | if (IS_ERR_OR_NULL(file)) { |
| 62 | debugfs_remove(dir); |
| 63 | pr_err("failed to create descriptions file for msm-perf-patches\n"); |
| 64 | ret = PTR_ERR(file); |
| 65 | goto init_exit; |
| 66 | } |
| 67 | |
| 68 | init_exit: |
| 69 | return ret; |
| 70 | } |
| 71 | late_initcall(msm_perf_debugfs_init); |