summaryrefslogtreecommitdiff
path: root/source3/profile
Commit message (Collapse)AuthorAgeFilesLines
* s3:profile: Allow profile subsystem to use SHA1 in FIPS modeAndreas Schneider2019-07-091-0/+7
| | | | | | | | | | | | This is non-cryptographic use. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jul 9 13:31:46 UTC 2019 on sn-devel-184
* s3:profile: Use SHA1 for hashing in profiling functions.Andreas Schneider2019-07-091-6/+5
| | | | | | | | | This can use SHA NI instructions if the CPU supports it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:profile: Use GnuTLS MD5Andreas Schneider2019-05-211-9/+23
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* profiling: stop smbprofile from growing unnecessarilyDylan Stephano-Shachter2019-01-161-0/+5
| | | | | | | | | Signed-off-by: Dylan Stephano-Shachter <dshachter@nasuni.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 16 02:01:55 CET 2019 on sn-devel-144
* lib: Pass mem_ctx to cache_path()Volker Lendecke2018-08-171-1/+1
| | | | | | | | | | | Fix a confusing API: Many places TALLOC_FREE the path where it's not clear you have to do it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Aug 17 14:28:51 CEST 2018 on sn-devel-144
* s3-profile: reduce dependencies of smbprofile.hUri Simchoni2016-03-282-7/+7
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbprofile: Add dst pid to smbprofile_cleanupVolker Lendecke2015-11-161-2/+2
| | | | | | | | The consolidation will soon be done by a separate process. We need to avoid the getpid() call in smbprofile_cleanup(). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* Convert all uint32/16/8 to _t in a grab-bag of remaining files.Richard Sharpe2015-05-141-1/+1
| | | | | | | | | | I still need to fix the rpc stuff, but we are almost there. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
* s3:smbprofile: profile the system and user space cpu timeStefan Metzmacher2015-03-061-0/+22
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:smbprofile: Replace sysv shmem with tdbVolker Lendecke2015-03-061-80/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What? This patch gets rid of the central shared memory segment referenced by "profile_p". Instead, every smbd gets a static profile_area where it collects profiling data. Once a second, every smbd writes this profiling data into a record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this database and sums up what it finds. Why? At least in my perception sysv IPC has not the best reputation on earth. The code before this patch uses shmat(). Samba ages ago has developed a good abstraction of shared memory: It's called tdb. The main reason why I started this is that I have a request to become more flexible with profiling data. Samba should be able to collect data per share or per user, something which is almost impossible to do with a fixed structure. My idea is to for example install a profile area per share and every second marshall this into one tdb record indexed by share name. smbstatus -P would then also collect the data and either aggregate them or put them into individual per-share statistics. This flexibility in the data model is not really possible with one fixed structure. But isn't it slow? Well, I don't think so. I can't really prove it, but I do believe that on large boxes atomically incrementing a shared memory value for every SMB does show up due to NUMA effects. With this patch the hot code path is completely process-local. Once a second every smbd writes into a central tdb, this of course does atomic operations. But it's once a second, not on every SMB2 read. There's two places where I would like to improve things: With the current code all smbds wake up once a second. With 10,000 potentially idle smbds this will become noticable. That's why the current only starts the timer when something has changed. The second place is the tdb traverse: Right now traverse is blocking in the sense that when it has to switch hash chains it will block. With mutexes, this means a syscall. I have a traverse light in mind that works as follows: It assumes a locked hash chain and then walks the complete chain in one run without unlocking in between. This way the caller can do nonblocking locks in the first round and only do blocking locks in a second round. Also, a lot of syscall overhead will vanish. This way smbstatus -P will have almost zero impact on normal operations. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:smbprofile: rewrite the internal macrosStefan Metzmacher2014-11-191-188/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now autogenerate a lot of code using SMBPROFILE_STATS_ALL_SECTIONS macro which expands to different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros. This also allows async profiling using: struct mystate { ... SMBPROFILE_BASIC_ASYNC_STATE(profile_state); ... }; ... SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate->profile_state); ... SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate->profile_state); ... SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate->profile_state); ... SMBPROFILE_BASIC_ASYNC_END(mystate->profile_state); The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbprofile: remove unused nmbd related countersStefan Metzmacher2014-11-191-19/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix nonempty line endingsVolker Lendecke2014-10-071-15/+14
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* profiling: Only compile profile/profile.c if profiling is enabledVolker Lendecke2014-10-032-16/+32
| | | | | | | | This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code more readable Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* profiling: Move some #defines to profile.cVolker Lendecke2014-10-031-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* profiling: Make "struct profile_header" staticVolker Lendecke2014-10-031-1/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: remove some dead code (for setdir command)Christian Ambach2013-03-121-1/+0
| | | | | | | | | | | set dir seems to have been a special SMB command used by Pathworks clients the supporting code for it was already removed in 2007, so just remove all remnants related to it (smb.conf parameter, documentation, ...) Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 12 01:03:37 CET 2013 on sn-devel-104
* s3-build: fix the --with-profiling-data build on mac os x.Günther Deschner2011-04-151-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Apr 15 13:33:43 CEST 2011 on sn-devel-104
* s3: only include smb profiling where needed.Günther Deschner2011-04-141-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Thu Apr 14 01:31:39 CEST 2011 on sn-devel-104
* s3: fix the build of --with-profiling-data.Günther Deschner2011-04-141-0/+1
| | | | Guenther
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-1/+0
| | | | Guenther
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* Rename vfs operation posix_fallocate to just fallocate and add the ↵Jeremy Allison2010-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | vfs_fallocate_mode parameter. It turns out we need the fallocate operations to be able to both allocate and extend filesize, and to allocate and not extend filesize, and posix_fallocate can only do the former. So by defining the vfs op as posix_fallocate we lose the opportunity to use any underlying syscalls (like Linux fallocate) that can do the latter as well. We don't currently use the non-extending filesize call, but now I've changed the vfs op definition we can in the future. For the moment simply map the fallocate op onto posix_fallocate for the VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the VFS_FALLOCATE_KEEP_SIZE case. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
* Move posix_fallocate into the VFS where it belongs.Jeremy Allison2010-12-021-0/+1
| | | | Jeremy.
* s3/profile: remove the magical clock initialization from the profile codeBjörn Jacke2010-09-141-56/+0
| | | | | | there's no point in not profiling times if no monotonic clock is found - monotonic and realtime clock are equally fast. Just use clock_gettime_mono instead.
* s3/profiling: don't use CLOCK_PROCESS_CPUTIME_IDBjörn Jacke2010-09-141-18/+0
| | | | that clock is a CPU burnometer but we need a chronometer for profiling.
* s3: we have clock_gettime everywhere, remove ifdefsBjörn Jacke2010-08-311-7/+0
|
* s3: Add SMB2 performance counters.Ira Cooper2010-07-071-0/+19
| | | | A performance counter was added for every base type of SMB2 op.
* s3: Fix the buildVolker Lendecke2010-05-081-0/+1
|
* s3:smbd: Fix bug 6690, wrong error checkAndrew Klosterman2009-09-081-1/+1
|
* S3: Add in profile counters for new vfs and syscall entries.todd stecher2009-02-241-0/+7
|
* Yay ! Remove a VFS entry. Removed the set_nt_acl() call,Jeremy Allison2008-05-081-1/+0
| | | | | | | | | | | | | | | 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)
* Add in the recvfile entry to the VFS layer with a defaultJeremy Allison2007-10-291-0/+1
| | | | | | implementation. Needed for the zero-copy write code. Jeremy. (This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-5/+5
| | | | | | | | 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)
* r24842: Fix build warning.Günther Deschner2007-10-101-1/+1
| | | | | Guenther (This used to be commit 205ef6ab3e9332a2a4a4f775c2cdddbcd3ec739d)
* r23891: fix compiler warningStefan Metzmacher2007-10-101-1/+2
| | | | | metze (This used to be commit 6dcbc0b6055998d77bd7bb6acfb622bc1423964b)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r22900: Convert profile/ to messaging_send_pid/messaging_registerVolker Lendecke2007-10-101-10/+26
| | | | (This used to be commit edbeea520727f51568ccd8ffa802e06bd120794c)
* r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke2007-10-101-3/+4
| | | | | | | | | | 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)
* r22395: allow profiling level to be set on startupHerb Lewis2007-10-101-6/+13
| | | | (This used to be commit f8f51e8648224af6645dbd0c2f2bffc678b83dac)
* r21714: Change the VFS interface to use struct timespecJeremy Allison2007-10-101-1/+1
| | | | | | | | | | | 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)
* r21543: Fix 64bit build warning.Günther Deschner2007-10-101-1/+1
| | | | | Guenther (This used to be commit bc04004c182b114749d8e33edcf835efb252d35d)
* r21324: Add linux setlease to the vfs layer. Next round, as Volker points out,Jim McDonough2007-10-101-0/+1
| | | | | | | | | | 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)
* r21064: The core of this patch isVolker Lendecke2007-10-101-4/+5
| | | | | | | | | | | | | | | | | | | | | | | 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)
* r20744: Fix the build (I missed some chkpth -> checkpath renames).Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 89b7a0630de0bd95a56263b36d433b4e73517a70)
* r19647: Add some GPFS support in a vfs mod. Also adds the kernel flock op toJim McDonough2007-10-101-0/+1
| | | | | | the vfs layer, since gpfs supports it. Thanks to Volker, Christian, Mathias, Chetan, and Peter. (This used to be commit 0620658890fa9c68a9848538728023192319c81a)
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-1/+180
| | | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
* r16116: Hoist the slow CLOCK_REALTIME message inside the branch so we neverJames Peach2007-10-101-5/+5
| | | | | | | 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)
* r16111: Patch from Björn JACKE <samba@j3e.de>.James Peach2007-10-101-16/+76
| | | | | | | | 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)