Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 2 | #include <linux/debugfs.h> |
Anshuman Khandual | bf2b59f | 2020-03-04 09:58:42 +0530 | [diff] [blame] | 3 | #include <linux/memory_hotplug.h> |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 4 | #include <linux/seq_file.h> |
| 5 | |
| 6 | #include <asm/ptdump.h> |
| 7 | |
| 8 | static int ptdump_show(struct seq_file *m, void *v) |
| 9 | { |
| 10 | struct ptdump_info *info = m->private; |
Anshuman Khandual | bf2b59f | 2020-03-04 09:58:42 +0530 | [diff] [blame] | 11 | |
| 12 | get_online_mems(); |
Steven Price | 102f45f | 2020-02-03 17:36:29 -0800 | [diff] [blame] | 13 | ptdump_walk(m, info); |
Anshuman Khandual | bf2b59f | 2020-03-04 09:58:42 +0530 | [diff] [blame] | 14 | put_online_mems(); |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 15 | return 0; |
| 16 | } |
Peng Donglin | 90aff8d | 2018-06-13 09:11:56 +0800 | [diff] [blame] | 17 | DEFINE_SHOW_ATTRIBUTE(ptdump); |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 18 | |
Greg Kroah-Hartman | e2a2e56 | 2019-01-22 15:41:11 +0100 | [diff] [blame] | 19 | void ptdump_debugfs_register(struct ptdump_info *info, const char *name) |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 20 | { |
Greg Kroah-Hartman | e2a2e56 | 2019-01-22 15:41:11 +0100 | [diff] [blame] | 21 | debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); |
Laura Abbott | 4ddb9bf | 2016-10-27 09:27:31 -0700 | [diff] [blame] | 22 | } |