1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-03 12:58:35 +03:00

s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-11-14 12:42:51 +01:00 committed by Jeremy Allison
parent 0b0ac41aea
commit e007c60a4f
3 changed files with 13 additions and 2 deletions

View File

@ -27,7 +27,7 @@
SMBPROFILE_STATS_START \
\
SMBPROFILE_STATS_SECTION_START("SMBD loop") \
SMBPROFILE_STATS_COUNT(smb_count) \
SMBPROFILE_STATS_COUNT(request) \
SMBPROFILE_STATS_COUNT(uid_changes) \
SMBPROFILE_STATS_BASIC(smbd_idle) \
SMBPROFILE_STATS_SECTION_END \

View File

@ -1871,7 +1871,7 @@ static void process_smb(struct smbXsrv_connection *xconn,
struct smbd_server_connection *sconn = xconn->client->sconn;
int msg_type = CVAL(inbuf,0);
DO_PROFILE_INC(smb_count);
DO_PROFILE_INC(request);
DEBUG( 6, ( "got message type 0x%x of len 0x%x\n", msg_type,
smb_len(inbuf) ) );

View File

@ -1945,6 +1945,8 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
inhdr = SMBD_SMB2_IN_HDR_PTR(req);
DO_PROFILE_INC(request);
/* TODO: verify more things */
flags = IVAL(inhdr, SMB2_HDR_FLAGS);
@ -3025,6 +3027,15 @@ void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
return;
}
#ifdef WITH_PROFILE
/*
* this was already counted at the SMB1 layer =>
* smbd_smb2_request_dispatch() should not count it twice.
*/
if (profile_p->request_stats.count > 0) {
profile_p->request_stats.count--;
}
#endif
status = smbd_smb2_request_dispatch(req);
if (!NT_STATUS_IS_OK(status)) {
smbd_server_connection_terminate(xconn, nt_errstr(status));