profiling: Remove some #ifdefs
authorVolker Lendecke <vl@samba.org>
Thu, 2 Oct 2014 13:36:22 +0000 (13:36 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 3 Oct 2014 17:55:09 +0000 (19:55 +0200)
The DO_PROFILE_INC thingies already #define to nothing without
WITH_PROFILE, and any sane compiler will just not compile the if-condition
if there is no body to be executed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/fileio.c
source3/smbd/server.c

index b0da7a2af2f1ba10e76895b4ea320febcd55c706..91b3102f9c51ac64c3701093f53952344cc2d7b1 100644 (file)
@@ -345,12 +345,10 @@ ssize_t write_file(struct smb_request *req,
 
        mark_file_modified(fsp);
 
-#ifdef WITH_PROFILE
        DO_PROFILE_INC(writecache_total_writes);
        if (!fsp->oplock_type) {
                DO_PROFILE_INC(writecache_non_oplock_writes);
        }
-#endif
 
        /*
         * If this file is level II oplocked then we need
@@ -826,13 +824,11 @@ n = %u, wcp->offset=%.0f, wcp->data_size=%u\n",
         */
 
        if (n) {
-#ifdef WITH_PROFILE
                if (wcp->data_size) {
                        DO_PROFILE_INC(writecache_abutted_writes);
                } else {
                        DO_PROFILE_INC(writecache_init_writes);
                }
-#endif
 
                if ((wcp->data_size == 0)
                    && (pos > wcp->file_size)
@@ -997,11 +993,9 @@ ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason)
        DEBUG(9,("flushing write cache: fd = %d, off=%.0f, size=%u\n",
                fsp->fh->fd, (double)wcp->offset, (unsigned int)data_size));
 
-#ifdef WITH_PROFILE
        if(data_size == wcp->alloc_size) {
                DO_PROFILE_INC(writecache_num_perfect_writes);
        }
-#endif
 
        ret = real_write_file(NULL, fsp, wcp->data, wcp->offset, data_size);
 
index 658f26870e6f97089f84312c5a783acb10718b42..8b9a1c1a96ff5875463ec5bd62546f4f5b2e8f1e 100644 (file)
@@ -1304,7 +1304,6 @@ extern void build_options(bool screen);
 
        init_structs();
 
-#ifdef WITH_PROFILE
        if (!profile_setup(msg_ctx, False)) {
                DEBUG(0,("ERROR: failed to setup profiling\n"));
                return -1;
@@ -1317,7 +1316,6 @@ extern void build_options(bool screen);
                src.pid = getpid();
                set_profile_level(pl, src);
        }
-#endif
 
        if (!is_daemon && !is_a_socket(0)) {
                if (!interactive) {