summaryrefslogtreecommitdiff
path: root/source3/include/smbprofile.h
AgeCommit message (Collapse)AuthorFilesLines
2018-07-27s3: vfs: add SMB_VFS_GETXATTRAT_SEND/RECVRalph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-07-25vfs_default: fix async fsync idle/busy time profilingRalph Boehme1-1/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-05-25s3: VFS: Remove SMB_VFS_FCHMOD_ACL().Jeremy Allison1-1/+0
No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2018-05-25s3: VFS: Remove SMB_VFS_CHMOD_ACL().Jeremy Allison1-1/+0
No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2018-05-17s3: profile: Cleanup - we no longer use read/write/fsync syscalls.Jeremy Allison1-3/+0
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2016-03-28s3-profile: add PROFILE_TIMESTAMP macroUri Simchoni1-0/+4
This is a get-timestamp macro which works only when profiling is enabled in the build. The underlying clock_gettime_mono() function can be costly on some architectures and we want to avoid it if it's not necessary. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-28s3-profile: reduce dependencies of smbprofile.hUri Simchoni1-1/+2
Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-11-16smbprofile: Add dst pid to smbprofile_cleanupVolker Lendecke1-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>
2015-03-06s3:smbprofile: profile the system and user space cpu timeStefan Metzmacher1-0/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-06s3:smbprofile: Replace sysv shmem with tdbVolker Lendecke1-17/+99
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>
2015-03-06s3:smbprofile: specify SMBPROFILE_STATS_SECTION_START() with name vs. ↵Stefan Metzmacher1-10/+10
display[name] Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2014-11-19s3:smbprofile: profile async pread/pwrite/fsync syscallsStefan Metzmacher1-0/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 19 23:13:10 CET 2014 on sn-devel-104
2014-11-19s3:smbprofile: track connect_count and disconnect_countStefan Metzmacher1-0/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: remove unused {START,END}_PROFILE_STAMP()Stefan Metzmacher1-19/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: report idle state of 'idle_count' and 'idle_time'Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: improve profiling for the security context switching.Stefan Metzmacher1-1/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smb2_server: use async smbprofile macrosStefan Metzmacher1-19/+19
This improves profiling and corrently counts the total and idle time for async requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: rewrite the internal macrosStefan Metzmacher1-829/+467
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>
2014-11-19s3:smbprofile: Make smbprofile.h includable on its ownVolker Lendecke1-0/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbd: improve writecache profilingStefan Metzmacher1-7/+15
In order to have useful profiling counters should never be decremented. We need a separate counter for deallocation events. The current value can be calculated by allocations - deallocations. We also use better names and avoid having an array for the flush reasons. This will simplify further profiling improvements a lot. The value writecache_num_write_caches (this was similar to writecache_allocations) is replaced by writecache_cached_writes, which counts the amount of writes which were completely handled by the cache. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: remove unused nmbd related countersStefan Metzmacher1-73/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19s3:smbprofile: add END_PROFILE_BYTES() marcoStefan Metzmacher1-0/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03profiling: Make WITH_PROFILE span more in smbprofile.hVolker Lendecke1-2/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 3 22:17:46 CEST 2014 on sn-devel-104
2014-10-03profiling: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03profiling: Move some #defines to profile.cVolker Lendecke1-4/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03profiling: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03profiling: Make "struct profile_header" staticVolker Lendecke1-7/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22Rename the profile enums with a SAMBA_ prefix to avoid conflict with system ↵Jeremy Allison1-1/+1
files. WRITE_FLUSH is defined in fs.h in Linux. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-16s3:include remove non-blank line endingsChristian Ambach1-3/+3
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-20s3:include bump profile memory area version numberChristian Ambach1-1/+1
forgot to bump this earlier when removing the counters for setdir Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-03-12s3: remove some dead code (for setdir command)Christian Ambach1-5/+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
2012-06-20s3:include: add START/END_PROFILE_STAMP()Stefan Metzmacher1-7/+23
This is needed when the profiling spans multiple functions. metze
2011-04-14s3: only include smb profiling where needed.Günther Deschner1-0/+5
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Thu Apr 14 01:31:39 CEST 2011 on sn-devel-104
2011-02-09Add fdopendir to the VFS. We will use this to reuse a directory fd already ↵Jeremy Allison1-0/+4
open by NtCreateX. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Feb 9 00:55:22 CET 2011 on sn-devel-104
2010-12-18Rename vfs operation posix_fallocate to just fallocate and add the ↵Jeremy Allison1-3/+3
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
2010-12-02Move posix_fallocate into the VFS where it belongs.Jeremy Allison1-0/+4
Jeremy.
2010-09-14s3/profile: remove the magical clock initialization from the profile codeBjörn Jacke1-8/+3
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.
2010-08-31s3: we have clock_gettime everywhere, remove ifdefsBjörn Jacke1-13/+0
2010-07-09s3: Cleanup of the initial SMB2 counters patch.Ira Cooper1-10/+0
This reorganizes smbd_smb2_request_dispatch to have a central exit point, and use the normal profiling macros. Signed-off-by: Jeremy Allison <jra@samba.org>
2010-07-07s3: Add SMB2 performance counters.Ira Cooper1-2/+85
A performance counter was added for every base type of SMB2 op.
2009-03-13s3: Add strict lock/unlock calls to the vfs layer to replace is_lockedDave Richards1-0/+8
2009-02-24S3: Add in profile counters for new vfs and syscall entries.todd stecher1-0/+28
2009-01-29s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty1-0/+4
This allows module implementors to customize what allocation size is returned to the client.
2008-10-14Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij1-4/+4
2008-05-08Yay ! Remove a VFS entry. Removed the set_nt_acl() call,Jeremy Allison1-4/+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)
2007-11-01Add missing recvfile_bytes element - noticed by Kukks.Jeremy Allison1-0/+1
Jeremy. (This used to be commit 5cf2811e8e1d9e6a1114bbdff89c333d5b374282)
2007-10-29Add in the recvfile entry to the VFS layer with a defaultJeremy Allison1-0/+4
implementation. Needed for the zero-copy write code. Jeremy. (This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-2/+2
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)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)