2 * ust-basic-tracing.c - Basic single-session, single-channel, single-process UST tracing
4 * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; only version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307, USA.
21 #define _LARGEFILE64_SOURCE
29 #include <sys/types.h>
34 #include <urcu/futex.h>
35 #include <urcu/uatomic.h>
37 #include <sys/socket.h>
39 #include "lttng-ust-comm.h"
40 #include "../../libringbuffer/backend.h"
41 #include "../../libringbuffer/frontend.h"
43 #define MAX_NR_STREAMS 64
44 #define MAX_NR_EVENTS 128
50 uint64_t memory_map_size
;
53 static int session_handle
;
54 static struct object_data metadata_stream_data
;
55 static struct object_data metadata_data
;
56 static struct object_data channel_data
;
57 static struct object_data stream_data
[MAX_NR_STREAMS
];
58 static int event_handle
[MAX_NR_EVENTS
];
59 static int context_handle
;
61 static int apps_socket
= -1;
62 static char apps_sock_path
[PATH_MAX
];
63 static char local_apps_wait_shm_path
[PATH_MAX
];
65 static volatile int quit_program
;
67 static void handle_signals(int signo
)
72 static int send_app_msg(int sock
, struct lttcomm_ust_msg
*lum
)
76 len
= lttcomm_send_unix_sock(sock
, lum
, sizeof(*lum
));
79 printf("message successfully sent\n");
82 if (errno
== ECONNRESET
) {
83 printf("remote end closed connection\n");
88 printf("incorrect message size: %zd\n", len
);
94 static int recv_app_reply(int sock
, struct lttcomm_ust_reply
*lur
,
95 uint32_t expected_handle
, uint32_t expected_cmd
)
99 memset(lur
, 0, sizeof(*lur
));
100 len
= lttcomm_recv_unix_sock(sock
, lur
, sizeof(*lur
));
102 case 0: /* orderly shutdown */
103 printf("Application has performed an orderly shutdown\n");
106 printf("result message received\n");
107 if (lur
->handle
!= expected_handle
) {
108 printf("Unexpected result message handle\n");
112 if (lur
->cmd
!= expected_cmd
) {
113 printf("Unexpected result message command\n");
116 if (lur
->ret_code
!= LTTCOMM_OK
) {
117 printf("remote operation failed with code %d.\n",
119 return lur
->ret_code
;
123 if (errno
== ECONNRESET
) {
124 printf("remote end closed connection\n");
129 printf("incorrect message size: %zd\n", len
);
130 return len
> 0 ? -1 : len
;
134 static int send_app_cmd(int sock
,
135 struct lttcomm_ust_msg
*lum
,
136 struct lttcomm_ust_reply
*lur
)
140 ret
= send_app_msg(sock
, lum
);
143 ret
= recv_app_reply(sock
, lur
, lum
->handle
, lum
->cmd
);
151 * Receives a single fd from socket.
153 * Returns the size of received data
155 static int lttcomm_recv_fd(int sock
)
160 struct cmsghdr
*cmsg
;
161 char recv_fd
[CMSG_SPACE(sizeof(int))];
162 struct msghdr msg
= { 0 };
169 /* Prepare to receive the structures */
170 iov
[0].iov_base
= &data_fd
;
171 iov
[0].iov_len
= sizeof(data_fd
);
174 msg
.msg_control
= recv_fd
;
175 msg
.msg_controllen
= sizeof(recv_fd
);
177 printf("Waiting to receive fd\n");
178 if ((ret
= recvmsg(sock
, &msg
, 0)) < 0) {
182 if (ret
!= sizeof(data_fd
)) {
183 printf("Received %d bytes, expected %ld", ret
, sizeof(data_fd
));
186 cmsg
= CMSG_FIRSTHDR(&msg
);
188 printf("Invalid control message header\n");
192 if (cmsg
->cmsg_level
!= SOL_SOCKET
|| cmsg
->cmsg_type
!= SCM_RIGHTS
) {
193 printf("Didn't received any fd\n");
198 for (i
= 0; i
< sizeof(int); i
++)
199 tmp
.vc
[i
] = CMSG_DATA(cmsg
)[i
];
201 printf("received fd %d\n", ret
);
208 int open_streams(int sock
, int channel_handle
, struct object_data
*stream_datas
,
214 struct lttcomm_ust_msg lum
;
215 struct lttcomm_ust_reply lur
;
217 memset(&lum
, 0, sizeof(lum
));
218 lum
.handle
= channel_handle
;
219 lum
.cmd
= LTTNG_UST_STREAM
;
220 ret
= send_app_cmd(sock
, &lum
, &lur
);
222 assert(k
< nr_check
);
223 stream_datas
[k
].handle
= lur
.ret_val
;
224 printf("received stream handle %u\n",
225 stream_datas
[k
].handle
);
226 if (lur
.ret_code
== LTTCOMM_OK
) {
229 stream_datas
[k
].memory_map_size
= lur
.u
.stream
.memory_map_size
;
231 len
= lttcomm_recv_fd(sock
);
234 stream_datas
[k
].shm_fd
= len
;
236 len
= lttcomm_recv_fd(sock
);
239 stream_datas
[k
].wait_fd
= len
;
252 int close_streams(int sock
, struct object_data
*stream_datas
, int nr_check
)
256 for (k
= 0; k
< nr_check
; k
++) {
257 struct lttcomm_ust_msg lum
;
258 struct lttcomm_ust_reply lur
;
260 if (!stream_datas
[k
].handle
)
262 memset(&lum
, 0, sizeof(lum
));
263 lum
.handle
= stream_datas
[k
].handle
;
264 lum
.cmd
= LTTNG_UST_RELEASE
;
265 ret
= send_app_cmd(sock
, &lum
, &lur
);
267 printf("Error closing stream\n");
270 if (stream_datas
[k
].shm_fd
>= 0) {
271 ret
= close(stream_datas
[k
].shm_fd
);
273 printf("Error closing stream shm_fd\n");
277 if (stream_datas
[k
].wait_fd
>= 0) {
278 ret
= close(stream_datas
[k
].wait_fd
);
280 printf("Error closing stream wait_fd\n");
289 struct shm_handle
*map_channel(struct object_data
*chan_data
,
290 struct object_data
*stream_datas
, int nr_check
)
292 struct shm_handle
*handle
;
293 struct channel
*chan
;
296 /* map metadata channel */
297 handle
= channel_handle_create(chan_data
->shm_fd
,
299 chan_data
->memory_map_size
);
301 printf("create handle error\n");
304 chan_data
->shm_fd
= -1;
305 chan_data
->wait_fd
= -1;
306 chan
= shmp(handle
, handle
->chan
);
308 for (k
= 0; k
< nr_check
; k
++) {
309 struct object_data
*stream_data
= &stream_datas
[k
];
311 if (!stream_data
->handle
)
314 ret
= channel_handle_add_stream(handle
,
316 stream_data
->wait_fd
,
317 stream_data
->memory_map_size
);
319 printf("add stream error\n");
322 stream_data
->shm_fd
= -1;
323 stream_data
->wait_fd
= -1;
328 channel_destroy(chan
, handle
, 1);
333 void unmap_channel(struct shm_handle
*handle
)
335 struct channel
*chan
;
337 chan
= shmp(handle
, handle
->chan
);
339 channel_destroy(chan
, handle
, 1);
343 int consume_stream(struct shm_handle
*handle
, int cpu
, char *outfile
)
345 struct channel
*chan
;
346 struct lib_ring_buffer
*buf
;
349 uint64_t memory_map_size
;
351 chan
= shmp(handle
, handle
->chan
);
354 buf
= channel_get_ring_buffer(&chan
->backend
.config
,
355 chan
, cpu
, handle
, &shm_fd
, &wait_fd
, &memory_map_size
);
358 ret
= lib_ring_buffer_open_read(buf
, handle
, 1);
364 outfd
= open(outfile
, O_WRONLY
| O_CREAT
| O_LARGEFILE
| O_TRUNC
,
365 S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
);
367 perror("open output");
371 printf("Waiting for buffer data for %s\n", outfile
);
373 unsigned long read_size
;
374 unsigned long copy_size
;
377 ret
= lib_ring_buffer_get_next_subbuf(buf
, handle
);
378 printf("get next ret %d\n", ret
);
381 if (ret
== -EAGAIN
) {
386 printf("Error %d in lib_ring_buffer_get_next_subbuf\n", ret
);
389 read_size
= lib_ring_buffer_get_read_data_size(
390 &chan
->backend
.config
, buf
, handle
);
391 read_size
= PAGE_ALIGN(read_size
);
392 ptr
= lib_ring_buffer_read_offset_address(
393 &buf
->backend
, 0, handle
);
394 printf("WRITE: copy %lu bytes\n", read_size
);
395 copy_size
= write(outfd
, ptr
, read_size
);
396 if (copy_size
< read_size
) {
397 printf("write issue: copied %zd, expected %lu\n", copy_size
, read_size
);
399 lib_ring_buffer_put_next_subbuf(buf
, handle
);
409 lib_ring_buffer_release_read(buf
, handle
, 1);
414 int consume_buffers(const char *outputpath
)
418 char pathname
[PATH_MAX
];
419 struct shm_handle
*handle
;
421 snprintf(pathname
, PATH_MAX
- 1, "%s", outputpath
);
422 old_umask
= umask(0);
423 ret
= mkdir(pathname
, S_IRWXU
| S_IRWXG
);
424 if (ret
&& errno
!= EEXIST
) {
432 handle
= map_channel(&metadata_data
,
433 &metadata_stream_data
, 1);
436 snprintf(pathname
, PATH_MAX
- 1,
437 "%s/metadata", outputpath
);
438 ret
= consume_stream(handle
, -1, pathname
);
439 if (ret
&& ret
!= -ENOENT
) {
440 printf("Error in consume_stream\n");
443 unmap_channel(handle
);
445 /* copy binary data */
446 handle
= map_channel(&channel_data
,
447 stream_data
, MAX_NR_STREAMS
);
450 for (k
= 0; k
< MAX_NR_STREAMS
; k
++) {
451 snprintf(pathname
, PATH_MAX
- 1,
452 "%s/data_%u", outputpath
, k
);
453 ret
= consume_stream(handle
, k
, pathname
);
454 if (ret
&& ret
!= -ENOENT
) {
455 printf("Error in consume_stream\n");
459 unmap_channel(handle
);
464 int send_app_msgs(int sock
, const char *outputpath
,
465 unsigned int nr_events
, const char **event_names
)
467 struct lttcomm_ust_msg lum
;
468 struct lttcomm_ust_reply lur
;
472 memset(&lum
, 0, sizeof(lum
));
473 lum
.handle
= LTTNG_UST_ROOT_HANDLE
;
474 lum
.cmd
= LTTNG_UST_SESSION
;
475 ret
= send_app_cmd(sock
, &lum
, &lur
);
478 session_handle
= lur
.ret_val
;
479 printf("received session handle %u\n", session_handle
);
481 /* Create metadata channel */
482 memset(&lum
, 0, sizeof(lum
));
483 lum
.handle
= session_handle
;
484 lum
.cmd
= LTTNG_UST_METADATA
;
485 lum
.u
.channel
.overwrite
= 0;
486 lum
.u
.channel
.subbuf_size
= 32768;
487 lum
.u
.channel
.num_subbuf
= 4;
488 lum
.u
.channel
.switch_timer_interval
= 0;
489 lum
.u
.channel
.read_timer_interval
= 0;
490 lum
.u
.channel
.output
= LTTNG_UST_MMAP
;
491 ret
= send_app_cmd(sock
, &lum
, &lur
);
494 metadata_data
.handle
= lur
.ret_val
;
495 printf("received metadata handle %u\n", metadata_data
.handle
);
496 if (lur
.ret_code
== LTTCOMM_OK
) {
499 metadata_data
.memory_map_size
= lur
.u
.channel
.memory_map_size
;
501 len
= lttcomm_recv_fd(sock
);
504 metadata_data
.shm_fd
= len
;
506 len
= lttcomm_recv_fd(sock
);
509 metadata_data
.wait_fd
= len
;
512 ret
= open_streams(sock
, metadata_data
.handle
,
513 &metadata_stream_data
, 1);
515 printf("Error in open_streams\n");
519 /* Create data channel */
520 memset(&lum
, 0, sizeof(lum
));
521 lum
.handle
= session_handle
;
522 lum
.cmd
= LTTNG_UST_CHANNEL
;
523 //lum.u.channel.overwrite = 0;
524 lum
.u
.channel
.overwrite
= 1;
525 lum
.u
.channel
.subbuf_size
= 32768;
526 lum
.u
.channel
.num_subbuf
= 8;
527 //lum.u.channel.num_subbuf = 4;
528 //lum.u.channel.num_subbuf = 2;
529 lum
.u
.channel
.switch_timer_interval
= 0;
530 lum
.u
.channel
.read_timer_interval
= 0;
531 lum
.u
.channel
.output
= LTTNG_UST_MMAP
;
532 ret
= send_app_cmd(sock
, &lum
, &lur
);
535 channel_data
.handle
= lur
.ret_val
;
536 printf("received channel handle %u\n", channel_data
.handle
);
537 if (lur
.ret_code
== LTTCOMM_OK
) {
540 channel_data
.memory_map_size
= lur
.u
.channel
.memory_map_size
;
542 len
= lttcomm_recv_fd(sock
);
545 channel_data
.shm_fd
= len
;
547 len
= lttcomm_recv_fd(sock
);
550 channel_data
.wait_fd
= len
;
554 for (k
= 0; k
< nr_events
; k
++) {
555 memset(&lum
, 0, sizeof(lum
));
556 lum
.handle
= channel_data
.handle
;
557 lum
.cmd
= LTTNG_UST_EVENT
;
558 strncpy(lum
.u
.event
.name
, event_names
[k
],
559 LTTNG_UST_SYM_NAME_LEN
);
560 lum
.u
.event
.instrumentation
= LTTNG_UST_TRACEPOINT
;
561 ret
= send_app_cmd(sock
, &lum
, &lur
);
564 event_handle
[k
] = lur
.ret_val
;
565 printf("received event handle %u\n", event_handle
[k
]);
568 /* Attach vtid context */
569 memset(&lum
, 0, sizeof(lum
));
570 lum
.handle
= channel_data
.handle
;
571 lum
.cmd
= LTTNG_UST_CONTEXT
;
572 lum
.u
.context
.ctx
= LTTNG_UST_CONTEXT_VTID
;
573 //lum.u.context.ctx = LTTNG_UST_CONTEXT_PTHREAD_ID;
574 ret
= send_app_cmd(sock
, &lum
, &lur
);
577 context_handle
= lur
.ret_val
;
578 printf("received context handle %u\n", context_handle
);
580 /* Get references to channel streams */
581 ret
= open_streams(sock
, channel_data
.handle
,
582 stream_data
, MAX_NR_STREAMS
);
584 printf("Error in open_streams\n");
588 memset(&lum
, 0, sizeof(lum
));
589 lum
.handle
= session_handle
;
590 lum
.cmd
= LTTNG_UST_SESSION_START
;
591 ret
= send_app_cmd(sock
, &lum
, &lur
);
594 printf("Session handle %u started.\n", session_handle
);
596 /* Tell application registration is done */
597 memset(&lum
, 0, sizeof(lum
));
598 lum
.handle
= LTTNG_UST_ROOT_HANDLE
;
599 lum
.cmd
= LTTNG_UST_REGISTER_DONE
;
600 ret
= send_app_cmd(sock
, &lum
, &lur
);
603 printf("Registration done acknowledged.\n");
607 ret
= consume_buffers(outputpath
);
609 printf("Error in consume_buffers\n");
613 /* Release data channel */
614 /* Release streams */
615 ret
= close_streams(sock
, stream_data
,
620 /* Release context */
621 memset(&lum
, 0, sizeof(lum
));
622 lum
.handle
= context_handle
;
623 lum
.cmd
= LTTNG_UST_RELEASE
;
624 ret
= send_app_cmd(sock
, &lum
, &lur
);
629 for (k
= 0; k
< nr_events
; k
++) {
630 memset(&lum
, 0, sizeof(lum
));
631 lum
.handle
= event_handle
[k
];
632 lum
.cmd
= LTTNG_UST_RELEASE
;
633 ret
= send_app_cmd(sock
, &lum
, &lur
);
637 memset(&lum
, 0, sizeof(lum
));
638 lum
.handle
= channel_data
.handle
;
639 lum
.cmd
= LTTNG_UST_RELEASE
;
640 ret
= send_app_cmd(sock
, &lum
, &lur
);
643 if (channel_data
.shm_fd
>= 0) {
644 ret
= close(channel_data
.shm_fd
);
648 if (channel_data
.wait_fd
>= 0) {
649 ret
= close(channel_data
.wait_fd
);
654 /* Release metadata channel */
655 ret
= close_streams(sock
, &metadata_stream_data
, 1);
659 memset(&lum
, 0, sizeof(lum
));
660 lum
.handle
= metadata_data
.handle
;
661 lum
.cmd
= LTTNG_UST_RELEASE
;
662 ret
= send_app_cmd(sock
, &lum
, &lur
);
665 if (metadata_data
.shm_fd
>= 0) {
666 ret
= close(metadata_data
.shm_fd
);
670 if (metadata_data
.wait_fd
>= 0) {
671 ret
= close(metadata_data
.wait_fd
);
676 /* Release session */
677 memset(&lum
, 0, sizeof(lum
));
678 lum
.handle
= session_handle
;
679 lum
.cmd
= LTTNG_UST_RELEASE
;
680 ret
= send_app_cmd(sock
, &lum
, &lur
);
688 * Using fork to set umask in the child process (not multi-thread safe). We
689 * deal with the shm_open vs ftruncate race (happening when the sessiond owns
690 * the shm and does not let everybody modify it, to ensure safety against
691 * shm_unlink) by simply letting the mmap fail and retrying after a few
692 * seconds. For global shm, everybody has rw access to it until the sessiond
695 static int get_wait_shm(char *shm_path
, size_t mmap_size
, int global
)
697 int wait_shm_fd
, ret
;
700 /* Default permissions */
701 mode
= S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
;
703 /* Change owner of the shm path */
705 ret
= chown(shm_path
, 0, 0);
707 if (errno
!= ENOENT
) {
708 perror("chown wait shm");
714 * If global session daemon, any application can register so the shm
715 * needs to be set in read-only mode for others.
719 ret
= chown(shm_path
, getuid(), getgid());
721 if (errno
!= ENOENT
) {
722 perror("chown wait shm");
729 * Set permissions to the shm even if we did not create the shm.
731 ret
= chmod(shm_path
, mode
);
733 if (errno
!= ENOENT
) {
734 perror("chmod wait shm");
740 * We're alone in a child process, so we can modify the process-wide
746 * Try creating shm (or get rw access). We don't do an exclusive open,
747 * because we allow other processes to create+ftruncate it concurrently.
749 wait_shm_fd
= shm_open(shm_path
, O_RDWR
| O_CREAT
, mode
);
750 if (wait_shm_fd
< 0) {
751 perror("shm_open wait shm");
755 ret
= ftruncate(wait_shm_fd
, mmap_size
);
757 perror("ftruncate wait shm");
761 ret
= fchmod(wait_shm_fd
, mode
);
767 printf("Got the wait shm fd %d\n", wait_shm_fd
);
772 printf("Failing to get the wait shm fd\n");
777 int update_futex(int fd
, int active
)
779 size_t mmap_size
= sysconf(_SC_PAGE_SIZE
);
783 wait_shm_mmap
= mmap(NULL
, mmap_size
, PROT_READ
| PROT_WRITE
,
785 if (wait_shm_mmap
== MAP_FAILED
) {
791 uatomic_set((int32_t *) wait_shm_mmap
, 1);
792 futex_async((int32_t *) wait_shm_mmap
, FUTEX_WAKE
,
793 INT_MAX
, NULL
, NULL
, 0);
795 uatomic_set((int32_t *) wait_shm_mmap
, 0);
797 ret
= munmap(wait_shm_mmap
, mmap_size
);
799 perror("Error unmapping wait shm");
808 * Set open files limit to unlimited. This daemon can open a large number of
809 * file descriptors in order to consumer multiple kernel traces.
811 static void set_ulimit(void)
817 * If not root, we cannot increase our max open files. But our
818 * scope is then limited to processes from a single user.
822 /* The kernel does not allowed an infinite limit for open files */
823 lim
.rlim_cur
= 65535;
824 lim
.rlim_max
= 65535;
826 ret
= setrlimit(RLIMIT_NOFILE
, &lim
);
828 perror("failed to set open files limit");
834 * ./ust-basic-tracing outputpath event_name1 event_name2 ....
836 int main(int argc
, const char **argv
)
838 const char *home_dir
;
839 int ret
, wait_shm_fd
;
840 struct sigaction act
;
841 mode_t old_umask
= 0;
842 const char *outputpath
;
843 const char **event_names
;
844 unsigned int nr_events
;
848 printf("%s outputpath event_name1 event_name2 ...\n",
852 outputpath
= argv
[1];
853 event_names
= &argv
[2];
854 nr_events
= argc
- 2;
859 memset(&act
, 0, sizeof(act
));
860 ret
= sigemptyset(&act
.sa_mask
);
862 perror("sigemptyset");
866 act
.sa_handler
= SIG_IGN
;
867 ret
= sigaction(SIGPIPE
, &act
, NULL
);
874 act
.sa_handler
= handle_signals
;
875 ret
= sigaction(SIGTERM
, &act
, NULL
);
881 ret
= sigaction(SIGINT
, &act
, NULL
);
887 if (geteuid() == 0) {
888 ret
= mkdir(LTTNG_RUNDIR
, S_IRWXU
| S_IRWXG
| S_IROTH
| S_IXOTH
);
889 if (ret
&& errno
!= EEXIST
) {
893 wait_shm_fd
= get_wait_shm(DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH
,
894 sysconf(_SC_PAGE_SIZE
), 1);
895 if (wait_shm_fd
< 0) {
896 perror("global wait shm error");
899 strcpy(apps_sock_path
, DEFAULT_GLOBAL_APPS_UNIX_SOCK
);
900 old_umask
= umask(0);
902 snprintf(local_apps_wait_shm_path
, PATH_MAX
,
903 DEFAULT_HOME_APPS_WAIT_SHM_PATH
, getuid());
904 wait_shm_fd
= get_wait_shm(local_apps_wait_shm_path
,
905 sysconf(_SC_PAGE_SIZE
), 0);
906 if (wait_shm_fd
< 0) {
907 perror("local wait shm error");
910 home_dir
= (const char *) getenv("HOME");
912 perror("getenv error");
915 snprintf(apps_sock_path
, PATH_MAX
,
916 DEFAULT_HOME_APPS_UNIX_SOCK
, home_dir
);
919 ret
= lttcomm_create_unix_sock(apps_sock_path
);
921 perror("create error");
927 /* File permission MUST be 666 */
928 ret
= chmod(apps_sock_path
,
929 S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
| S_IROTH
| S_IWOTH
);
931 printf("Set file permissions failed: %s\n", apps_sock_path
);
937 ret
= lttcomm_listen_unix_sock(apps_socket
);
939 perror("listen error");
943 /* wake up futexes */
944 ret
= update_futex(wait_shm_fd
, 1);
946 fprintf(stderr
, "Error wakeup futex\n");
960 char name
[16]; /* Process name */
967 printf("Accepting application registration\n");
968 sock
= lttcomm_accept_unix_sock(apps_socket
);
970 perror("accept error");
975 * Basic recv here to handle the very simple data
976 * that the libust send to register (reg_msg).
978 len
= lttcomm_recv_unix_sock(sock
, ®_msg
, sizeof(reg_msg
));
979 if (len
< 0 || len
!= sizeof(reg_msg
)) {
980 perror("lttcomm_recv_unix_sock");
983 memcpy(bufname
, reg_msg
.name
, 16);
985 printf("Application %s pid %u ppid %u uid %u gid %u has registered (version : %u.%u)\n",
986 bufname
, reg_msg
.pid
, reg_msg
.ppid
, reg_msg
.uid
,
987 reg_msg
.gid
, reg_msg
.major
, reg_msg
.minor
);
988 ret
= send_app_msgs(sock
, outputpath
, nr_events
, event_names
);
990 printf("Error in send_app_msgs.\n");
997 printf("quitting.\n");
998 /* Let applications know we are not responding anymore */
999 ret
= update_futex(wait_shm_fd
, 0);
1001 fprintf(stderr
, "Error wakeup futex\n");