File tree 2 files changed +24
-12
lines changed
2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change
1
+ TARGET =proc_trav
2
+ obj-m +=$(TARGET ) .o
3
+
4
+ all :
5
+ make -C /lib/modules/$(shell uname -r) /build M=$(PWD ) modules
6
+
7
+ clean :
8
+ make -C /lib/modules/$(shell uname -r) /build M=$(PWD ) clean
9
+
10
+ check-syntax :
11
+ LANG=C make -C /lib/modules/$(shell uname -r) /build M=$(PWD ) modules
12
+
13
+ install :
14
+ sudo insmod $(TARGET ) .ko
15
+
16
+ uninstall :
17
+ sudo rmmod $(TARGET )
Original file line number Diff line number Diff line change 18
18
#include <linux/unistd.h> /* The list of system calls */
19
19
20
20
#include <linux/mm.h> /* VM_READ etc */
21
- #include <asm-x86/cacheflush.h> /* change_page_attr */
22
21
23
22
/*
24
23
* For the current (process) structure, we need
@@ -35,21 +34,17 @@ MODULE_LICENSE("GPL");
35
34
*/
36
35
int init_module ()
37
36
{
38
- int i ;
39
37
struct task_struct * task = & init_task ;
40
38
41
39
do {
42
- if (task -> uid == initial_uid ) {
43
- printk (KERN_INFO "*** %s [%d] parent %s\n" ,
44
- task -> comm , task -> trace_nid , task -> parent -> comm );
45
- task -> trace_nid != ;
46
- } else {
47
-
48
- }
49
-
50
- if (task -> trace_nid != 123 ) {
40
+ printk (KERN_INFO "*** %s [%d] parent %s\n" ,
41
+ task -> comm , task -> pid , task -> parent -> comm );
42
+ // task->trace_nid != ;
43
+ /*
44
+ if (task->trace_nid != 123) {
51
45
printk(KERN_INFO "Fucking trace_nid %d\n", task->trace_nid);
52
- }
46
+ }
47
+ */
53
48
} while ((task = next_task (task )) != & init_task );
54
49
return 0 ;
55
50
}
You can’t perform that action at this time.
0 commit comments