First bad bad pass.
[cascardo/kernel/notes/.git] / 05.debug / 2.proc / text
1 -- proc
2
3 fs/proc/ (implementações de alguns arquivos também)
4 Documentation/filesystem/proc.txt (apenas descrição de alguns arquivos)
5
6 struct file_operations (já visto em char device)
7 #include <linux/proc_fs.h>
8 PDE (proc dir entry) - detalhe de implementação
9
10 pde = create_proc_entry(name, mode, parent);
11 pde->proc_fops = &fops;
12 Propenso a corrida.
13
14 remove_proc_entry(name, parent);
15 proc_mkdir(name, parent);
16 proc_mkdir_mode(name, mode, parent);
17 proc_create(name, mode, parent, fops);
18
19 proc_net_mkdir(net, name, parent);
20 proc_net_remove(net, name);
21 proc_net_fops_create(net, name, mode, fops);
22
23 struct net * serve para limitar a um net_namespace apenas.
24
25 -- seq_file
26
27 fs/seq_file.c
28
29 #include <linux/seq_file.h>
30 Documentation/filesystems/seq_file.txt
31
32 struct seq_operations ops = {
33         .start,
34         .next,
35         .stop,
36         .show,
37 };
38
39 void * start(struct seq_file *, loff_t *pos);
40 void * next(struct seq_file *, void *, loff_t *pos);
41 void stop(struct seq_file *, void *);
42 int show(struct seq_file *, void *v);
43
44 int seq_printf(struct seq_file *, fmt, ...);
45
46 int open(struct inode *inode, struct file *fp)
47 {
48         return seq_open(fp, &seq_ops);
49 }
50
51 .read = seq_read,
52 .llseek = seq_lseek,
53 .release = seq_release,
54
55 --
56
57 seq_list_start
58 seq_list_start_head
59
60 int single_open(struct file *, show, void *data);
61 single_release
62 int show(struct seq_file *, void *);
63
64 seq_list_next