X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt-sessiond%2Fshm.c;h=1ccaec5d8002a7720c770c9d54fb871d752fe068;hb=4f58e6273aa4799c0d7f40bad34398ff8e118c5c;hp=7dac1659fb0508129d44f2c08f645bc470e5d435;hpb=7d0510346384fe2e67e9d3ffc132b05c4612c032;p=lttng-tools.git diff --git a/ltt-sessiond/shm.c b/ltt-sessiond/shm.c index 7dac1659f..1ccaec5d8 100644 --- a/ltt-sessiond/shm.c +++ b/ltt-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. @@ -110,6 +117,8 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) exit(EXIT_FAILURE); } + tracepoint(ust_notify_shm_stop); + DBG("Got the wait shm fd %d", wait_shm_fd); return wait_shm_fd; @@ -139,9 +148,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) {