summaryrefslogtreecommitdiffstats
path: root/connector
diff options
context:
space:
mode:
authorWe-unite <3205135446@qq.com>2024-08-01 16:52:46 +0800
committerWe-unite <3205135446@qq.com>2024-08-02 19:11:13 +0800
commitf29dff60ef36ef9903df4f767393bcba2ac3ce83 (patch)
treed2d05791c237428c98c4796d9bc965baa40208be /connector
parent3efeef969ebc344c993ce0fc46f557c7d8560525 (diff)
downloadgodo-f29dff60ef36ef9903df4f767393bcba2ac3ce83.tar.gz
godo-f29dff60ef36ef9903df4f767393bcba2ac3ce83.zip
Open is well, but we're back to original question.
It's the check(cooked Event) function that causes fileopen crushed, and now I'am sorry to say that i've forgot why i add this function, maybe to check ppid and pid in database in just one function but not the head of each function. However, the check in each function isn't deleted. I discover it by comparing source code with 5d244e3. In theory this would only result in the increase of delay. How does it affect on the fileopen and causes failure? No one knows. The same to kernel connector. If we still add delay while pid exits, the connector will say "Error recv: no enough buffer space", but if we delete the delay, all modules work well. What actually makes the delay in pid exit causes no enouth buffer of connector? How outra- geous it is! Now I've come back to the original question: when i start and use docker quickly(`start && exec && exit` in just one command), the file open/write/close is faithfully recorded; but if i use interactive shell and use vim to change file in docker, nothing happens. Why? Why? Why?
Diffstat (limited to 'connector')
-rw-r--r--connector/hello.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/connector/hello.c b/connector/hello.c
index 5240c15..c0fc633 100644
--- a/connector/hello.c
+++ b/connector/hello.c
@@ -8,11 +8,10 @@
8#include <signal.h> 8#include <signal.h>
9#include <linux/netlink.h> 9#include <linux/netlink.h>
10#include <linux/connector.h> 10#include <linux/connector.h>
11// #include <linux/cn_proc.h> 11#include <linux/cn_proc.h>
12#include <unistd.h> 12#include <unistd.h>
13#include <errno.h> 13#include <errno.h>
14#include <time.h> 14#include <time.h>
15#include "cn_proc.h"
16 15
17typedef struct __attribute__((aligned(NLMSG_ALIGNTO))) 16typedef struct __attribute__((aligned(NLMSG_ALIGNTO)))
18{ 17{
@@ -55,16 +54,16 @@ void Now()
55 54
56void printEvent() 55void printEvent()
57{ 56{
58 union unnamed *procEvent = &proc_msg.proc_ev.event_data; 57 // union unnamed *procEvent = &proc_msg.proc_ev.event_data;
59 switch (proc_msg.proc_ev.what) 58 switch (proc_msg.proc_ev.what)
60 { 59 {
61 case PROC_EVENT_FORK: 60 case PROC_EVENT_FORK:
62 Now(); 61 Now();
63 printf("Fork\t%6d\t%6d\t%6d\t%6d\n", procEvent->fork.parent_pid, procEvent->fork.parent_tgid, procEvent->fork.child_pid, procEvent->fork.child_tgid); 62 printf("Fork\t%6d\t%6d\t%6d\t%6d\n", proc_msg.proc_ev.event_data.fork.parent_pid, proc_msg.proc_ev.event_data.fork.parent_tgid, proc_msg.proc_ev.event_data.fork.child_pid, proc_msg.proc_ev.event_data.fork.child_tgid);
64 break; 63 break;
65 case PROC_EVENT_EXIT: 64 case PROC_EVENT_EXIT:
66 Now(); 65 Now();
67 printf("Exit\t%6d\t%6d\t%6d\t%6d\n", procEvent->exit.process_pid, procEvent->exit.process_tgid, procEvent->exit.exit_code, procEvent->exit.exit_signal); 66 printf("Exit\t%6d\t%6d\t%6d\t%6d\n", proc_msg.proc_ev.event_data.exit.process_pid, proc_msg.proc_ev.event_data.exit.process_tgid, proc_msg.proc_ev.event_data.exit.exit_code, proc_msg.proc_ev.event_data.exit.exit_signal);
68 break; 67 break;
69 case PROC_EVENT_EXEC: 68 case PROC_EVENT_EXEC:
70 default: 69 default: