ptdump_debugfs.c 471 B

12345678910111213141516171819202122
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/debugfs.h>
  3. #include <linux/seq_file.h>
  4. #include <asm/ptdump.h>
  5. static int ptdump_show(struct seq_file *m, void *v)
  6. {
  7. struct ptdump_info *info = m->private;
  8. ptdump_walk_pgd(m, info);
  9. return 0;
  10. }
  11. DEFINE_SHOW_ATTRIBUTE(ptdump);
  12. int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
  13. {
  14. struct dentry *pe;
  15. pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops);
  16. return pe ? 0 : -ENOMEM;
  17. }