From 4c4d72ee172a40a757e4a720f740e9ae9b7d9d91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Apr 1999 05:35:22 +0000 Subject: new files needed by profiling code (This used to be commit cae71af4536ff8bd15080f22f9a559f72ff44c68) --- source3/profile/profile.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 source3/profile/profile.c (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c new file mode 100644 index 0000000000..b685b11916 --- /dev/null +++ b/source3/profile/profile.c @@ -0,0 +1,113 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + store smbd profiling information in shared memory + Copyright (C) Andrew Tridgell 1999 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "includes.h" + +#ifdef WITH_PROFILE + +#ifndef HAVE_SYSV_IPC +#error "You must have SYSV shared memory to compile in the profiling code" +#endif + +extern int DEBUGLEVEL; + +#define SHMEM_KEY ((key_t)0x07021999) +#define SHM_MAGIC 0x6349985 +#define SHM_VERSION 1 + +#define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) + +static int shm_id; +static BOOL read_only; + +struct profile_struct *profile_p; + +/******************************************************************* + open the profiling shared memory area + ******************************************************************/ +BOOL profile_setup(BOOL rdonly) +{ + struct shmid_ds shm_ds; + + read_only = rdonly; + + again: + /* try to use an existing key */ + shm_id = shmget(SHMEM_KEY, 0, 0); + + /* if that failed then create one. There is a race condition here + if we are running from inetd. Bad luck. */ + if (shm_id == -1) { + if (read_only) return False; + shm_id = shmget(SHMEM_KEY, sizeof(*profile_p), + IPC_CREAT | IPC_EXCL | IPC_PERMS); + } + + if (shm_id == -1) { + DEBUG(0,("Can't create or use IPC area. Error was %s\n", + strerror(errno))); + return False; + } + + + profile_p = (struct profile_struct *)shmat(shm_id, 0, + read_only?SHM_RDONLY:0); + if ((long)profile_p == -1) { + DEBUG(0,("Can't attach to IPC area. Error was %s\n", + strerror(errno))); + return False; + } + + /* find out who created this memory area */ + if (shmctl(shm_id, IPC_STAT, &shm_ds) != 0) { + DEBUG(0,("ERROR shmctl : can't IPC_STAT. Error was %s\n", + strerror(errno))); + return False; + } + + if (shm_ds.shm_perm.cuid != 0 || shm_ds.shm_perm.cgid != 0) { + DEBUG(0,("ERROR: root did not create the shmem\n")); + return False; + } + + if (shm_ds.shm_segsz != sizeof(*profile_p)) { + DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", + (int)shm_ds.shm_segsz, sizeof(*profile_p))); + if (shmctl(shm_id, IPC_RMID, &shm_ds) == 0) { + goto again; + } else { + return False; + } + } + + if (!read_only && (shm_ds.shm_nattch == 1)) { + memset((char *)profile_p, 0, sizeof(*profile_p)); + DEBUG(3,("Initialised profile area\n")); + } + + return True; +} + +#else + /* to keep compilers happy about empty modules */ + void profile_dummy(void) {} +#endif -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/profile/profile.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index b685b11916..72954f90c9 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -30,10 +30,6 @@ extern int DEBUGLEVEL; -#define SHMEM_KEY ((key_t)0x07021999) -#define SHM_MAGIC 0x6349985 -#define SHM_VERSION 1 - #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) static int shm_id; @@ -52,13 +48,13 @@ BOOL profile_setup(BOOL rdonly) again: /* try to use an existing key */ - shm_id = shmget(SHMEM_KEY, 0, 0); + shm_id = shmget(PROF_SHMEM_KEY, 0, 0); /* if that failed then create one. There is a race condition here if we are running from inetd. Bad luck. */ if (shm_id == -1) { if (read_only) return False; - shm_id = shmget(SHMEM_KEY, sizeof(*profile_p), + shm_id = shmget(PROF_SHMEM_KEY, sizeof(*profile_p), IPC_CREAT | IPC_EXCL | IPC_PERMS); } @@ -101,6 +97,8 @@ BOOL profile_setup(BOOL rdonly) if (!read_only && (shm_ds.shm_nattch == 1)) { memset((char *)profile_p, 0, sizeof(*profile_p)); + profile_p->prof_shm_magic = PROF_SHM_MAGIC; + profile_p->prof_shm_version = PROF_SHM_VERSION; DEBUG(3,("Initialised profile area\n")); } -- cgit From 15c1b7663d63a481ae7719efbdd38f5a05b494d2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 11:08:08 +0000 Subject: patch from Dominik Kubla (This used to be commit 9c598e571decb449607042ba9628f68de9b45043) --- source3/profile/profile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 72954f90c9..c2d9b4ce89 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -23,10 +23,7 @@ #include "includes.h" #ifdef WITH_PROFILE - -#ifndef HAVE_SYSV_IPC -#error "You must have SYSV shared memory to compile in the profiling code" -#endif +#include extern int DEBUGLEVEL; -- cgit From ba00796e6dd13b87b7988a98e532676d9eab702c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2000 18:13:52 +0000 Subject: Herb's warning fixes. Also the POSIX locking fix. We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy. (This used to be commit dfe77c7046cbd65ee52aea7439f21503c1eac41d) --- source3/profile/profile.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index c2d9b4ce89..5b8b280c29 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -22,7 +22,6 @@ #include "includes.h" -#ifdef WITH_PROFILE #include extern int DEBUGLEVEL; @@ -34,6 +33,11 @@ static BOOL read_only; struct profile_struct *profile_p; +BOOL do_profile_flag = False; + +struct timeval profile_starttime; +struct timeval profile_endtime; + /******************************************************************* open the profiling shared memory area ******************************************************************/ @@ -99,10 +103,7 @@ BOOL profile_setup(BOOL rdonly) DEBUG(3,("Initialised profile area\n")); } + do_profile_flag = True; /* temp for now */ return True; } -#else - /* to keep compilers happy about empty modules */ - void profile_dummy(void) {} -#endif -- cgit From 74d4a3b7410547d9f65bfc26de5f22c623574afd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2000 23:01:47 +0000 Subject: Added Herb's fixes to HEAD. Jeremy. (This used to be commit 4862d2ab1163310d844b929fb17239b4f4cb1a99) --- source3/profile/profile.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 5b8b280c29..87f5e2c9b2 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -34,10 +34,36 @@ static BOOL read_only; struct profile_struct *profile_p; BOOL do_profile_flag = False; +BOOL do_profile_times = False; struct timeval profile_starttime; struct timeval profile_endtime; +/**************************************************************************** +receive a set profile level message +****************************************************************************/ +void profile_message(int msg_type, pid_t src, void *buf, size_t len) +{ + int level; + + memcpy(&level, buf, sizeof(int)); + switch (level) { + case 0: + do_profile_flag = False; + do_profile_times = False; + break; + case 1: + do_profile_flag = True; + do_profile_times = False; + break; + case 2: + do_profile_flag = True; + do_profile_times = True; + break; + } + DEBUG(1,("Profile level set to %d from pid %d\n", level, (int)src)); +} + /******************************************************************* open the profiling shared memory area ******************************************************************/ @@ -103,7 +129,7 @@ BOOL profile_setup(BOOL rdonly) DEBUG(3,("Initialised profile area\n")); } - do_profile_flag = True; /* temp for now */ + message_register(MSG_PROFILE, profile_message); return True; } -- cgit From 8719c27726d3412edd0781beb956f48f76a62fb6 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Wed, 11 Oct 2000 05:31:39 +0000 Subject: changes to sync with 2.2. tree .cvsignore remove config.h - not in this directory include/profile.h profile changes lib/messages.c added message to return debug level libsmb/clierror.c cast to get rid of compiler warning libsmb/smbencrypt.c cast to get rid of compiler warning profile/profile.c add flush profile stats changes for profile struct rpc_parse/parse_samr.c fix for compiler warning rpc_server/srv_samr.c cast to get rid of compiler warning smbd/ipc.c profile stats message.c profile stats smbd/negprot.c profile stats smbd/nttrans.c profile stats smbd/trans2.c profile stats utils/smbcontrol.c new flush stats command (This used to be commit bbb24daa25dca4e4b6b1f8942cd84ee3aa1bed8e) --- source3/profile/profile.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 87f5e2c9b2..c639f17ce5 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -31,13 +31,16 @@ extern int DEBUGLEVEL; static int shm_id; static BOOL read_only; -struct profile_struct *profile_p; +struct profile_header *profile_h; +struct profile_stats *profile_p; BOOL do_profile_flag = False; BOOL do_profile_times = False; struct timeval profile_starttime; struct timeval profile_endtime; +struct timeval profile_starttime_nested; +struct timeval profile_endtime_nested; /**************************************************************************** receive a set profile level message @@ -48,18 +51,21 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) memcpy(&level, buf, sizeof(int)); switch (level) { - case 0: + case 0: /* turn off profiling */ do_profile_flag = False; do_profile_times = False; break; - case 1: + case 1: /* turn on counter profiling only */ do_profile_flag = True; do_profile_times = False; break; - case 2: + case 2: /* turn on complete profiling */ do_profile_flag = True; do_profile_times = True; break; + case 3: /* reset profile values */ + memset((char *)profile_p, 0, sizeof(*profile_p)); + break; } DEBUG(1,("Profile level set to %d from pid %d\n", level, (int)src)); } @@ -81,7 +87,7 @@ BOOL profile_setup(BOOL rdonly) if we are running from inetd. Bad luck. */ if (shm_id == -1) { if (read_only) return False; - shm_id = shmget(PROF_SHMEM_KEY, sizeof(*profile_p), + shm_id = shmget(PROF_SHMEM_KEY, sizeof(*profile_h), IPC_CREAT | IPC_EXCL | IPC_PERMS); } @@ -92,7 +98,7 @@ BOOL profile_setup(BOOL rdonly) } - profile_p = (struct profile_struct *)shmat(shm_id, 0, + profile_h = (struct profile_header *)shmat(shm_id, 0, read_only?SHM_RDONLY:0); if ((long)profile_p == -1) { DEBUG(0,("Can't attach to IPC area. Error was %s\n", @@ -112,9 +118,9 @@ BOOL profile_setup(BOOL rdonly) return False; } - if (shm_ds.shm_segsz != sizeof(*profile_p)) { + if (shm_ds.shm_segsz != sizeof(*profile_h)) { DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", - (int)shm_ds.shm_segsz, sizeof(*profile_p))); + (int)shm_ds.shm_segsz, sizeof(*profile_h))); if (shmctl(shm_id, IPC_RMID, &shm_ds) == 0) { goto again; } else { @@ -123,12 +129,13 @@ BOOL profile_setup(BOOL rdonly) } if (!read_only && (shm_ds.shm_nattch == 1)) { - memset((char *)profile_p, 0, sizeof(*profile_p)); - profile_p->prof_shm_magic = PROF_SHM_MAGIC; - profile_p->prof_shm_version = PROF_SHM_VERSION; + memset((char *)profile_h, 0, sizeof(*profile_h)); + profile_h->prof_shm_magic = PROF_SHM_MAGIC; + profile_h->prof_shm_version = PROF_SHM_VERSION; DEBUG(3,("Initialised profile area\n")); } + profile_p = &profile_h->stats; message_register(MSG_PROFILE, profile_message); return True; } -- cgit From c97023b14c942f7261808159a0d192926239b704 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Nov 2000 22:07:57 +0000 Subject: Merge in Herb's changes from 2.2. Jeremy. (This used to be commit 24d76c5fbda29d89c96d7c22193ec2eb93ad3887) --- source3/profile/profile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index c639f17ce5..f1d2310ce1 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -54,20 +54,23 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) case 0: /* turn off profiling */ do_profile_flag = False; do_profile_times = False; + DEBUG(1,("INFO: Profiling turned OFF from pid %d\n", (int)src)); break; case 1: /* turn on counter profiling only */ do_profile_flag = True; do_profile_times = False; + DEBUG(1,("INFO: Profiling counts turned ON from pid %d\n", (int)src)); break; case 2: /* turn on complete profiling */ do_profile_flag = True; do_profile_times = True; + DEBUG(1,("INFO: Full profiling turned ON from pid %d\n", (int)src)); break; case 3: /* reset profile values */ memset((char *)profile_p, 0, sizeof(*profile_p)); + DEBUG(1,("INFO: Profiling values cleared from pid %d\n", (int)src)); break; } - DEBUG(1,("Profile level set to %d from pid %d\n", level, (int)src)); } /******************************************************************* -- cgit From 20838bb9ed25d7a325831041f371c11731ff6283 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Nov 2000 00:33:33 +0000 Subject: Merge of Herb's profiling code. Jeremy. (This used to be commit 3be056c71aa8e0a4ba70d397107199004bdb7d3f) --- source3/profile/profile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index f1d2310ce1..80584adfa2 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -73,6 +73,22 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) } } +/**************************************************************************** +receive a request profile level message +****************************************************************************/ +void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) +{ + int level; + +#ifdef WITH_PROFILE + level = 1 + (do_profile_flag?2:0) + (do_profile_times?4:0); +#else + level = 0; +#endif + DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %d\n",src)); + message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int)); +} + /******************************************************************* open the profiling shared memory area ******************************************************************/ @@ -140,6 +156,7 @@ BOOL profile_setup(BOOL rdonly) profile_p = &profile_h->stats; message_register(MSG_PROFILE, profile_message); + message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } -- cgit From cdac09614ef426092ed1b1de480fe90c3c4cdd83 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Nov 2000 21:38:24 +0000 Subject: Fix for a problem with the new messaging system. If a sender is using the messaging system as a notification mechanism, and the speed of notification greatly exceeds the speed of message recovery, then you get a massively (>75Mb) growing tdb. If the message is a simple notification, then the message is static, and you only need one of them in transit to a target process at any one time. This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives. If set to False, then before sending a message the sender checks the existing message queue for a target pid for a duplicate of this message, and doesn't add to it if one already exists. Also added code into msgtest.c to test this. Jeremy. (This used to be commit 3aa7995660395ecb85c8e35b638fa9fbbb952558) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 80584adfa2..dce1d78a9b 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -86,7 +86,7 @@ void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) level = 0; #endif DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %d\n",src)); - message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int)); + message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int), True); } /******************************************************************* -- cgit From 5345d9eb57d7d8e1c8b3a4ae17e20ef87c24345d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 27 Apr 2001 22:02:23 +0000 Subject: More %d (uid_t) stuff... Jeremy. (This used to be commit 73b425121a8c99af3ed7adbdcff3f6f0cec92ac7) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index dce1d78a9b..a00769cb46 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -85,7 +85,7 @@ void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) #else level = 0; #endif - DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %d\n",src)); + DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %u\n",(unsigned int)src)); message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int), True); } -- cgit From 548d16869acffdec899121906a7bcd88f58d9b6f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 May 2001 19:47:30 +0000 Subject: Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h and using autoconf tests. Added "restrict acl with mask" parameter. Jeremy. (This used to be commit 7792e32ba7fd734cc68b354f31c382ac11521fe8) --- source3/profile/profile.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index a00769cb46..20ad8531d8 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -22,8 +22,6 @@ #include "includes.h" -#include - extern int DEBUGLEVEL; #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) -- cgit From e6866f1851c0fe6c1f9644339ef2ede362e8c851 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Wed, 18 Jul 2001 01:13:16 +0000 Subject: don't test for root ownership of profile shared memory segment (This used to be commit d7023b881a3e36199f20dba36bd930454d5131cb) --- source3/profile/profile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 20ad8531d8..430732c6f8 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -130,10 +130,12 @@ BOOL profile_setup(BOOL rdonly) return False; } +#if 0 if (shm_ds.shm_perm.cuid != 0 || shm_ds.shm_perm.cgid != 0) { DEBUG(0,("ERROR: root did not create the shmem\n")); return False; } +#endif if (shm_ds.shm_segsz != sizeof(*profile_h)) { DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", -- cgit From 9a846daf441c3d82e4fc750382fd12fcb8fb9a6d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 15 Sep 2001 02:10:22 +0000 Subject: Restore the profiling data shmem parinoia. This whole area needs to be fixed - an mmaped file or the like would be a good idea. (This used to be commit bc1385fc5e55eeed626615fad92877296064a27e) --- source3/profile/profile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 430732c6f8..5ddc72c490 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -130,12 +130,10 @@ BOOL profile_setup(BOOL rdonly) return False; } -#if 0 - if (shm_ds.shm_perm.cuid != 0 || shm_ds.shm_perm.cgid != 0) { - DEBUG(0,("ERROR: root did not create the shmem\n")); + if (shm_ds.shm_perm.cuid != sec_initial_uid() || shm_ds.shm_perm.cgid != sec_initial_gid()) { + DEBUG(0,("ERROR: we did not create the shmem (owned by another user)\n")); return False; } -#endif if (shm_ds.shm_segsz != sizeof(*profile_h)) { DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", -- cgit From dc1fc3ee8ec2199bc73bb5d7ec711c6800f61d65 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 2 Oct 2001 04:29:50 +0000 Subject: Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e) --- source3/profile/profile.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 5ddc72c490..555fe7de5a 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -22,8 +22,6 @@ #include "includes.h" -extern int DEBUGLEVEL; - #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) static int shm_id; @@ -157,4 +155,3 @@ BOOL profile_setup(BOOL rdonly) message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } - -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/profile/profile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 555fe7de5a..595593c6f0 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. store smbd profiling information in shared memory Copyright (C) Andrew Tridgell 1999 -- cgit From a834a73e341059be154426390304a42e4a011f72 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Sep 2002 15:19:00 +0000 Subject: sync'ing up for 3.0alpha20 release (This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139) --- source3/profile/profile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 595593c6f0..689f67da99 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -21,10 +21,14 @@ #include "includes.h" +#ifdef WITH_PROFILE #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) +#endif /* WITH_PROFILE */ +#ifdef WITH_PROFILE static int shm_id; static BOOL read_only; +#endif struct profile_header *profile_h; struct profile_stats *profile_p; @@ -45,6 +49,7 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) int level; memcpy(&level, buf, sizeof(int)); +#ifdef WITH_PROFILE switch (level) { case 0: /* turn off profiling */ do_profile_flag = False; @@ -66,6 +71,9 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) DEBUG(1,("INFO: Profiling values cleared from pid %d\n", (int)src)); break; } +#else /* WITH_PROFILE */ + DEBUG(1,("INFO: Profiling support unavailable in this build.\n")); +#endif /* WITH_PROFILE */ } /**************************************************************************** @@ -87,6 +95,7 @@ void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) /******************************************************************* open the profiling shared memory area ******************************************************************/ +#ifdef WITH_PROFILE BOOL profile_setup(BOOL rdonly) { struct shmid_ds shm_ds; @@ -154,3 +163,4 @@ BOOL profile_setup(BOOL rdonly) message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } +#endif /* WITH_PROFILE */ -- cgit From 92e97934804758e2fea2e3bd8f9e6630007c8169 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 19 Dec 2004 00:31:31 +0000 Subject: r4268: Merge fix for bugzilla #2150. (This used to be commit f00ae4ab0c36a623257861fb65373b39cf075921) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 689f67da99..e6d34e68cd 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -22,7 +22,7 @@ #include "includes.h" #ifdef WITH_PROFILE -#define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) +#define IPC_PERMS ((S_IRUSR | S_IWUSR) | S_IRGRP | S_IROTH) #endif /* WITH_PROFILE */ #ifdef WITH_PROFILE -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/profile/profile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index e6d34e68cd..0cf8c8e15b 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -79,7 +79,8 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) /**************************************************************************** receive a request profile level message ****************************************************************************/ -void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) +void reqprofile_message(int msg_type, struct process_id src, + void *buf, size_t len) { int level; @@ -88,7 +89,8 @@ void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) #else level = 0; #endif - DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %u\n",(unsigned int)src)); + DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %u\n", + (unsigned int)procid_to_pid(&src))); message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int), True); } -- cgit From 1638adaee28e5ef75bc28344fbc94c685d4221b3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 25 Dec 2005 09:49:10 +0000 Subject: r12474: Fix a warning (This used to be commit e361f4a5c55ed88b706cfc348907a899d8970445) --- source3/profile/profile.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 0cf8c8e15b..c3399f874d 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -44,7 +44,7 @@ struct timeval profile_endtime_nested; /**************************************************************************** receive a set profile level message ****************************************************************************/ -void profile_message(int msg_type, pid_t src, void *buf, size_t len) +void profile_message(int msg_type, struct process_id src, void *buf, size_t len) { int level; @@ -54,21 +54,25 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) case 0: /* turn off profiling */ do_profile_flag = False; do_profile_times = False; - DEBUG(1,("INFO: Profiling turned OFF from pid %d\n", (int)src)); + DEBUG(1,("INFO: Profiling turned OFF from pid %d\n", + (int)procid_to_pid(src))); break; case 1: /* turn on counter profiling only */ do_profile_flag = True; do_profile_times = False; - DEBUG(1,("INFO: Profiling counts turned ON from pid %d\n", (int)src)); + DEBUG(1,("INFO: Profiling counts turned ON from pid %d\n", + (int)procid_to_pid(src))); break; case 2: /* turn on complete profiling */ do_profile_flag = True; do_profile_times = True; - DEBUG(1,("INFO: Full profiling turned ON from pid %d\n", (int)src)); + DEBUG(1,("INFO: Full profiling turned ON from pid %d\n", + (int)procid_to_pid(src))); break; case 3: /* reset profile values */ memset((char *)profile_p, 0, sizeof(*profile_p)); - DEBUG(1,("INFO: Profiling values cleared from pid %d\n", (int)src)); + DEBUG(1,("INFO: Profiling values cleared from pid %d\n", + (int)procid_to_pid(src))); break; } #else /* WITH_PROFILE */ -- cgit From 964feef9452db12d5969cd7ee20edde6cdce2f6d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 25 Dec 2005 10:06:05 +0000 Subject: r12475: Actually configure with profile support this time ... (This used to be commit 9cd4b894ea1e5c0ccfd50f8d2f84180c702d97ee) --- source3/profile/profile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index c3399f874d..838383b1af 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -55,24 +55,24 @@ void profile_message(int msg_type, struct process_id src, void *buf, size_t len) do_profile_flag = False; do_profile_times = False; DEBUG(1,("INFO: Profiling turned OFF from pid %d\n", - (int)procid_to_pid(src))); + (int)procid_to_pid(&src))); break; case 1: /* turn on counter profiling only */ do_profile_flag = True; do_profile_times = False; DEBUG(1,("INFO: Profiling counts turned ON from pid %d\n", - (int)procid_to_pid(src))); + (int)procid_to_pid(&src))); break; case 2: /* turn on complete profiling */ do_profile_flag = True; do_profile_times = True; DEBUG(1,("INFO: Full profiling turned ON from pid %d\n", - (int)procid_to_pid(src))); + (int)procid_to_pid(&src))); break; case 3: /* reset profile values */ memset((char *)profile_p, 0, sizeof(*profile_p)); DEBUG(1,("INFO: Profiling values cleared from pid %d\n", - (int)procid_to_pid(src))); + (int)procid_to_pid(&src))); break; } #else /* WITH_PROFILE */ -- cgit From 4d55a81958a67d5da3227d7af79a5c630f678424 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 5 May 2006 07:15:45 +0000 Subject: r15450: Change profiling data macros to use stack variables rather than globals. This catches mismatched start/end calls and removes the need for special nested profiling calls. (This used to be commit ee750498812190edd3ec52ca3c750258f3b8a97a) --- source3/profile/profile.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 838383b1af..db8a643042 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -36,11 +36,6 @@ struct profile_stats *profile_p; BOOL do_profile_flag = False; BOOL do_profile_times = False; -struct timeval profile_starttime; -struct timeval profile_endtime; -struct timeval profile_starttime_nested; -struct timeval profile_endtime_nested; - /**************************************************************************** receive a set profile level message ****************************************************************************/ -- cgit From 826614ed16e0fb23d30305990dbfa357b4366de2 Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 8 May 2006 03:20:49 +0000 Subject: r15508: Use clock_gettime for profiling timstamps if it is available. Use the fastest clock available on uniprocessors. (This used to be commit d44862928206b524f826bd7c2997ab5353c0b6a0) --- source3/profile/profile.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index db8a643042..bacf00eb01 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -28,6 +28,9 @@ #ifdef WITH_PROFILE static int shm_id; static BOOL read_only; +#if defined(HAVE_CLOCK_GETTIME) +clockid_t __profile_clock; +#endif #endif struct profile_header *profile_h; @@ -103,6 +106,24 @@ BOOL profile_setup(BOOL rdonly) read_only = rdonly; +#if defined(HAVE_CLOCK_GETTIME) + if (this_is_smp()) { + /* This is faster that gettimeofday, but not fast enough to + * leave it enabled in production. + */ + __profile_clock = CLOCK_MONOTONIC; + } else { + /* CLOCK_PROCESS_CPUTIME_ID is sufficiently fast that the + * always profiling times is plausible. Unfortunately it is + * only accurate if we can guarantee we will not be scheduled + * onto a different CPU between samples. Until there is some + * way to set processor affinity, we can only use this on + * uniprocessors. + */ + __profile_clock = CLOCK_PROCESS_CPUTIME_ID; + } +#endif + again: /* try to use an existing key */ shm_id = shmget(PROF_SHMEM_KEY, 0, 0); -- cgit From 8de0dcb3d917956d3f8a32664d0fec57e5559753 Mon Sep 17 00:00:00 2001 From: James Peach Date: Wed, 10 May 2006 22:33:10 +0000 Subject: r15529: Initialise our saved uid and gid so that we can tell when we created the profiling shmem segment and don't bogusly refuse to look at it. (This used to be commit eb31ef3a0e5e7c3b4029a3c2e124d2df646f10a2) --- source3/profile/profile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index bacf00eb01..ba9596301c 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -158,8 +158,12 @@ BOOL profile_setup(BOOL rdonly) return False; } - if (shm_ds.shm_perm.cuid != sec_initial_uid() || shm_ds.shm_perm.cgid != sec_initial_gid()) { - DEBUG(0,("ERROR: we did not create the shmem (owned by another user)\n")); + if (shm_ds.shm_perm.cuid != sec_initial_uid() || + shm_ds.shm_perm.cgid != sec_initial_gid()) { + DEBUG(0,("ERROR: we did not create the shmem " + "(owned by another user, uid %u, gid %u)\n", + shm_ds.shm_perm.cuid, + shm_ds.shm_perm.cgid)); return False; } -- cgit From 8882d08b6ba90c45f8107eef3d28614eb643dfb9 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 9 Jun 2006 01:02:54 +0000 Subject: r16111: Patch from Björn JACKE . MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a problem where the clock definition for clock_gettime() is present at compile time, but is not available on the running system. In this case, we fall back to less-preferred clocks until we find one that we can use. (This used to be commit fc6ed6a1aa2225ccde04c4ecaf0777dc0de4f1cb) --- source3/profile/profile.c | 92 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 16 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index ba9596301c..b0db629682 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -30,6 +30,7 @@ static int shm_id; static BOOL read_only; #if defined(HAVE_CLOCK_GETTIME) clockid_t __profile_clock; +BOOL have_profiling_clock = False; #endif #endif @@ -62,6 +63,19 @@ void profile_message(int msg_type, struct process_id src, void *buf, size_t len) (int)procid_to_pid(&src))); break; case 2: /* turn on complete profiling */ + +#if defined(HAVE_CLOCK_GETTIME) + if (!have_profiling_clock) { + do_profile_flag = True; + do_profile_times = False; + DEBUG(1,("INFO: Profiling counts turned ON from " + "pid %d\n", (int)procid_to_pid(&src))); + DEBUGADD(1,("INFO: Profiling times disabled " + "due to lack of a suitable clock\n")); + break; + } +#endif + do_profile_flag = True; do_profile_times = True; DEBUG(1,("INFO: Full profiling turned ON from pid %d\n", @@ -100,28 +114,74 @@ void reqprofile_message(int msg_type, struct process_id src, open the profiling shared memory area ******************************************************************/ #ifdef WITH_PROFILE + +#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. + */ +static void init_clock_gettime(void) +{ + struct timespec ts; + + have_profiling_clock = False; + +#ifdef HAVE_CLOCK_PROCESS_CPUTIME_ID + /* CLOCK_PROCESS_CPUTIME_ID is sufficiently fast that the + * always profiling times is plausible. Unfortunately on Linux + * it is only accurate if we can guarantee we will not be scheduled + * scheduled onto a different CPU between samples. Until there is + * some way to set processor affinity, we can only use this on + * uniprocessors. + */ + if (!this_is_smp()) { + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { + DEBUG(10, ("Using CLOCK_PROCESS_CPUTIME_ID " + "for profile_clock\n")); + __profile_clock = CLOCK_PROCESS_CPUTIME_ID; + have_profiling_clock = True; + } + } +#endif + +#ifdef HAVE_CLOCK_MONOTONIC + if (!have_profiling_clock && + clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { + DEBUG(10, ("Using CLOCK_MONOTONIC for profile_clock\n")); + __profile_clock = CLOCK_MONOTONIC; + have_profiling_clock = True; + return; + } +#endif + +#ifdef HAVE_CLOCK_REALTIME + /* POSIX says that CLOCK_REALTIME should be defined everywhere + * where we have clock_gettime... + */ + if (!have_profiling_clock && + clock_gettime(CLOCK_REALTIME, &ts) == 0) { + __profile_clock = CLOCK_REALTIME; + have_profiling_clock = True; + } + + SMB_WARN(__profile_clock == CLOCK_REALTIME, + ("Using (slow) CLOCK_REALTIME for profile_clock")); +#endif + + SMB_WARN(have_profiling_clock == False, + ("could not find a working clock for profiling")); + return have_profiling_clock; +} +#endif + BOOL profile_setup(BOOL rdonly) { struct shmid_ds shm_ds; read_only = rdonly; -#if defined(HAVE_CLOCK_GETTIME) - if (this_is_smp()) { - /* This is faster that gettimeofday, but not fast enough to - * leave it enabled in production. - */ - __profile_clock = CLOCK_MONOTONIC; - } else { - /* CLOCK_PROCESS_CPUTIME_ID is sufficiently fast that the - * always profiling times is plausible. Unfortunately it is - * only accurate if we can guarantee we will not be scheduled - * onto a different CPU between samples. Until there is some - * way to set processor affinity, we can only use this on - * uniprocessors. - */ - __profile_clock = CLOCK_PROCESS_CPUTIME_ID; - } +#ifdef HAVE_CLOCK_GETTIME + init_clock_gettime(); #endif again: -- cgit From c12c557a13ad5e26e1c3c8a7e46f3e096b7f6479 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 9 Jun 2006 10:50:45 +0000 Subject: r16116: Hoist the slow CLOCK_REALTIME message inside the branch so we never confuse an uninitialised __profile_clock with CLOCK_REALTIME. Flip the condition argument to SMB_WARN around so that it's correct (though completely non-intuitive). (This used to be commit 60b5f9618b77afb397f96c1ff406c8cd3a4648f3) --- source3/profile/profile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index b0db629682..c3512ec01d 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -150,7 +150,6 @@ static void init_clock_gettime(void) DEBUG(10, ("Using CLOCK_MONOTONIC for profile_clock\n")); __profile_clock = CLOCK_MONOTONIC; have_profiling_clock = True; - return; } #endif @@ -162,15 +161,16 @@ static void init_clock_gettime(void) clock_gettime(CLOCK_REALTIME, &ts) == 0) { __profile_clock = CLOCK_REALTIME; have_profiling_clock = True; + + SMB_WARN(__profile_clock != CLOCK_REALTIME, + ("forced to use a slow profiling clock")); } - SMB_WARN(__profile_clock == CLOCK_REALTIME, - ("Using (slow) CLOCK_REALTIME for profile_clock")); #endif - SMB_WARN(have_profiling_clock == False, + SMB_WARN(have_profiling_clock == True, ("could not find a working clock for profiling")); - return have_profiling_clock; + return; } #endif -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/profile/profile.c | 181 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 180 insertions(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index c3512ec01d..926cc508dd 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -2,7 +2,8 @@ Unix SMB/CIFS implementation. store smbd profiling information in shared memory Copyright (C) Andrew Tridgell 1999 - + Copyright (C) James Peach 2006 + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -249,4 +250,182 @@ BOOL profile_setup(BOOL rdonly) message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } + + const char * profile_value_name(enum profile_stats_values val) +{ + static const char * valnames[PR_VALUE_MAX + 1] = + { + "smbd_idle", /* PR_VALUE_SMBD_IDLE */ + "syscall_opendir", /* PR_VALUE_SYSCALL_OPENDIR */ + "syscall_readdir", /* PR_VALUE_SYSCALL_READDIR */ + "syscall_seekdir", /* PR_VALUE_SYSCALL_SEEKDIR */ + "syscall_telldir", /* PR_VALUE_SYSCALL_TELLDIR */ + "syscall_rewinddir", /* PR_VALUE_SYSCALL_REWINDDIR */ + "syscall_mkdir", /* PR_VALUE_SYSCALL_MKDIR */ + "syscall_rmdir", /* PR_VALUE_SYSCALL_RMDIR */ + "syscall_closedir", /* PR_VALUE_SYSCALL_CLOSEDIR */ + "syscall_open", /* PR_VALUE_SYSCALL_OPEN */ + "syscall_close", /* PR_VALUE_SYSCALL_CLOSE */ + "syscall_read", /* PR_VALUE_SYSCALL_READ */ + "syscall_pread", /* PR_VALUE_SYSCALL_PREAD */ + "syscall_write", /* PR_VALUE_SYSCALL_WRITE */ + "syscall_pwrite", /* PR_VALUE_SYSCALL_PWRITE */ + "syscall_lseek", /* PR_VALUE_SYSCALL_LSEEK */ + "syscall_sendfile", /* PR_VALUE_SYSCALL_SENDFILE */ + "syscall_rename", /* PR_VALUE_SYSCALL_RENAME */ + "syscall_fsync", /* PR_VALUE_SYSCALL_FSYNC */ + "syscall_stat", /* PR_VALUE_SYSCALL_STAT */ + "syscall_fstat", /* PR_VALUE_SYSCALL_FSTAT */ + "syscall_lstat", /* PR_VALUE_SYSCALL_LSTAT */ + "syscall_unlink", /* PR_VALUE_SYSCALL_UNLINK */ + "syscall_chmod", /* PR_VALUE_SYSCALL_CHMOD */ + "syscall_fchmod", /* PR_VALUE_SYSCALL_FCHMOD */ + "syscall_chown", /* PR_VALUE_SYSCALL_CHOWN */ + "syscall_fchown", /* PR_VALUE_SYSCALL_FCHOWN */ + "syscall_chdir", /* PR_VALUE_SYSCALL_CHDIR */ + "syscall_getwd", /* PR_VALUE_SYSCALL_GETWD */ + "syscall_utime", /* PR_VALUE_SYSCALL_UTIME */ + "syscall_ftruncate", /* PR_VALUE_SYSCALL_FTRUNCATE */ + "syscall_fcntl_lock", /* PR_VALUE_SYSCALL_FCNTL_LOCK */ + "syscall_fcntl_getlock", /* PR_VALUE_SYSCALL_FCNTL_GETLOCK */ + "syscall_readlink", /* PR_VALUE_SYSCALL_READLINK */ + "syscall_symlink", /* PR_VALUE_SYSCALL_SYMLINK */ + "syscall_link", /* PR_VALUE_SYSCALL_LINK */ + "syscall_mknod", /* PR_VALUE_SYSCALL_MKNOD */ + "syscall_realpath", /* PR_VALUE_SYSCALL_REALPATH */ + "syscall_get_quota", /* PR_VALUE_SYSCALL_GET_QUOTA */ + "syscall_set_quota", /* PR_VALUE_SYSCALL_SET_QUOTA */ + "SMBmkdir", /* PR_VALUE_SMBMKDIR */ + "SMBrmdir", /* PR_VALUE_SMBRMDIR */ + "SMBopen", /* PR_VALUE_SMBOPEN */ + "SMBcreate", /* PR_VALUE_SMBCREATE */ + "SMBclose", /* PR_VALUE_SMBCLOSE */ + "SMBflush", /* PR_VALUE_SMBFLUSH */ + "SMBunlink", /* PR_VALUE_SMBUNLINK */ + "SMBmv", /* PR_VALUE_SMBMV */ + "SMBgetatr", /* PR_VALUE_SMBGETATR */ + "SMBsetatr", /* PR_VALUE_SMBSETATR */ + "SMBread", /* PR_VALUE_SMBREAD */ + "SMBwrite", /* PR_VALUE_SMBWRITE */ + "SMBlock", /* PR_VALUE_SMBLOCK */ + "SMBunlock", /* PR_VALUE_SMBUNLOCK */ + "SMBctemp", /* PR_VALUE_SMBCTEMP */ + "SMBmknew", /* PR_VALUE_SMBMKNEW */ + "SMBchkpth", /* PR_VALUE_SMBCHKPTH */ + "SMBexit", /* PR_VALUE_SMBEXIT */ + "SMBlseek", /* PR_VALUE_SMBLSEEK */ + "SMBlockread", /* PR_VALUE_SMBLOCKREAD */ + "SMBwriteunlock", /* PR_VALUE_SMBWRITEUNLOCK */ + "SMBreadbraw", /* PR_VALUE_SMBREADBRAW */ + "SMBreadBmpx", /* PR_VALUE_SMBREADBMPX */ + "SMBreadBs", /* PR_VALUE_SMBREADBS */ + "SMBwritebraw", /* PR_VALUE_SMBWRITEBRAW */ + "SMBwriteBmpx", /* PR_VALUE_SMBWRITEBMPX */ + "SMBwriteBs", /* PR_VALUE_SMBWRITEBS */ + "SMBwritec", /* PR_VALUE_SMBWRITEC */ + "SMBsetattrE", /* PR_VALUE_SMBSETATTRE */ + "SMBgetattrE", /* PR_VALUE_SMBGETATTRE */ + "SMBlockingX", /* PR_VALUE_SMBLOCKINGX */ + "SMBtrans", /* PR_VALUE_SMBTRANS */ + "SMBtranss", /* PR_VALUE_SMBTRANSS */ + "SMBioctl", /* PR_VALUE_SMBIOCTL */ + "SMBioctls", /* PR_VALUE_SMBIOCTLS */ + "SMBcopy", /* PR_VALUE_SMBCOPY */ + "SMBmove", /* PR_VALUE_SMBMOVE */ + "SMBecho", /* PR_VALUE_SMBECHO */ + "SMBwriteclose", /* PR_VALUE_SMBWRITECLOSE */ + "SMBopenX", /* PR_VALUE_SMBOPENX */ + "SMBreadX", /* PR_VALUE_SMBREADX */ + "SMBwriteX", /* PR_VALUE_SMBWRITEX */ + "SMBtrans2", /* PR_VALUE_SMBTRANS2 */ + "SMBtranss2", /* PR_VALUE_SMBTRANSS2 */ + "SMBfindclose", /* PR_VALUE_SMBFINDCLOSE */ + "SMBfindnclose", /* PR_VALUE_SMBFINDNCLOSE */ + "SMBtcon", /* PR_VALUE_SMBTCON */ + "SMBtdis", /* PR_VALUE_SMBTDIS */ + "SMBnegprot", /* PR_VALUE_SMBNEGPROT */ + "SMBsesssetupX", /* PR_VALUE_SMBSESSSETUPX */ + "SMBulogoffX", /* PR_VALUE_SMBULOGOFFX */ + "SMBtconX", /* PR_VALUE_SMBTCONX */ + "SMBdskattr", /* PR_VALUE_SMBDSKATTR */ + "SMBsearch", /* PR_VALUE_SMBSEARCH */ + "SMBffirst", /* PR_VALUE_SMBFFIRST */ + "SMBfunique", /* PR_VALUE_SMBFUNIQUE */ + "SMBfclose", /* PR_VALUE_SMBFCLOSE */ + "SMBnttrans", /* PR_VALUE_SMBNTTRANS */ + "SMBnttranss", /* PR_VALUE_SMBNTTRANSS */ + "SMBntcreateX", /* PR_VALUE_SMBNTCREATEX */ + "SMBntcancel", /* PR_VALUE_SMBNTCANCEL */ + "SMBntrename", /* PR_VALUE_SMBNTRENAME */ + "SMBsplopen", /* PR_VALUE_SMBSPLOPEN */ + "SMBsplwr", /* PR_VALUE_SMBSPLWR */ + "SMBsplclose", /* PR_VALUE_SMBSPLCLOSE */ + "SMBsplretq", /* PR_VALUE_SMBSPLRETQ */ + "SMBsends", /* PR_VALUE_SMBSENDS */ + "SMBsendb", /* PR_VALUE_SMBSENDB */ + "SMBfwdname", /* PR_VALUE_SMBFWDNAME */ + "SMBcancelf", /* PR_VALUE_SMBCANCELF */ + "SMBgetmac", /* PR_VALUE_SMBGETMAC */ + "SMBsendstrt", /* PR_VALUE_SMBSENDSTRT */ + "SMBsendend", /* PR_VALUE_SMBSENDEND */ + "SMBsendtxt", /* PR_VALUE_SMBSENDTXT */ + "SMBinvalid", /* PR_VALUE_SMBINVALID */ + "pathworks_setdir", /* PR_VALUE_PATHWORKS_SETDIR */ + "Trans2_open", /* PR_VALUE_TRANS2_OPEN */ + "Trans2_findfirst", /* PR_VALUE_TRANS2_FINDFIRST */ + "Trans2_findnext", /* PR_VALUE_TRANS2_FINDNEXT */ + "Trans2_qfsinfo", /* PR_VALUE_TRANS2_QFSINFO */ + "Trans2_setfsinfo", /* PR_VALUE_TRANS2_SETFSINFO */ + "Trans2_qpathinfo", /* PR_VALUE_TRANS2_QPATHINFO */ + "Trans2_setpathinfo", /* PR_VALUE_TRANS2_SETPATHINFO */ + "Trans2_qfileinfo", /* PR_VALUE_TRANS2_QFILEINFO */ + "Trans2_setfileinfo", /* PR_VALUE_TRANS2_SETFILEINFO */ + "Trans2_fsctl", /* PR_VALUE_TRANS2_FSCTL */ + "Trans2_ioctl", /* PR_VALUE_TRANS2_IOCTL */ + "Trans2_findnotifyfirst", /* PR_VALUE_TRANS2_FINDNOTIFYFIRST */ + "Trans2_findnotifynext", /* PR_VALUE_TRANS2_FINDNOTIFYNEXT */ + "Trans2_mkdir", /* PR_VALUE_TRANS2_MKDIR */ + "Trans2_session_setup", /* PR_VALUE_TRANS2_SESSION_SETUP */ + "Trans2_get_dfs_referral", /* PR_VALUE_TRANS2_GET_DFS_REFERRAL */ + "Trans2_report_dfs_inconsistancy", /* PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY */ + "NT_transact_create", /* PR_VALUE_NT_TRANSACT_CREATE */ + "NT_transact_ioctl", /* PR_VALUE_NT_TRANSACT_IOCTL */ + "NT_transact_set_security_desc", /* PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC */ + "NT_transact_notify_change",/* PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE */ + "NT_transact_rename", /* PR_VALUE_NT_TRANSACT_RENAME */ + "NT_transact_query_security_desc", /* PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC */ + "NT_transact_get_user_quota",/* PR_VALUE_NT_TRANSACT_GET_USER_QUOTA */ + "NT_transact_set_user_quota",/* PR_VALUE_NT_TRANSACT_SET_USER_QUOTA */ + "get_nt_acl", /* PR_VALUE_GET_NT_ACL */ + "fget_nt_acl", /* PR_VALUE_FGET_NT_ACL */ + "set_nt_acl", /* PR_VALUE_SET_NT_ACL */ + "fset_nt_acl", /* PR_VALUE_FSET_NT_ACL */ + "chmod_acl", /* PR_VALUE_CHMOD_ACL */ + "fchmod_acl", /* PR_VALUE_FCHMOD_ACL */ + "name_release", /* PR_VALUE_NAME_RELEASE */ + "name_refresh", /* PR_VALUE_NAME_REFRESH */ + "name_registration", /* PR_VALUE_NAME_REGISTRATION */ + "node_status", /* PR_VALUE_NODE_STATUS */ + "name_query", /* PR_VALUE_NAME_QUERY */ + "host_announce", /* PR_VALUE_HOST_ANNOUNCE */ + "workgroup_announce", /* PR_VALUE_WORKGROUP_ANNOUNCE */ + "local_master_announce", /* PR_VALUE_LOCAL_MASTER_ANNOUNCE */ + "master_browser_announce", /* PR_VALUE_MASTER_BROWSER_ANNOUNCE */ + "lm_host_announce", /* PR_VALUE_LM_HOST_ANNOUNCE */ + "get_backup_list", /* PR_VALUE_GET_BACKUP_LIST */ + "reset_browser", /* PR_VALUE_RESET_BROWSER */ + "announce_request", /* PR_VALUE_ANNOUNCE_REQUEST */ + "lm_announce_request", /* PR_VALUE_LM_ANNOUNCE_REQUEST */ + "domain_logon", /* PR_VALUE_DOMAIN_LOGON */ + "sync_browse_lists", /* PR_VALUE_SYNC_BROWSE_LISTS */ + "run_elections", /* PR_VALUE_RUN_ELECTIONS */ + "election", /* PR_VALUE_ELECTION */ + "" /* PR_VALUE_MAX */ + }; + + SMB_ASSERT(val >= 0); + SMB_ASSERT(val < PR_VALUE_MAX); + return valnames[val]; +} + #endif /* WITH_PROFILE */ -- cgit From 4fe70bcee2ec8515f123d8c826631b54bbf793e7 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 9 Nov 2006 20:29:31 +0000 Subject: r19647: Add some GPFS support in a vfs mod. Also adds the kernel flock op to the vfs layer, since gpfs supports it. Thanks to Volker, Christian, Mathias, Chetan, and Peter. (This used to be commit 0620658890fa9c68a9848538728023192319c81a) --- source3/profile/profile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 926cc508dd..187512333c 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -287,6 +287,7 @@ BOOL profile_setup(BOOL rdonly) "syscall_utime", /* PR_VALUE_SYSCALL_UTIME */ "syscall_ftruncate", /* PR_VALUE_SYSCALL_FTRUNCATE */ "syscall_fcntl_lock", /* PR_VALUE_SYSCALL_FCNTL_LOCK */ + "syscall_kernel_flock", /* PR_VALUE_SYSCALL_KERNEL_FLOCK */ "syscall_fcntl_getlock", /* PR_VALUE_SYSCALL_FCNTL_GETLOCK */ "syscall_readlink", /* PR_VALUE_SYSCALL_READLINK */ "syscall_symlink", /* PR_VALUE_SYSCALL_SYMLINK */ -- cgit From 618798276b409e924cda05a83d276313509388b4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Jan 2007 22:26:46 +0000 Subject: r20744: Fix the build (I missed some chkpth -> checkpath renames). Jeremy. (This used to be commit 89b7a0630de0bd95a56263b36d433b4e73517a70) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 187512333c..fe03bc04a3 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -312,7 +312,7 @@ BOOL profile_setup(BOOL rdonly) "SMBunlock", /* PR_VALUE_SMBUNLOCK */ "SMBctemp", /* PR_VALUE_SMBCTEMP */ "SMBmknew", /* PR_VALUE_SMBMKNEW */ - "SMBchkpth", /* PR_VALUE_SMBCHKPTH */ + "SMBcheckpath", /* PR_VALUE_SMBCHECKPATH */ "SMBexit", /* PR_VALUE_SMBEXIT */ "SMBlseek", /* PR_VALUE_SMBLSEEK */ "SMBlockread", /* PR_VALUE_SMBLOCKREAD */ -- cgit From caf8c6a76be051559ffcfe97084edca43e0a3cee Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 30 Jan 2007 22:22:06 +0000 Subject: r21064: The core of this patch is void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker (This used to be commit c8ae60ed65dcce9660ee39c75488f2838cf9a28b) --- source3/profile/profile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index fe03bc04a3..8aaaee161d 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -44,7 +44,8 @@ BOOL do_profile_times = False; /**************************************************************************** receive a set profile level message ****************************************************************************/ -void profile_message(int msg_type, struct process_id src, void *buf, size_t len) +void profile_message(int msg_type, struct process_id src, + void *buf, size_t len, void *private_data) { int level; @@ -97,7 +98,7 @@ void profile_message(int msg_type, struct process_id src, void *buf, size_t len) receive a request profile level message ****************************************************************************/ void reqprofile_message(int msg_type, struct process_id src, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { int level; @@ -246,8 +247,8 @@ BOOL profile_setup(BOOL rdonly) } profile_p = &profile_h->stats; - message_register(MSG_PROFILE, profile_message); - message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); + message_register(MSG_PROFILE, profile_message, NULL); + message_register(MSG_REQ_PROFILELEVEL, reqprofile_message, NULL); return True; } -- cgit From 5a052edf031d2c02b018743f0947a12b4df16c2d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Wed, 14 Feb 2007 02:37:14 +0000 Subject: r21324: Add linux setlease to the vfs layer. Next round, as Volker points out, it should be abstracted a little higher up so other os'es can have an entry, but it will take a bit more work. Thanks to Chetan Shringarpure and Mathias Dietz. I didn't increment the vfs number again because the kernel change notify stuff hasn't been released yet anyway. (This used to be commit 9463211bf3b46ee408b88dfbf42d498e3839d4cc) --- source3/profile/profile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 8aaaee161d..fc22e07fa9 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -289,6 +289,7 @@ BOOL profile_setup(BOOL rdonly) "syscall_ftruncate", /* PR_VALUE_SYSCALL_FTRUNCATE */ "syscall_fcntl_lock", /* PR_VALUE_SYSCALL_FCNTL_LOCK */ "syscall_kernel_flock", /* PR_VALUE_SYSCALL_KERNEL_FLOCK */ + "syscall_linux_setlease", /* PR_VALUE_SYSCALL_LINUX_SETLEASE */ "syscall_fcntl_getlock", /* PR_VALUE_SYSCALL_FCNTL_GETLOCK */ "syscall_readlink", /* PR_VALUE_SYSCALL_READLINK */ "syscall_symlink", /* PR_VALUE_SYSCALL_SYMLINK */ -- cgit From af7f7648235a59a809f47ef9758e50a6990ae214 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 26 Feb 2007 16:37:19 +0000 Subject: r21543: Fix 64bit build warning. Guenther (This used to be commit bc04004c182b114749d8e33edcf835efb252d35d) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index fc22e07fa9..30b0649254 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -230,7 +230,7 @@ BOOL profile_setup(BOOL rdonly) } if (shm_ds.shm_segsz != sizeof(*profile_h)) { - DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", + DEBUG(0,("WARNING: profile size is %d (expected %lu). Deleting\n", (int)shm_ds.shm_segsz, sizeof(*profile_h))); if (shmctl(shm_id, IPC_RMID, &shm_ds) == 0) { goto again; -- cgit From 4952fe368a40b239140b3035db6075427d237bb9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Mar 2007 23:40:03 +0000 Subject: r21714: Change the VFS interface to use struct timespec for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 30b0649254..686d130b56 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -285,7 +285,7 @@ BOOL profile_setup(BOOL rdonly) "syscall_fchown", /* PR_VALUE_SYSCALL_FCHOWN */ "syscall_chdir", /* PR_VALUE_SYSCALL_CHDIR */ "syscall_getwd", /* PR_VALUE_SYSCALL_GETWD */ - "syscall_utime", /* PR_VALUE_SYSCALL_UTIME */ + "syscall_ntimes", /* PR_VALUE_SYSCALL_NTIMES */ "syscall_ftruncate", /* PR_VALUE_SYSCALL_FTRUNCATE */ "syscall_fcntl_lock", /* PR_VALUE_SYSCALL_FCNTL_LOCK */ "syscall_kernel_flock", /* PR_VALUE_SYSCALL_KERNEL_FLOCK */ -- cgit From 80576572cc733336d61f33a2d640151393ec977b Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 20 Apr 2007 01:52:44 +0000 Subject: r22395: allow profiling level to be set on startup (This used to be commit f8f51e8648224af6645dbd0c2f2bffc678b83dac) --- source3/profile/profile.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 686d130b56..b7a2ea23be 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -42,14 +42,10 @@ BOOL do_profile_flag = False; BOOL do_profile_times = False; /**************************************************************************** -receive a set profile level message +Set a profiling level. ****************************************************************************/ -void profile_message(int msg_type, struct process_id src, - void *buf, size_t len, void *private_data) +void set_profile_level(int level, struct process_id src) { - int level; - - memcpy(&level, buf, sizeof(int)); #ifdef WITH_PROFILE switch (level) { case 0: /* turn off profiling */ @@ -94,6 +90,17 @@ void profile_message(int msg_type, struct process_id src, #endif /* WITH_PROFILE */ } +/**************************************************************************** +receive a set profile level message +****************************************************************************/ +void profile_message(int msg_type, struct process_id src, void *buf, size_t len, void *private_data) +{ + int level; + + memcpy(&level, buf, sizeof(int)); + set_profile_level(level, src); +} + /**************************************************************************** receive a request profile level message ****************************************************************************/ -- cgit From e6383f47629368d9dd4e803f17566a24e9d7359e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 7 May 2007 09:35:35 +0000 Subject: r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8) --- source3/profile/profile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index b7a2ea23be..c4136950a5 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -44,7 +44,7 @@ BOOL do_profile_times = False; /**************************************************************************** Set a profiling level. ****************************************************************************/ -void set_profile_level(int level, struct process_id src) +void set_profile_level(int level, struct server_id src) { #ifdef WITH_PROFILE switch (level) { @@ -93,7 +93,8 @@ void set_profile_level(int level, struct process_id src) /**************************************************************************** receive a set profile level message ****************************************************************************/ -void profile_message(int msg_type, struct process_id src, void *buf, size_t len, void *private_data) +void profile_message(int msg_type, struct server_id src, void *buf, size_t len, + void *private_data) { int level; @@ -104,7 +105,7 @@ void profile_message(int msg_type, struct process_id src, void *buf, size_t len, /**************************************************************************** receive a request profile level message ****************************************************************************/ -void reqprofile_message(int msg_type, struct process_id src, +void reqprofile_message(int msg_type, struct server_id src, void *buf, size_t len, void *private_data) { int level; -- cgit From 8f9369f2e627cf2da4f5902be570200a9d2b1a67 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 May 2007 12:18:17 +0000 Subject: r22900: Convert profile/ to messaging_send_pid/messaging_register (This used to be commit edbeea520727f51568ccd8ffa802e06bd120794c) --- source3/profile/profile.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index c4136950a5..257b0abba5 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -93,20 +93,31 @@ void set_profile_level(int level, struct server_id src) /**************************************************************************** receive a set profile level message ****************************************************************************/ -void profile_message(int msg_type, struct server_id src, void *buf, size_t len, - void *private_data) +static void profile_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id src, + DATA_BLOB *data) { int level; - memcpy(&level, buf, sizeof(int)); + if (data->length != sizeof(level)) { + DEBUG(0, ("got invalid profile message\n")); + return; + } + + memcpy(&level, data->data, sizeof(level)); set_profile_level(level, src); } /**************************************************************************** receive a request profile level message ****************************************************************************/ -void reqprofile_message(int msg_type, struct server_id src, - void *buf, size_t len, void *private_data) +static void reqprofile_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id src, + DATA_BLOB *data) { int level; @@ -117,7 +128,8 @@ void reqprofile_message(int msg_type, struct server_id src, #endif DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %u\n", (unsigned int)procid_to_pid(&src))); - message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int), True); + messaging_send_buf(msg_ctx, src, MSG_PROFILELEVEL, + (uint8 *)&level, sizeof(level)); } /******************************************************************* @@ -184,7 +196,7 @@ static void init_clock_gettime(void) } #endif -BOOL profile_setup(BOOL rdonly) +BOOL profile_setup(struct messaging_context *msg_ctx, BOOL rdonly) { struct shmid_ds shm_ds; @@ -238,7 +250,7 @@ BOOL profile_setup(BOOL rdonly) } if (shm_ds.shm_segsz != sizeof(*profile_h)) { - DEBUG(0,("WARNING: profile size is %d (expected %lu). Deleting\n", + DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", (int)shm_ds.shm_segsz, sizeof(*profile_h))); if (shmctl(shm_id, IPC_RMID, &shm_ds) == 0) { goto again; @@ -255,8 +267,12 @@ BOOL profile_setup(BOOL rdonly) } profile_p = &profile_h->stats; - message_register(MSG_PROFILE, profile_message, NULL); - message_register(MSG_REQ_PROFILELEVEL, reqprofile_message, NULL); + if (msg_ctx != NULL) { + messaging_register(msg_ctx, NULL, MSG_PROFILE, + profile_message); + messaging_register(msg_ctx, NULL, MSG_REQ_PROFILELEVEL, + reqprofile_message); + } return True; } -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 257b0abba5..ebbcacac07 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/profile/profile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index ebbcacac07..76f6386c51 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ -- cgit From 0f0e847e39de2f4084127f782261ad290ba042c7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 16 Jul 2007 14:19:59 +0000 Subject: r23891: fix compiler warning metze (This used to be commit 6dcbc0b6055998d77bd7bb6acfb622bc1423964b) --- source3/profile/profile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 76f6386c51..20748e8f22 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -89,6 +89,8 @@ void set_profile_level(int level, struct server_id src) #endif /* WITH_PROFILE */ } +#ifdef WITH_PROFILE + /**************************************************************************** receive a set profile level message ****************************************************************************/ @@ -134,7 +136,6 @@ static void reqprofile_message(struct messaging_context *msg_ctx, /******************************************************************* open the profiling shared memory area ******************************************************************/ -#ifdef WITH_PROFILE #ifdef HAVE_CLOCK_GETTIME -- cgit From 51e5001cba2ae438674517371d29ae7f78c0a52a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 31 Aug 2007 15:01:50 +0000 Subject: r24842: Fix build warning. Guenther (This used to be commit 205ef6ab3e9332a2a4a4f775c2cdddbcd3ec739d) --- source3/profile/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 20748e8f22..cf2bd9ee36 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -251,7 +251,7 @@ BOOL profile_setup(struct messaging_context *msg_ctx, BOOL rdonly) if (shm_ds.shm_segsz != sizeof(*profile_h)) { DEBUG(0,("WARNING: profile size is %d (expected %d). Deleting\n", - (int)shm_ds.shm_segsz, sizeof(*profile_h))); + (int)shm_ds.shm_segsz, (int)sizeof(*profile_h))); if (shmctl(shm_id, IPC_RMID, &shm_ds) == 0) { goto again; } else { -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/profile/profile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index cf2bd9ee36..50751d546e 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -27,18 +27,18 @@ #ifdef WITH_PROFILE static int shm_id; -static BOOL read_only; +static bool read_only; #if defined(HAVE_CLOCK_GETTIME) clockid_t __profile_clock; -BOOL have_profiling_clock = False; +bool have_profiling_clock = False; #endif #endif struct profile_header *profile_h; struct profile_stats *profile_p; -BOOL do_profile_flag = False; -BOOL do_profile_times = False; +bool do_profile_flag = False; +bool do_profile_times = False; /**************************************************************************** Set a profiling level. @@ -196,7 +196,7 @@ static void init_clock_gettime(void) } #endif -BOOL profile_setup(struct messaging_context *msg_ctx, BOOL rdonly) +bool profile_setup(struct messaging_context *msg_ctx, bool rdonly) { struct shmid_ds shm_ds; -- cgit From 488b59cfac244ec8cfc60df687fcd153d693509c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 29 Oct 2007 17:16:13 -0700 Subject: Add in the recvfile entry to the VFS layer with a default implementation. Needed for the zero-copy write code. Jeremy. (This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86) --- source3/profile/profile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 50751d546e..e9c7c7bb7c 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -297,6 +297,7 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly) "syscall_pwrite", /* PR_VALUE_SYSCALL_PWRITE */ "syscall_lseek", /* PR_VALUE_SYSCALL_LSEEK */ "syscall_sendfile", /* PR_VALUE_SYSCALL_SENDFILE */ + "syscall_recvfile", /* PR_VALUE_SYSCALL_RECVFILE */ "syscall_rename", /* PR_VALUE_SYSCALL_RENAME */ "syscall_fsync", /* PR_VALUE_SYSCALL_FSYNC */ "syscall_stat", /* PR_VALUE_SYSCALL_STAT */ -- cgit From 00b2cdf75e9bea25034440054b4acd91a179c86d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 May 2008 18:09:07 -0700 Subject: Yay ! Remove a VFS entry. Removed the set_nt_acl() call, this can only be done via fset_nt_acl() using an open file/directory handle. I'd like to do the same with get_nt_acl() but am concerned about efficiency problems with "hide unreadable/hide unwritable" when doing a directory listing (this would mean opening every file in the dir on list). Moving closer to rationalizing the ACL model and maybe moving the POSIX calls into a posix_acl VFS module rather than having them as first class citizens of the VFS. Jeremy. (This used to be commit f487f742cb903a06fbf2be006ddc9ce9063339ed) --- source3/profile/profile.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/profile/profile.c') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index e9c7c7bb7c..bdbd805718 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -426,7 +426,6 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly) "NT_transact_set_user_quota",/* PR_VALUE_NT_TRANSACT_SET_USER_QUOTA */ "get_nt_acl", /* PR_VALUE_GET_NT_ACL */ "fget_nt_acl", /* PR_VALUE_FGET_NT_ACL */ - "set_nt_acl", /* PR_VALUE_SET_NT_ACL */ "fset_nt_acl", /* PR_VALUE_FSET_NT_ACL */ "chmod_acl", /* PR_VALUE_CHMOD_ACL */ "fchmod_acl", /* PR_VALUE_FCHMOD_ACL */ -- cgit