Module: kamailio
Branch: master
Commit: 4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e
URL: 
https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Henning Westerholt <h...@gilawa.com>
Date: 2025-07-16T15:32:35+02:00

misctest: docs: add docs for new lock test function

---

Modified: src/modules/misctest/doc/misctest_functions.xml
Modified: src/modules/misctest/doc/misctest_rpc.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e.patch

---

diff --git a/src/modules/misctest/doc/misctest_functions.xml 
b/src/modules/misctest/doc/misctest_functions.xml
index faf15f0eeaf..812eb4ba3b2 100644
--- a/src/modules/misctest/doc/misctest_functions.xml
+++ b/src/modules/misctest/doc/misctest_functions.xml
@@ -69,4 +69,27 @@ mt_tcp_thread_exec("request $rm uri $ru");
                </example>
        </section>
 
+       <section id="misctest.mt_lock_test">
+               <title>
+                       <function>mt_lock_test(count)</function>
+               </title>
+               <para>
+                       Lock and unlock the global lock count times.
+               </para>
+               <note>
+                       <para>
+                               This is a debugging function for simulating 
locking and unlocking of global lock.
+                               It should not be used in production setups
+                       </para>
+               </note>
+               <example>
+                       <title>
+                               <function>mt_lock_test</function> usage</title>
+                       <programlisting>
+...
+mt_lock_test(100000000);
+...
+                       </programlisting>
+               </example>
+       </section>
 </section>
diff --git a/src/modules/misctest/doc/misctest_rpc.xml 
b/src/modules/misctest/doc/misctest_rpc.xml
index cc80690ada8..93881210998 100644
--- a/src/modules/misctest/doc/misctest_rpc.xml
+++ b/src/modules/misctest/doc/misctest_rpc.xml
@@ -220,4 +220,32 @@
                </example>
        </section>
 
+       <section id="mt.lock_test">
+               <title>mt.lock_test</title>
+               <para>
+    The <em>mt.lock_test</em> RPC command performs a lock/unlock stress test 
using a global lock. It is primarily intended for debugging and performance 
testing of the locking subsystem.
+               </para>
+               <para>
+                       <em>Usage:</em>
+                       <programlisting>
+        kamcmd mt.lock_test [executions]
+                       </programlisting>
+                       <itemizedlist>
+                               <listitem>
+                                       <para>
+                                               <em>executions</em> (optional, 
integer): Number of times to lock and unlock. Default is 1,000,000,000 if not 
specified.</para>
+                               </listitem>
+                       </itemizedlist>
+               </para>
+               <para>
+    If the argument is provided, it must be a positive integer. If more than 
one argument is given, or if the argument is not a positive integer, the 
command will return an error.
+               </para>
+               <para>
+    Example:
+                       <programlisting>
+        kamcmd mt.lock_test 10000
+                       </programlisting>
+    This will perform 10,000 lock/unlock operations.
+               </para>
+       </section>
 </section>

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to