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:
parent
0b0ac41aea
commit
e007c60a4f
@ -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 \
|
||||
|
@ -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) ) );
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user