]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move debug "Running foo bar { } from file baz" developer/alandekok master
authorAlan T. DeKok <aland@freeradius.org>
Tue, 4 Aug 2026 20:16:20 +0000 (16:16 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 4 Aug 2026 20:24:44 +0000 (16:24 -0400)
to the main interpreter loop, which cleans up the debug output
a bit, and makes it easier to parse

src/lib/eap/base.c
src/lib/server/process.h
src/lib/unlang/call.c
src/lib/unlang/compile.c
src/lib/unlang/interpret.c
src/lib/unlang/unlang_priv.h
src/process/radius/base.c
src/process/tacacs/base.c

index 0f97e3b161035d76ad87fb281529b1a9f21dac6d..54c7c3a597c9f37181e7072eccfad7f7762e8c31 100644 (file)
@@ -389,7 +389,7 @@ unlang_action_t eap_virtual_server(request_t *request, eap_session_t *eap_sessio
        fr_assert(request->parent);
        fr_assert(virtual_server);
 
        fr_assert(request->parent);
        fr_assert(virtual_server);
 
-       RDEBUG2("Running request through virtual server \"%s\"", cf_section_name2(virtual_server_cs(virtual_server)));
+       RIDEBUG("Running virtual_server = %s", cf_section_name2(virtual_server_cs(virtual_server)));
 
        /*
         *      Re-present the previously stored child's session state if there is one
 
        /*
         *      Re-present the previously stored child's session state if there is one
index 8a97555ce917048f57b1b76364923f0797957b7f..c333cb62d6046623b3eed23a252c63184306677c 100644 (file)
@@ -253,8 +253,6 @@ RECV(generic)
                RETURN_UNLANG_FAIL;
        }
 
                RETURN_UNLANG_FAIL;
        }
 
-
-       if (cs) RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs));
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, state->default_rcode, state->resume,
                                              NULL, 0, mctx->rctx);
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, state->default_rcode, state->resume,
                                              NULL, 0, mctx->rctx);
@@ -361,9 +359,7 @@ SEND_NO_RESULT(generic)
                MEM(0);
        }
 
                MEM(0);
        }
 
-       if (cs) {
-               RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs));
-       } else {
+       if (!cs) {
                char const *name;
 
                name = fr_dict_enum_name_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
                char const *name;
 
                name = fr_dict_enum_name_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
@@ -514,7 +510,6 @@ RESUME(new_client)
                return UNLANG_ACTION_CALCULATE_RESULT;
        }
 
                return UNLANG_ACTION_CALCULATE_RESULT;
        }
 
-       RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs));
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_FAIL, resume_new_client_done,
                                              NULL, 0, mctx->rctx);
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_FAIL, resume_new_client_done,
                                              NULL, 0, mctx->rctx);
@@ -532,7 +527,6 @@ static inline unlang_action_t new_client(UNUSED unlang_result_t *p_result, modul
        fr_assert(inst->sections.new_client != NULL);
        cs = inst->sections.new_client;
 
        fr_assert(inst->sections.new_client != NULL);
        cs = inst->sections.new_client;
 
-       RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs));
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_FAIL, resume_new_client,
                                              NULL, 0, mctx->rctx);
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_FAIL, resume_new_client,
                                              NULL, 0, mctx->rctx);
index 956e32ff8ebf7038659108d32e7c9a58d03828a2..33257708ce45d13dbfe417ce8a9c6dd7f4660d41 100644 (file)
@@ -193,6 +193,7 @@ unlang_action_t unlang_call_push(unlang_result_t *p_result, request_t *request,
                                .debug_name = name,
                                .ci = CF_TO_ITEM(server_cs),
                                .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
                                .debug_name = name,
                                .ci = CF_TO_ITEM(server_cs),
                                .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
+                               .add_filename = true,
                        },
 
                        .cs = server_cs,
                        },
 
                        .cs = server_cs,
index 019248df928538ee382984a5b1588af412d3c82e..5db0ed83181a365af2981a4f964fd795f811dcb2 100644 (file)
@@ -2241,6 +2241,7 @@ int unlang_compile(virtual_server_t const *vs,
         */
        cf_data_add(cs, c, NULL, false);
        cf_item_mark_parsed(cs);
         */
        cf_data_add(cs, c, NULL, false);
        cf_item_mark_parsed(cs);
+       c->add_filename = true;
        if (instruction) *instruction = c;
 
        return 0;
        if (instruction) *instruction = c;
 
        return 0;
index e8adb97ca81464a0766d58893cc1f11833130692..2f77e2585ca872a009f390f7462be0ba979d46a6 100644 (file)
@@ -1125,7 +1125,11 @@ unlang_frame_action_t frame_eval(request_t *request, unlang_stack_frame_t *frame
                 */
                if (!is_repeatable(frame)) {
                        if (has_debug_braces(frame)) {
                 */
                if (!is_repeatable(frame)) {
                        if (has_debug_braces(frame)) {
-                               RDEBUG2("%s {", instruction->debug_name);
+                               if (unlikely(instruction->add_filename)) {
+                                       RDEBUG2("%s { # from file %s", instruction->debug_name, cf_filename(instruction->ci));
+                               } else {
+                                       RDEBUG2("%s {", instruction->debug_name);
+                               }
                                RINDENT();
                        }
                /*
                                RINDENT();
                        }
                /*
index ca46610485a4fdfbc51cb267847cec97ff3c8344..705cd70647da95d7f4b682bc9096911833b06371 100644 (file)
@@ -139,6 +139,7 @@ struct unlang_s {
        char const              *debug_name;    //!< Printed in log messages when the node is executed.
        unlang_type_t           type;           //!< The specialisation of this node.
        bool                    closed;         //!< whether or not this section is closed to new statements
        char const              *debug_name;    //!< Printed in log messages when the node is executed.
        unlang_type_t           type;           //!< The specialisation of this node.
        bool                    closed;         //!< whether or not this section is closed to new statements
+       bool                    add_filename;   //!< add the filename when printing in debug mode
        CONF_ITEM               *ci;            //!< used to generate this item
        unsigned int            number;         //!< unique node number
        unlang_mod_actions_t    actions;        //!< Priorities, etc. for the various return codes.
        CONF_ITEM               *ci;            //!< used to generate this item
        unsigned int            number;         //!< unique node number
        unlang_mod_actions_t    actions;        //!< Priorities, etc. for the various return codes.
index c8144d98bc9839a229fd915f42094296010f4a6a..96c1be51e0376168b63c2f04fb7511210e6c4308 100644 (file)
@@ -367,7 +367,6 @@ RESUME(access_request)
         *
         *      And continue with sending the generic reply.
         */
         *
         *      And continue with sending the generic reply.
         */
-       RDEBUG("Running 'authenticate %s' from file %s", cf_section_name2(cs), cf_filename(cs));
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_NOOP, resume_auth_type,
                                              NULL, 0, mctx->rctx);
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_NOOP, resume_auth_type,
                                              NULL, 0, mctx->rctx);
@@ -718,8 +717,6 @@ static unlang_action_t mod_process(unlang_result_t *p_result, module_ctx_t const
                RETURN_UNLANG_FAIL;
        }
 
                RETURN_UNLANG_FAIL;
        }
 
-       LOG_PACKET_DEBUG(request, request->packet, &request->request_pairs, fr_radius_packet_name, true, (request->packet->id >= 0));
-
        if (unlikely(request_is_dynamic_client(request))) {
                return new_client(p_result, mctx, request);
        }
        if (unlikely(request_is_dynamic_client(request))) {
                return new_client(p_result, mctx, request);
        }
index 498889a31cd7e124169ba3051ccc052fd62e95d7..9915a48c351ba3282b800186351ee2317526d2b4 100644 (file)
@@ -541,7 +541,6 @@ RESUME(auth_start)
         *
         *      And continue with sending the generic reply.
         */
         *
         *      And continue with sending the generic reply.
         */
-       RDEBUG("Running 'authenticate %s' from file %s", cf_section_name2(cs), cf_filename(cs));
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_NOOP, resume_auth_type,
                                              NULL, 0, mctx->rctx);
        return unlang_module_yield_to_section(RESULT_P, request,
                                              cs, RLM_MODULE_NOOP, resume_auth_type,
                                              NULL, 0, mctx->rctx);