s3: we have clock_gettime everywhere, remove ifdefs
[nivanova/samba-autobuild/.git] / source3 / profile / profile.c
index 6d2d5ae06d8ebda6b9b38aecc47767904e66b08e..4a61753ea388e553011d19af8128bc97ac36d792 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "librpc/gen_ndr/messaging.h"
 
 #ifdef WITH_PROFILE
 #define IPC_PERMS ((S_IRUSR | S_IWUSR) | S_IRGRP | S_IROTH)
 #ifdef WITH_PROFILE
 static int shm_id;
 static bool read_only;
-#if defined(HAVE_CLOCK_GETTIME)
 clockid_t __profile_clock;
 bool have_profiling_clock = False;
 #endif
-#endif
 
 struct profile_header *profile_h;
 struct profile_stats *profile_p;
@@ -137,8 +136,6 @@ static void reqprofile_message(struct messaging_context *msg_ctx,
   open the profiling shared memory area
   ******************************************************************/
 
-#ifdef HAVE_CLOCK_GETTIME
-
 /* Find a clock. Just because the definition for a particular clock ID is
  * present doesn't mean the system actually supports it.
  */
@@ -194,7 +191,6 @@ static void init_clock_gettime(void)
                ("could not find a working clock for profiling"));
        return;
 }
-#endif
 
 bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
 {
@@ -202,9 +198,7 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
 
        read_only = rdonly;
 
-#ifdef HAVE_CLOCK_GETTIME
        init_clock_gettime();
-#endif
 
  again:
        /* try to use an existing key */
@@ -227,7 +221,7 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
        
        profile_h = (struct profile_header *)shmat(shm_id, 0, 
                                                   read_only?SHM_RDONLY:0);
-       if ((long)profile_p == -1) {
+       if ((long)profile_h == -1) {
                DEBUG(0,("Can't attach to IPC area. Error was %s\n", 
                         strerror(errno)));
                return False;
@@ -454,6 +448,25 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
            "sync_browse_lists",        /* PR_VALUE_SYNC_BROWSE_LISTS */
            "run_elections",            /* PR_VALUE_RUN_ELECTIONS */
            "election",                 /* PR_VALUE_ELECTION */
+           "smb2_negprot",             /* PR_VALUE_SMB2_NEGPROT */
+           "smb2_sesssetup",           /* PR_VALUE_SMB2_SESSETUP */
+           "smb2_logoff",              /* PR_VALUE_SMB2_LOGOFF */
+           "smb2_tcon",                /* PR_VALUE_SMB2_TCON */
+           "smb2_tdis",                /* PR_VALUE_SMB2_TDIS */
+           "smb2_create",              /* PR_VALUE_SMB2_CREATE */
+           "smb2_close",               /* PR_VALUE_SMB2_CLOSE */
+           "smb2_flush",               /* PR_VALUE_SMB2_FLUSH */
+           "smb2_read",                /* PR_VALUE_SMB2_READ */
+           "smb2_write",               /* PR_VALUE_SMB2_WRITE */
+           "smb2_lock",                /* PR_VALUE_SMB2_LOCK */
+           "smb2_ioctl",               /* PR_VALUE_SMB2_IOCTL */
+           "smb2_cancel",              /* PR_VALUE_SMB2_CANCEL */
+           "smb2_keepalive",           /* PR_VALUE_SMB2_KEEPALIVE */
+           "smb2_find",                /* PR_VALUE_SMB2_FIND */
+           "smb2_notify",              /* PR_VALUE_SMB2_NOTIFY */
+           "smb2_getinfo",             /* PR_VALUE_SMB2_GETINFO */
+           "smb2_setinfo"              /* PR_VALUE_SMB2_SETINFO */
+           "smb2_break",               /* PR_VALUE_SMB2_BREAK */
            "" /* PR_VALUE_MAX */
        };