[njs] Modules: added debug log for vm cloning and destroying.

Dmitry Volyntsev xeioex at nginx.com
Sat Sep 23 00:39:18 UTC 2023


details:   https://hg.nginx.org/njs/rev/dbb011e433b2
branches:  
changeset: 2206:dbb011e433b2
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Sep 22 13:00:04 2023 -0700
description:
Modules: added debug log for vm cloning and destroying.

diffstat:

 nginx/ngx_http_js_module.c   |  6 ++++++
 nginx/ngx_stream_js_module.c |  6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diffs (46 lines):

diff -r fc98c27d3fc0 -r dbb011e433b2 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Thu Sep 21 12:40:53 2023 -0700
+++ b/nginx/ngx_http_js_module.c	Fri Sep 22 13:00:04 2023 -0700
@@ -1366,6 +1366,9 @@ ngx_http_js_init_vm(ngx_http_request_t *
         return NGX_ERROR;
     }
 
+    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "http js vm clone: %p from: %p", ctx->vm, jlcf->vm);
+
     cln = ngx_pool_cleanup_add(r->pool, 0);
     if (cln == NULL) {
         return NGX_ERROR;
@@ -1425,6 +1428,9 @@ ngx_http_js_cleanup_ctx(void *data)
         ngx_log_error(NGX_LOG_ERR, ctx->log, 0, "pending events");
     }
 
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0, "http js vm destroy: %p",
+                   ctx->vm);
+
     njs_vm_destroy(ctx->vm);
 }
 
diff -r fc98c27d3fc0 -r dbb011e433b2 nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Thu Sep 21 12:40:53 2023 -0700
+++ b/nginx/ngx_stream_js_module.c	Fri Sep 22 13:00:04 2023 -0700
@@ -1030,6 +1030,9 @@ ngx_stream_js_init_vm(ngx_stream_session
         return NGX_ERROR;
     }
 
+    ngx_log_debug2(NGX_LOG_DEBUG_STREAM, s->connection->log, 0,
+                   "stream js vm clone: %p from: %p", ctx->vm, jscf->vm);
+
     cln = ngx_pool_cleanup_add(s->connection->pool, 0);
     if (cln == NULL) {
         return NGX_ERROR;
@@ -1107,6 +1110,9 @@ ngx_stream_js_cleanup(void *data)
         ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, "pending events");
     }
 
+    ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0,
+                   "stream js vm destroy: %p", ctx->vm);
+
     njs_vm_destroy(ctx->vm);
 }
 


More information about the nginx-devel mailing list