[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Fri Apr 11 19:48:01 UTC 2025


The branch, master has been updated
       via  be192dc2f5b s3-wscript: make sure to build with selftest without libevent
       via  5231a159db6 s3-selftest: only run prometheus exporter tests when configured
       via  271b2e8cd30 build: use '--with-prometheus-exporter' configure option
       via  cf75acf8779 selftest: Add test for smb_prometheus_endpoint utility
       via  793d89b44a4 s3/smb_prometheus_endpoint: add authentication metrics
       via  ca937832a00 smbprofile: add authentication metrics
       via  2b01a271a69 smbprofile: SMB2-READ result NT_STATUS_END_OF_FILE is not an error
       via  8ea5b91dfdc smbprofile: Count failed requests
       via  738e9d88ef9 utils: Initial version of smb_prometheus_endpoint
       via  48c80e058a0 profile: Add number of sessions, tcons and files to smbstatus -P
       via  e3394abdd8e profile: Add sessions, tcons and files to profile data
       via  c2601898257 profile: Pass dummy smbd_server_connection to smbprofile_dump()
       via  9732e3f8810 profile: Return number of workers from smbprofile_collect_tdb()
       via  d0eea9d5a5f profile: Add time buckets to smbprofile_stats_iobytes
       via  fe3bde8f623 build: Detect libevent
      from  6d6531d0e21 testprogs: Use 'sync machine password to keytab' for keytab creation

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit be192dc2f5b28bd963cbd3661ec5e4d9cf995c03
Author: Günther Deschner <gd at samba.org>
Date:   Tue Mar 18 14:41:46 2025 +0100

    s3-wscript: make sure to build with selftest without libevent
    
    No need to stop running selftest in absence of libevent anymore.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri Apr 11 19:47:24 UTC 2025 on atb-devel-224

commit 5231a159db6af9caf1e0b2d88a3fc3e9676cee05
Author: Günther Deschner <gd at samba.org>
Date:   Tue Mar 18 14:41:08 2025 +0100

    s3-selftest: only run prometheus exporter tests when configured
    
    Extract the configure info for building with prometheus exporter and
    only run the blackbox test in case it is enabled.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 271b2e8cd30093bb19ee9849ed627fa75d4f513a
Author: Shachar Sharon <ssharon at redhat.com>
Date:   Mon Mar 10 14:23:01 2025 +0200

    build: use '--with-prometheus-exporter' configure option
    
    Prefer '--with-prometheus-exporter' configure option over
    '--with-libevent', which in turn, requires libevent.
    
    Signed-off-by: Shachar Sharon <ssharon at redhat.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit cf75acf877940135dea97af2aff9206e335b4736
Author: Shachar Sharon <ssharon at redhat.com>
Date:   Wed Feb 5 16:20:10 2025 +0200

    selftest: Add test for smb_prometheus_endpoint utility
    
    Basic test for smb_prometheus_endpoint utility. Requires valid metrics
    output using 'curl'. Start/stop the endpoint utility from within the
    test script itself.
    
    Signed-off-by: Shachar Sharon <ssharon at redhat.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 793d89b44a4b6f5b721108fec8a21bf637739e05
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Feb 5 18:19:31 2024 +0100

    s3/smb_prometheus_endpoint: add authentication metrics
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit ca937832a000d6e38b3e88a39c6db612ea42f077
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Feb 5 18:04:57 2024 +0100

    smbprofile: add authentication metrics
    
    "authentication" is the total number of requests and "authentication_failed" is
    obviously the number of failed authentications.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 2b01a271a6916790b46f960e8d76f524a990d333
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Jan 29 16:33:41 2024 +0100

    smbprofile: SMB2-READ result NT_STATUS_END_OF_FILE is not an error
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 8ea5b91dfdc73431d0f343dda66b4622d7140ed3
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 9 16:12:20 2024 +0100

    smbprofile: Count failed requests
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 738e9d88ef94aa4db56e8ce2cbb368b22daba4bf
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 17 15:15:13 2023 +0100

    utils: Initial version of smb_prometheus_endpoint
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 48c80e058a09927938aef8e721aa12d70f0dcb9b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 22 16:12:01 2023 +0100

    profile: Add number of sessions, tcons and files to smbstatus -P
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit e3394abdd8e26714d016ed7f6fd4bf0a5b45621b
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 21 13:34:03 2023 +0100

    profile: Add sessions, tcons and files to profile data
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit c2601898257f9f930b03e29006e80b630262fcef
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 21 12:34:02 2023 +0100

    profile: Pass dummy smbd_server_connection to smbprofile_dump()
    
    It will need access to its fields soon.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 9732e3f88101553e9249c87745953e42618e4902
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 22 15:11:09 2023 +0100

    profile: Return number of workers from smbprofile_collect_tdb()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit d0eea9d5a5f70fc9aca2655442853c25e26a155d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 17 15:14:33 2023 +0100

    profile: Add time buckets to smbprofile_stats_iobytes
    
    Enable a histogram of time taken for smb2 requests. This puts all smb2
    requests into buckets of <1, <2, <4, ... <256 msecs duration and
    beyond.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit fe3bde8f623ef5d55d22e5e69a5fabb730ec77e6
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jan 16 09:35:22 2025 +0100

    build: Detect libevent
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 .gitlab-ci-main.yml                                |   2 +-
 bootstrap/config.py                                |   1 +
 bootstrap/generated-dists/centos9s/bootstrap.sh    |   1 +
 bootstrap/generated-dists/centos9s/packages.yml    |   1 +
 .../generated-dists/debian11-32bit/bootstrap.sh    |   1 +
 .../generated-dists/debian11-32bit/packages.yml    |   1 +
 bootstrap/generated-dists/debian11/bootstrap.sh    |   1 +
 bootstrap/generated-dists/debian11/packages.yml    |   1 +
 .../generated-dists/debian12-32bit/bootstrap.sh    |   1 +
 .../generated-dists/debian12-32bit/packages.yml    |   1 +
 bootstrap/generated-dists/debian12/bootstrap.sh    |   1 +
 bootstrap/generated-dists/debian12/packages.yml    |   1 +
 bootstrap/generated-dists/fedora41/bootstrap.sh    |   1 +
 bootstrap/generated-dists/fedora41/packages.yml    |   1 +
 bootstrap/generated-dists/opensuse155/bootstrap.sh |   1 +
 bootstrap/generated-dists/opensuse155/packages.yml |   1 +
 bootstrap/generated-dists/rocky8/bootstrap.sh      |   1 +
 bootstrap/generated-dists/rocky8/packages.yml      |   1 +
 .../generated-dists/ubuntu1804-32bit/bootstrap.sh  |   1 +
 .../generated-dists/ubuntu1804-32bit/packages.yml  |   1 +
 bootstrap/generated-dists/ubuntu1804/bootstrap.sh  |   1 +
 bootstrap/generated-dists/ubuntu1804/packages.yml  |   1 +
 bootstrap/generated-dists/ubuntu2004/bootstrap.sh  |   1 +
 bootstrap/generated-dists/ubuntu2004/packages.yml  |   1 +
 bootstrap/generated-dists/ubuntu2204/bootstrap.sh  |   1 +
 bootstrap/generated-dists/ubuntu2204/packages.yml  |   1 +
 bootstrap/sha1sum.txt                              |   2 +-
 docs-xml/manpages/smb_prometheus_endpoint.8.xml    |  75 +++
 docs-xml/wscript_build                             |   1 +
 script/autobuild.py                                |   7 +-
 selftest/selftesthelpers.py                        |   1 +
 source3/include/smbprofile.h                       | 125 ++++-
 source3/profile/profile.c                          |  29 +-
 source3/profile/profile_read.c                     |  52 +-
 .../script/tests/test_smb_prometheus_endpoint.sh   | 189 +++++++
 source3/script/tests/test_smbstatus.sh             |   2 +-
 source3/selftest/tests.py                          |   8 +
 source3/smbd/server_exit.c                         |   2 +-
 source3/smbd/smb1_sesssetup.c                      |  38 ++
 source3/smbd/smb2_process.c                        |  10 +-
 source3/smbd/smb2_server.c                         |  12 +-
 source3/smbd/smb2_sesssetup.c                      |   3 +
 source3/utils/smb_prometheus_endpoint.c            | 558 +++++++++++++++++++++
 source3/utils/status_profile.c                     |  33 ++
 source3/utils/wscript_build                        |  10 +
 source3/wscript                                    |  13 +
 46 files changed, 1166 insertions(+), 31 deletions(-)
 create mode 100644 docs-xml/manpages/smb_prometheus_endpoint.8.xml
 create mode 100755 source3/script/tests/test_smb_prometheus_endpoint.sh
 create mode 100644 source3/utils/smb_prometheus_endpoint.c


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml
index df3ec8ae984..216e996f42d 100644
--- a/.gitlab-ci-main.yml
+++ b/.gitlab-ci-main.yml
@@ -47,7 +47,7 @@ variables:
   # Set this to the contents of bootstrap/sha1sum.txt
   # which is generated by bootstrap/template.py --render
   #
-  SAMBA_CI_CONTAINER_TAG: d20548dec714e202867b593f5e19f3004f7a2457
+  SAMBA_CI_CONTAINER_TAG: 26a734ea226b4fd32141ae950af16f75f290645f
   #
   # We use the ubuntu2204 image as default as
   # it matches what we have on atb-devel-224
diff --git a/bootstrap/config.py b/bootstrap/config.py
index ae94c75bfa0..dbc0f96a539 100644
--- a/bootstrap/config.py
+++ b/bootstrap/config.py
@@ -116,6 +116,7 @@ PKGS = [
     ('libglib2.0-dev', 'glib2-devel'),
     ('libicu-dev', 'libicu-devel'),
     ('heimdal-multidev', ''),
+    ('libevent-dev', 'libevent-devel'),
 
     # NAME1, NAME2
     # for debian, locales provide locale support with language packs
diff --git a/bootstrap/generated-dists/centos9s/bootstrap.sh b/bootstrap/generated-dists/centos9s/bootstrap.sh
index e3ad1344985..9181f97d278 100755
--- a/bootstrap/generated-dists/centos9s/bootstrap.sh
+++ b/bootstrap/generated-dists/centos9s/bootstrap.sh
@@ -64,6 +64,7 @@ dnf install -y \
     libblkid-devel \
     libbsd-devel \
     libcap-devel \
+    libevent-devel \
     libicu-devel \
     libpcap-devel \
     libtasn1-devel \
diff --git a/bootstrap/generated-dists/centos9s/packages.yml b/bootstrap/generated-dists/centos9s/packages.yml
index 4a4f99b8564..b78799a24ff 100644
--- a/bootstrap/generated-dists/centos9s/packages.yml
+++ b/bootstrap/generated-dists/centos9s/packages.yml
@@ -45,6 +45,7 @@ packages:
   - libblkid-devel
   - libbsd-devel
   - libcap-devel
+  - libevent-devel
   - libicu-devel
   - libpcap-devel
   - libtasn1-devel
diff --git a/bootstrap/generated-dists/debian11-32bit/bootstrap.sh b/bootstrap/generated-dists/debian11-32bit/bootstrap.sh
index b7d5f87018b..a32636de32f 100755
--- a/bootstrap/generated-dists/debian11-32bit/bootstrap.sh
+++ b/bootstrap/generated-dists/debian11-32bit/bootstrap.sh
@@ -53,6 +53,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/debian11-32bit/packages.yml b/bootstrap/generated-dists/debian11-32bit/packages.yml
index b39e3c31dae..f2249eba899 100644
--- a/bootstrap/generated-dists/debian11-32bit/packages.yml
+++ b/bootstrap/generated-dists/debian11-32bit/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/debian11/bootstrap.sh b/bootstrap/generated-dists/debian11/bootstrap.sh
index b7d5f87018b..a32636de32f 100755
--- a/bootstrap/generated-dists/debian11/bootstrap.sh
+++ b/bootstrap/generated-dists/debian11/bootstrap.sh
@@ -53,6 +53,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/debian11/packages.yml b/bootstrap/generated-dists/debian11/packages.yml
index b39e3c31dae..f2249eba899 100644
--- a/bootstrap/generated-dists/debian11/packages.yml
+++ b/bootstrap/generated-dists/debian11/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/debian12-32bit/bootstrap.sh b/bootstrap/generated-dists/debian12-32bit/bootstrap.sh
index 58d3866fdf2..ba78ddddc12 100755
--- a/bootstrap/generated-dists/debian12-32bit/bootstrap.sh
+++ b/bootstrap/generated-dists/debian12-32bit/bootstrap.sh
@@ -53,6 +53,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/debian12-32bit/packages.yml b/bootstrap/generated-dists/debian12-32bit/packages.yml
index c7756de7cbd..61058195154 100644
--- a/bootstrap/generated-dists/debian12-32bit/packages.yml
+++ b/bootstrap/generated-dists/debian12-32bit/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/debian12/bootstrap.sh b/bootstrap/generated-dists/debian12/bootstrap.sh
index 58d3866fdf2..ba78ddddc12 100755
--- a/bootstrap/generated-dists/debian12/bootstrap.sh
+++ b/bootstrap/generated-dists/debian12/bootstrap.sh
@@ -53,6 +53,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/debian12/packages.yml b/bootstrap/generated-dists/debian12/packages.yml
index c7756de7cbd..61058195154 100644
--- a/bootstrap/generated-dists/debian12/packages.yml
+++ b/bootstrap/generated-dists/debian12/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/fedora41/bootstrap.sh b/bootstrap/generated-dists/fedora41/bootstrap.sh
index ae7e1a5d891..b985b14d754 100755
--- a/bootstrap/generated-dists/fedora41/bootstrap.sh
+++ b/bootstrap/generated-dists/fedora41/bootstrap.sh
@@ -61,6 +61,7 @@ dnf install -y \
     libbsd-devel \
     libcap-devel \
     libcephfs-devel \
+    libevent-devel \
     libicu-devel \
     libpcap-devel \
     libtasn1-devel \
diff --git a/bootstrap/generated-dists/fedora41/packages.yml b/bootstrap/generated-dists/fedora41/packages.yml
index 427b236d394..930e0a98652 100644
--- a/bootstrap/generated-dists/fedora41/packages.yml
+++ b/bootstrap/generated-dists/fedora41/packages.yml
@@ -50,6 +50,7 @@ packages:
   - libbsd-devel
   - libcap-devel
   - libcephfs-devel
+  - libevent-devel
   - libicu-devel
   - libpcap-devel
   - libtasn1-devel
diff --git a/bootstrap/generated-dists/opensuse155/bootstrap.sh b/bootstrap/generated-dists/opensuse155/bootstrap.sh
index f94b52bb244..bcf8fbca90b 100755
--- a/bootstrap/generated-dists/opensuse155/bootstrap.sh
+++ b/bootstrap/generated-dists/opensuse155/bootstrap.sh
@@ -58,6 +58,7 @@ zypper --non-interactive install \
     libbsd-devel \
     libcap-devel \
     libcephfs-devel \
+    libevent-devel \
     libicu-devel \
     libjansson-devel \
     libpcap-devel \
diff --git a/bootstrap/generated-dists/opensuse155/packages.yml b/bootstrap/generated-dists/opensuse155/packages.yml
index 866d4d376b0..6bb490ce5be 100644
--- a/bootstrap/generated-dists/opensuse155/packages.yml
+++ b/bootstrap/generated-dists/opensuse155/packages.yml
@@ -46,6 +46,7 @@ packages:
   - libbsd-devel
   - libcap-devel
   - libcephfs-devel
+  - libevent-devel
   - libicu-devel
   - libjansson-devel
   - libpcap-devel
diff --git a/bootstrap/generated-dists/rocky8/bootstrap.sh b/bootstrap/generated-dists/rocky8/bootstrap.sh
index 9faf66829e2..87d62646820 100755
--- a/bootstrap/generated-dists/rocky8/bootstrap.sh
+++ b/bootstrap/generated-dists/rocky8/bootstrap.sh
@@ -71,6 +71,7 @@ yum install -y \
     libbsd-devel \
     libcap-devel \
     libcephfs-devel \
+    libevent-devel \
     libicu-devel \
     libpcap-devel \
     libtasn1-devel \
diff --git a/bootstrap/generated-dists/rocky8/packages.yml b/bootstrap/generated-dists/rocky8/packages.yml
index 7b7ed9e6967..b7ee2c54c4a 100644
--- a/bootstrap/generated-dists/rocky8/packages.yml
+++ b/bootstrap/generated-dists/rocky8/packages.yml
@@ -47,6 +47,7 @@ packages:
   - libbsd-devel
   - libcap-devel
   - libcephfs-devel
+  - libevent-devel
   - libicu-devel
   - libpcap-devel
   - libtasn1-devel
diff --git a/bootstrap/generated-dists/ubuntu1804-32bit/bootstrap.sh b/bootstrap/generated-dists/ubuntu1804-32bit/bootstrap.sh
index 53d82f3bb79..ac716b38593 100755
--- a/bootstrap/generated-dists/ubuntu1804-32bit/bootstrap.sh
+++ b/bootstrap/generated-dists/ubuntu1804-32bit/bootstrap.sh
@@ -55,6 +55,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/ubuntu1804-32bit/packages.yml b/bootstrap/generated-dists/ubuntu1804-32bit/packages.yml
index cfa24e50a79..eb8e7ad4053 100644
--- a/bootstrap/generated-dists/ubuntu1804-32bit/packages.yml
+++ b/bootstrap/generated-dists/ubuntu1804-32bit/packages.yml
@@ -44,6 +44,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/ubuntu1804/bootstrap.sh b/bootstrap/generated-dists/ubuntu1804/bootstrap.sh
index 53d82f3bb79..ac716b38593 100755
--- a/bootstrap/generated-dists/ubuntu1804/bootstrap.sh
+++ b/bootstrap/generated-dists/ubuntu1804/bootstrap.sh
@@ -55,6 +55,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/ubuntu1804/packages.yml b/bootstrap/generated-dists/ubuntu1804/packages.yml
index cfa24e50a79..eb8e7ad4053 100644
--- a/bootstrap/generated-dists/ubuntu1804/packages.yml
+++ b/bootstrap/generated-dists/ubuntu1804/packages.yml
@@ -44,6 +44,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/ubuntu2004/bootstrap.sh b/bootstrap/generated-dists/ubuntu2004/bootstrap.sh
index 53d82f3bb79..ac716b38593 100755
--- a/bootstrap/generated-dists/ubuntu2004/bootstrap.sh
+++ b/bootstrap/generated-dists/ubuntu2004/bootstrap.sh
@@ -55,6 +55,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/ubuntu2004/packages.yml b/bootstrap/generated-dists/ubuntu2004/packages.yml
index cfa24e50a79..eb8e7ad4053 100644
--- a/bootstrap/generated-dists/ubuntu2004/packages.yml
+++ b/bootstrap/generated-dists/ubuntu2004/packages.yml
@@ -44,6 +44,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/generated-dists/ubuntu2204/bootstrap.sh b/bootstrap/generated-dists/ubuntu2204/bootstrap.sh
index 0b9fd98c480..669d53ea747 100755
--- a/bootstrap/generated-dists/ubuntu2204/bootstrap.sh
+++ b/bootstrap/generated-dists/ubuntu2204/bootstrap.sh
@@ -55,6 +55,7 @@ apt-get -y install \
     libclang-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libevent-dev \
     libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
diff --git a/bootstrap/generated-dists/ubuntu2204/packages.yml b/bootstrap/generated-dists/ubuntu2204/packages.yml
index 23e416fc1aa..0343ebe0915 100644
--- a/bootstrap/generated-dists/ubuntu2204/packages.yml
+++ b/bootstrap/generated-dists/ubuntu2204/packages.yml
@@ -44,6 +44,7 @@ packages:
   - libclang-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libevent-dev
   - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt
index 56996ed8632..39ed53b31ca 100644
--- a/bootstrap/sha1sum.txt
+++ b/bootstrap/sha1sum.txt
@@ -1 +1 @@
-d20548dec714e202867b593f5e19f3004f7a2457
+26a734ea226b4fd32141ae950af16f75f290645f
diff --git a/docs-xml/manpages/smb_prometheus_endpoint.8.xml b/docs-xml/manpages/smb_prometheus_endpoint.8.xml
new file mode 100644
index 00000000000..cbfa71f4ffd
--- /dev/null
+++ b/docs-xml/manpages/smb_prometheus_endpoint.8.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="smb_prometheus_endpoint.8">
+
+<refmeta>
+	<refentrytitle>smb_prometheus_endpoint</refentrytitle>
+	<manvolnum>8</manvolnum>
+	<refmiscinfo class="source">Samba</refmiscinfo>
+	<refmiscinfo class="manual">System Administration tools</refmiscinfo>
+	<refmiscinfo class="version">&doc.version;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+	<refname>smb_prometheus_endpoint</refname>
+	<refpurpose>Make Samba profiling information available to
+	prometheus.</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+  <cmdsynopsis>
+    <command>smb_prometheus_endpoint</command>
+    <arg choice="opt">-a ADDRESS</arg>
+    <arg choice="opt">-p PORT</arg>
+    <arg>smbprofile.tdb</arg>
+  </cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+	<title>DESCRIPTION</title>
+
+	<para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
+	<manvolnum>8</manvolnum></citerefentry> suite.</para>
+
+	<para>Make the Samba profiling information available to prometheus via http.</para>
+</refsect1>
+
+<refsect1>
+  <title>OPTIONS</title>
+	<variablelist>
+	  <varlistentry>
+	    <term>-a ADDRESS</term>
+	    <listitem>
+	      <para>The address which
+	      <command>smb_prometheus_endpoint</command> shall listen
+	      on, default is 127.0.0.1.</para>
+	    </listitem>
+	  </varlistentry>
+	  <varlistentry>
+	    <term>-p PORT</term>
+	    <listitem>
+	      <para>The port which
+	      <command>smb_prometheus_endpoint</command> shall listen
+	      on, default is port 9922.</para>
+	    </listitem>
+	  </varlistentry>
+	  <varlistentry>
+	    <term>smbprofile.tdb</term>
+	    <listitem>
+	      <para>The full path to the system's smbprofile.tdb where
+	      Samba stores its statistics.</para>
+	    </listitem>
+	  </varlistentry>
+	</variablelist>
+</refsect1>
+
+<refsect1>
+	<title>AUTHOR</title>
+
+	<para>The original Samba software and related utilities
+	were created by Andrew Tridgell. Samba is now developed
+	by the Samba Team as an Open Source project similar
+	to the way the Linux kernel is developed.</para>
+</refsect1>
+
+</refentry>
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 967e18a6596..90f5d57ffc4 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -48,6 +48,7 @@ manpages='''
          manpages/smbstatus.1
          manpages/smbtar.1
          manpages/smbtree.1
+         manpages/smb_prometheus_endpoint.8
          manpages/testparm.1
          manpages/traffic_learner.7
          manpages/traffic_replay.7
diff --git a/script/autobuild.py b/script/autobuild.py
index 8817968d760..0283ec6754b 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -176,7 +176,7 @@ builddirs = {
 }
 
 ctdb_configure_params = " --enable-developer ${PREFIX}"
-samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data"
+samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --with-prometheus-exporter"
 
 # We cannot configure himmelblau on old systems missing openssl 3, with glibc
 # older than version 2.32, or when cargo isn't available.
@@ -879,6 +879,7 @@ tasks = {
          "./configure.developer ${PREFIX} "
          "--with-selftest-prefix=./bin/ab "
          "--with-cluster-support "
+         "--with-prometheus-exporter "
          "--bundled-libraries=!tdb"),
             ("samba-make", "make"),
             ("samba-check", "./bin/smbd --configfile=/dev/null -b | grep CLUSTER_SUPPORT"),
@@ -1039,7 +1040,7 @@ tasks = {
         "sequence": [
         # build the fuzzers (static) via the oss-fuzz script
             ("fuzzers-mkdir-prefix", "mkdir -p ${PREFIX_DIR}"),
-            ("fuzzers-build", "OUT=${PREFIX_DIR} LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer"),
+            ("fuzzers-build", "OUT=${PREFIX_DIR} LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer --with-prometheus-exporter"),
         ],
     },
 
@@ -1118,7 +1119,7 @@ tasks = {
         "sequence": [
             ("random-sleep", random_sleep(300, 900)),
 
-            ("configure", "./configure.developer ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --disable-python --without-ad-dc"),
+            ("configure", "./configure.developer ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --disable-python --without-ad-dc --with-prometheus-exporter"),
             ("make", "make -j"),
             ("find-python", "script/find_python.sh ${PREFIX}"),
             ("test", "make test-nopython"),
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 908fe79cb19..54f007addbe 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -237,3 +237,4 @@ smbcacls = binpath('smbcacls')
 smbcontrol = binpath('smbcontrol')
 smbstatus = binpath('smbstatus')
 timelimit = binpath('timelimit')
+smb_prometheus_endpoint = binpath('smb_prometheus_endpoint')
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 91af220051d..c8d2696884e 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -24,7 +24,10 @@
 #include "replace.h"
 #include <tdb.h>
 #include "lib/util/time.h"
+#include "libcli/smb/smb2_constants.h"
+#include "libcli/util/ntstatus.h"
 
+struct smbd_server_connection;
 struct tevent_context;
 
 #ifdef WITH_PROFILE
@@ -43,6 +46,14 @@ struct tevent_context;
 	SMBPROFILE_STATS_BASIC(set_sec_ctx) \
 	SMBPROFILE_STATS_BASIC(set_root_sec_ctx) \
 	SMBPROFILE_STATS_BASIC(pop_sec_ctx) \
+	SMBPROFILE_STATS_COUNT(num_sessions) \
+	SMBPROFILE_STATS_COUNT(num_tcons) \
+	SMBPROFILE_STATS_COUNT(num_files) \
+	SMBPROFILE_STATS_SECTION_END \
+	\
+	SMBPROFILE_STATS_SECTION_START(global, "Authentication") \
+	SMBPROFILE_STATS_COUNT(authentication) \
+	SMBPROFILE_STATS_COUNT(authentication_failed) \
 	SMBPROFILE_STATS_SECTION_END \
 	\
 	SMBPROFILE_STATS_SECTION_START(syscall, "System Calls") \
@@ -289,7 +300,9 @@ struct smbprofile_stats_bytes_async {
 
 struct smbprofile_stats_iobytes {
 	uint64_t count;		/* number of events */
+	uint64_t failed_count;	/* number of unsuccessful events */
 	uint64_t time;		/* microseconds */
+	uint64_t buckets[10];	/* 1,2,4,...256,Inf msecs */
 	uint64_t idle;		/* idle time compared to 'time' microseconds */
 	uint64_t inbytes;	/* bytes read */


-- 
Samba Shared Repository



More information about the samba-cvs mailing list