This source file includes following definitions.
- asids_seq_show
- asids_debugfs_open
- asids_debugfs_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <linux/init.h>
20 #include <linux/debugfs.h>
21 #include <linux/seq_file.h>
22 #include <linux/spinlock.h>
23 #include <linux/sched/signal.h>
24 #include <linux/sched/task.h>
25
26 #include <asm/processor.h>
27 #include <asm/mmu_context.h>
28
29 static int asids_seq_show(struct seq_file *file, void *iter)
30 {
31 struct task_struct *p;
32
33 read_lock(&tasklist_lock);
34
35 for_each_process(p) {
36 int pid = p->pid;
37
38 if (unlikely(!pid))
39 continue;
40
41 if (p->mm)
42 seq_printf(file, "%5d : %04lx\n", pid,
43 cpu_asid(smp_processor_id(), p->mm));
44 }
45
46 read_unlock(&tasklist_lock);
47
48 return 0;
49 }
50
51 static int asids_debugfs_open(struct inode *inode, struct file *file)
52 {
53 return single_open(file, asids_seq_show, inode->i_private);
54 }
55
56 static const struct file_operations asids_debugfs_fops = {
57 .owner = THIS_MODULE,
58 .open = asids_debugfs_open,
59 .read = seq_read,
60 .llseek = seq_lseek,
61 .release = single_release,
62 };
63
64 static int __init asids_debugfs_init(void)
65 {
66 debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, NULL,
67 &asids_debugfs_fops);
68 return 0;
69 }
70 device_initcall(asids_debugfs_init);