X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fshm.c;fp=src%2Fbin%2Flttng-sessiond%2Fshm.c;h=e785aaa8b05c584a248b49ecd764ef9e02ac72b0;hb=de003c688dc5a05650a45a2fa2b8e946b9aac61b;hp=584ae078f2d84fe07c32f4c8752850612908fc41;hpb=0e4cbe7e2c4c6a8343e710a3b050af8c33f95e21;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/shm.c b/src/bin/lttng-sessiond/shm.c index 584ae078f..e785aaa8b 100644 --- a/src/bin/lttng-sessiond/shm.c +++ b/src/bin/lttng-sessiond/shm.c @@ -28,6 +28,8 @@ #include +#include "benchmark.h" +#include "measures.h" #include "shm.h" /* @@ -43,6 +45,8 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) int wait_shm_fd, ret; mode_t mode; + tracepoint(ust_notify_perms_start); + /* Default permissions */ mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; @@ -88,6 +92,9 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) */ umask(~mode); + tracepoint(ust_notify_perms_stop); + + tracepoint(ust_notify_shm_start); /* * Try creating shm (or get rw access). We don't do an exclusive open, * because we allow other processes to create+ftruncate it concurrently. @@ -114,6 +121,8 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) #warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust." #endif + tracepoint(ust_notify_shm_stop); + DBG("Got the wait shm fd %d", wait_shm_fd); return wait_shm_fd; @@ -143,9 +152,12 @@ char *shm_ust_get_mmap(char *shm_path, int global) goto error; } + tracepoint(ust_notify_mmap_start); + wait_shm_mmap = mmap(NULL, mmap_size, PROT_WRITE | PROT_READ, MAP_SHARED, wait_shm_fd, 0); + tracepoint(ust_notify_mmap_stop); /* close shm fd immediately after taking the mmap reference */ ret = close(wait_shm_fd); if (ret) {