Skip to content

Commit c927ff9

Browse files
committed
remove all the udp logging
unfinished, kinda broken, and not likely to get worked on in this lifetime
1 parent 1e9e055 commit c927ff9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+40
-2128
lines changed

child.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "tables.h"
2828
#include "trinity.h" // ARRAY_SIZE
2929
#include "uid.h"
30-
#include "udp.h"
3130
#include "utils.h" // zmalloc
3231

3332
/*
@@ -183,17 +182,6 @@ static void bind_child_to_cpu(struct childdata *child)
183182
sched_setaffinity(pid, sizeof(set), &set);
184183
}
185184

186-
static void log_child_spawned(pid_t pid, int childno)
187-
{
188-
struct msg_childspawned childmsg;
189-
190-
if (logging_enabled == FALSE)
191-
return;
192-
193-
init_msgchildhdr(&childmsg.hdr, CHILD_SPAWNED, pid, childno);
194-
sendudp((char *) &childmsg, sizeof(childmsg));
195-
}
196-
197185
/*
198186
* Called from the fork_children loop in the main process.
199187
*/
@@ -202,8 +190,6 @@ static void init_child(struct childdata *child, int childno)
202190
pid_t pid = getpid();
203191
char childname[17];
204192

205-
log_child_spawned(pid, childno);
206-
207193
/* Wait for parent to set our childno */
208194
while (pids[childno] != pid) {
209195
/* Make sure parent is actually alive to wait for us. */
@@ -388,7 +374,6 @@ static bool handle_sigreturn(int sigwas)
388374
if (sigwas != SIGALRM)
389375
output(1, "[%d] Back from signal handler! (sig was %s)\n", getpid(), strsignal(sigwas));
390376
else {
391-
log_child_signalled(child->num, pids[child->num], SIGALRM, child->op_nr);
392377
child->op_nr++;
393378
}
394379
return TRUE;

fds/bpf.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "shm.h"
2222
#include "compat.h"
2323
#include "trinity.h"
24-
#include "udp.h"
2524

2625
static int bpf(int cmd, union bpf_attr *attr, unsigned int size)
2726
{
@@ -75,15 +74,10 @@ static struct bpf_fd_types bpf_fds[] = {
7574

7675
static void bpf_map_dump(struct object *obj, bool global)
7776
{
78-
struct msg_objcreatedbpfmap objmsg;
7977
u32 type = obj->bpfobj.map_type;
8078

81-
output(2, "bpf map fd:%d type:%s\n", obj->bpfobj.map_fd, (char *)&bpf_fds[type].name);
82-
83-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_BPFMAP, global, obj);
84-
objmsg.map_fd = obj->bpfobj.map_fd;
85-
objmsg.map_type = obj->bpfobj.map_type;
86-
sendudp((char *) &objmsg, sizeof(objmsg));
79+
output(2, "bpf map fd:%d type:%s global:%d\n",
80+
obj->bpfobj.map_fd, (char *)&bpf_fds[type].name, global);
8781
}
8882

8983
static int open_bpf_fds(void)

fds/drm.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ static void drmfd_dump(struct object *obj, bool global)
3535
struct msg_objcreateddrm objmsg;
3636

3737
output(2, "drmfd:%d\n", obj->drmfd);
38-
39-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_DRM, global, obj);
40-
objmsg.fd = obj->drmfd;
41-
sendudp((char *) &objmsg, sizeof(objmsg));
4238
}
4339

4440
static int create_dumb(__unused__ int fd)

fds/epoll.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "random.h"
1313
#include "sanitise.h"
1414
#include "shm.h"
15-
#include "udp.h"
1615

1716
#define MAX_EPOLL_FDS 10
1817

@@ -24,15 +23,9 @@ static void epoll_destructor(struct object *obj)
2423
static void epoll_dump(struct object *obj, bool global)
2524
{
2625
struct epollobj *eo = &obj->epollobj;
27-
struct msg_objcreatedepoll objmsg;
2826

29-
output(2, "epoll fd:%d used create1?:%d flags:%x\n", eo->fd, eo->create1, eo->flags);
30-
31-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_EPOLL, global, obj);
32-
objmsg.fd = eo->fd;
33-
objmsg.create1 = eo->create1;
34-
objmsg.flags = eo->flags;
35-
sendudp((char *) &objmsg, sizeof(objmsg));
27+
output(2, "epoll fd:%d used create1?:%d flags:%x global:%d\n",
28+
eo->fd, eo->create1, eo->flags, global);
3629
}
3730

3831
static int open_epoll_fds(void)

fds/eventfd.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "random.h"
1414
#include "sanitise.h"
1515
#include "shm.h"
16-
#include "udp.h"
1716
#include "compat.h"
1817

1918
static void eventfd_destructor(struct object *obj)
@@ -24,15 +23,9 @@ static void eventfd_destructor(struct object *obj)
2423
static void eventfd_dump(struct object *obj, bool global)
2524
{
2625
struct eventfdobj *eo = &obj->eventfdobj;
27-
struct msg_objcreatedeventfd objmsg;
2826

29-
output(2, "eventfd fd:%d count:%d flags:%x\n", eo->fd, eo->count, eo->flags);
30-
31-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_EVENTFD, global, obj);
32-
objmsg.fd = eo->fd;
33-
objmsg.count = eo->count;
34-
objmsg.flags = eo->flags;
35-
sendudp((char *) &objmsg, sizeof(objmsg));
27+
output(2, "eventfd fd:%d count:%d flags:%x global:%d\n",
28+
eo->fd, eo->count, eo->flags, global);
3629
}
3730

3831
static int open_eventfd_fds(void)

fds/fanotify_init.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "compat.h"
1717
#include "trinity.h"
1818
#include "utils.h"
19-
#include "udp.h"
2019

2120
#define NR_FANOTIFYFDS 10
2221

@@ -37,16 +36,9 @@ static void fanotifyfd_destructor(struct object *obj)
3736
static void fanotifyfd_dump(struct object *obj, bool global)
3837
{
3938
struct fanotifyobj *fo = &obj->fanotifyobj;
40-
struct msg_objcreatedfanotify objmsg;
4139

42-
output(2, "fanotify fd:%d flags:%x eventflags:%x\n",
43-
fo->fd, fo->flags, fo->eventflags);
44-
45-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_FANOTIFY, global, obj);
46-
objmsg.fd = fo->fd;
47-
objmsg.flags = fo->flags;
48-
objmsg.eventflags = fo->eventflags;
49-
sendudp((char *) &objmsg, sizeof(objmsg));
40+
output(2, "fanotify fd:%d flags:%x eventflags:%x global:%d\n",
41+
fo->fd, fo->flags, fo->eventflags, global);
5042
}
5143

5244
static int open_fanotify_fds(void)

fds/files.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "pathnames.h"
1515
#include "random.h"
1616
#include "syscalls/syscalls.h"
17-
#include "udp.h"
1817

1918
int open_with_fopen(const char *filename, int flags)
2019
{
@@ -95,20 +94,9 @@ static void filefd_destructor(struct object *obj)
9594
static void filefd_dump(struct object *obj, bool global)
9695
{
9796
struct fileobj *fo = &obj->fileobj;
98-
struct msg_objcreatedfile objmsg;
99-
int len = strlen(fo->filename);
100-
101-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_FILE, global, obj);
102-
strncpy(objmsg.filename, fo->filename, len);
103-
memset(objmsg.filename + len, 0, MAX_PATH_LEN - len);
104-
objmsg.flags = fo->flags;
105-
objmsg.fd = fo->fd;
106-
objmsg.fopened = fo->fopened;
107-
objmsg.fcntl_flags = fo->fcntl_flags;
108-
sendudp((char *) &objmsg, sizeof(objmsg));
109-
110-
output(2, "file fd:%d filename:%s flags:%x fopened:%d fcntl_flags:%x\n",
111-
fo->fd, fo->filename, fo->flags, fo->fopened, fo->fcntl_flags);
97+
98+
output(2, "file fd:%d filename:%s flags:%x fopened:%d fcntl_flags:%x global:%d\n",
99+
fo->fd, fo->filename, fo->flags, fo->fopened, fo->fcntl_flags, global);
112100
}
113101

114102
static int open_files(void)

fds/inotify.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "random.h"
1313
#include "sanitise.h"
1414
#include "shm.h"
15-
#include "udp.h"
1615

1716
#define MAX_INOTIFY_FDS 5
1817

@@ -24,14 +23,8 @@ static void inotify_destructor(struct object *obj)
2423
static void inotify_dump(struct object *obj, bool global)
2524
{
2625
struct inotifyobj *io = &obj->inotifyobj;
27-
struct msg_objcreatedinotify objmsg;
2826

29-
output(2, "inotify fd:%d flags:%x\n", io->fd, io->flags);
30-
31-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_INOTIFY, global, obj);
32-
objmsg.fd = io->fd;
33-
objmsg.flags = io->flags;
34-
sendudp((char *) &objmsg, sizeof(objmsg));
27+
output(2, "inotify fd:%d flags:%x global:%d\n", io->fd, io->flags, global);
3528
}
3629

3730
static int open_inotify_fds(void)

fds/memfd.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "shm.h"
1616
#include "compat.h"
1717
#include "trinity.h"
18-
#include "udp.h"
1918

2019
#ifndef USE_MEMFD_CREATE
2120

@@ -40,17 +39,9 @@ static void memfd_destructor(struct object *obj)
4039
static void memfd_dump(struct object *obj, bool global)
4140
{
4241
struct memfdobj *mo = &obj->memfdobj;
43-
struct msg_objcreatedmemfd objmsg;
44-
int len;
4542

46-
output(2, "memfd fd:%d name:%s flags:%x\n", mo->fd, mo->name, mo->flags);
47-
48-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_MEMFD, global, obj);
49-
objmsg.fd = mo->fd;
50-
len = strlen(mo->name);
51-
memcpy(objmsg.name, mo->name, len);
52-
objmsg.flags = mo->flags;
53-
sendudp((char *) &objmsg, sizeof(objmsg));
43+
output(2, "memfd fd:%d name:%s flags:%x global:%d\n",
44+
mo->fd, mo->name, mo->flags, global);
5445
}
5546

5647
static int open_memfd_fds(void)

fds/perf.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "perf.h"
1414
#include "shm.h"
1515
#include "sanitise.h"
16-
#include "udp.h"
1716
#include "utils.h"
1817

1918
#define MAX_PERF_FDS 10
@@ -27,32 +26,16 @@ static void perffd_destructor(struct object *obj)
2726
static void perffd_dump(struct object *obj, bool global)
2827
{
2928
struct perfobj *po = &obj->perfobj;
30-
struct perf_event_attr *attr = obj->perfobj.eventattr;
31-
struct msg_objcreatedperf *objmsg;
32-
char *p = (char *)attr;
3329
// unsigned int i;
34-
unsigned int perfsize = sizeof(struct perf_event_attr);
3530

36-
output(2, "perf fd: %d pid:%d cpu:%d group_fd:%d flags:%lx\n",
37-
po->fd, po->pid, po->cpu, po->group_fd, po->flags);
31+
output(2, "perf fd: %d pid:%d cpu:%d group_fd:%d flags:%lx global:%d\n",
32+
po->fd, po->pid, po->cpu, po->group_fd, po->flags, global);
3833
/* output(2, " perf_event_attr:");
3934
for (i = 0; i < perfsize ; i++) {
4035
output(CONT, "%02x ", (unsigned char) p[i]);
4136
}
4237
output(CONT, "\n");
4338
*/
44-
objmsg = zmalloc(sizeof(struct msg_objcreatedperf) + perfsize);
45-
init_msgobjhdr(&objmsg->hdr, OBJ_CREATED_PERF, global, obj);
46-
objmsg->fd = po->fd;
47-
objmsg->pid = po->pid;
48-
objmsg->cpu = po->cpu;
49-
objmsg->group_fd = po->group_fd;
50-
objmsg->flags = po->flags;
51-
objmsg->eventattrsize = perfsize;
52-
memcpy(&objmsg->eventattr, p, perfsize);
53-
sendudp((char *) objmsg, sizeof(objmsg) + perfsize);
54-
55-
free(objmsg);
5639
}
5740

5841
static int open_perf_fds(void)

fds/pipes.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "sanitise.h"
1616
#include "shm.h"
1717
#include "trinity.h"
18-
#include "udp.h"
1918

2019
static void pipefd_destructor(struct object *obj)
2120
{
@@ -25,17 +24,11 @@ static void pipefd_destructor(struct object *obj)
2524
static void pipefd_dump(struct object *obj, bool global)
2625
{
2726
struct pipeobj *po = &obj->pipeobj;
28-
struct msg_objcreatedpipe objmsg;
2927

30-
output(2, "pipe fd:%d flags:%x [%s]\n",
28+
output(2, "pipe fd:%d flags:%x [%s] global:%d\n",
3129
po->fd, po->flags,
32-
po->reader ? "reader" : "writer");
33-
34-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_PIPE, global, obj);
35-
objmsg.fd = po->fd;
36-
objmsg.flags = po->flags;
37-
objmsg.reader = po->reader;
38-
sendudp((char *) &objmsg, sizeof(objmsg));
30+
po->reader ? "reader" : "writer",
31+
global);
3932
}
4033

4134
static void open_pipe_pair(unsigned int flags)

fds/sockets.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "sanitise.h"
1818
#include "shm.h"
1919
#include "trinity.h"
20-
#include "udp.h"
2120
#include "uid.h"
2221
#include "utils.h"
2322

@@ -410,18 +409,11 @@ static void socket_destructor(struct object *obj)
410409
static void socket_dump(struct object *obj, bool global)
411410
{
412411
struct socketinfo *si = &obj->sockinfo;
413-
struct msg_objcreatedsocket objmsg;
414412

415-
output(2, "socket fd:%u domain:%u (%s) type:0x%u protocol:%u\n",
413+
output(2, "socket fd:%u domain:%u (%s) type:0x%u protocol:%u global:%d\n",
416414
si->fd, si->triplet.family, get_domain_name(si->triplet.family),
417-
si->triplet.type, si->triplet.protocol);
418-
419-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_SOCKET, global, obj);
420-
objmsg.si.fd = si->fd;
421-
objmsg.si.triplet.family = si->triplet.family;
422-
objmsg.si.triplet.type = si->triplet.type;
423-
objmsg.si.triplet.protocol = si->triplet.protocol;
424-
sendudp((char *) &objmsg, sizeof(objmsg));
415+
si->triplet.type, si->triplet.protocol,
416+
global);
425417
}
426418

427419
static int open_sockets(void)

fds/testfiles.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "syscalls/syscalls.h"
1818
#include "testfile.h"
1919
#include "utils.h"
20-
#include "udp.h"
2120

2221
#define MAX_TESTFILES 4
2322
#define MAX_TESTFILE_FDS 20
@@ -30,20 +29,9 @@ static void testfile_destructor(struct object *obj)
3029
static void testfile_dump(struct object *obj, bool global)
3130
{
3231
struct fileobj *fo = &obj->testfileobj;
33-
struct msg_objcreatedfile objmsg;
34-
int len = strlen(fo->filename);
35-
36-
output(2, "testfile fd:%d filename:%s flags:%x fopened:%d fcntl_flags:%x\n",
37-
fo->fd, fo->filename, fo->flags, fo->fopened, fo->fcntl_flags);
38-
39-
init_msgobjhdr(&objmsg.hdr, OBJ_CREATED_TESTFILE, global, obj);
40-
strncpy(objmsg.filename, fo->filename, len);
41-
memset(objmsg.filename + len, 0, MAX_PATH_LEN - len);
42-
objmsg.flags = fo->flags;
43-
objmsg.fd = fo->fd;
44-
objmsg.fopened = fo->fopened;
45-
objmsg.fcntl_flags = fo->fcntl_flags;
46-
sendudp((char *) &objmsg, sizeof(objmsg));
32+
33+
output(2, "testfile fd:%d filename:%s flags:%x fopened:%d fcntl_flags:%x global:%d\n",
34+
fo->fd, fo->filename, fo->flags, fo->fopened, fo->fcntl_flags, global);
4735
}
4836

4937
static int open_testfile(struct object *obj, char *filename)

0 commit comments

Comments
 (0)