Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Description

Converts interpreter call stub logging from compile-time #if LOG_COMPUTE_CALL_STUB blocks to runtime-controllable LOG2 facility. These logging statements have proven valuable for debugging but required recompilation to enable.

Changes

  • Added LF2_INTERPRETER = 0x00000002 to LogFacility2 enum
  • Converted 26 logging instances to LOG2((LF2_INTERPRETER, LL_INFO10000, ...))
  • Removed #define LOG_COMPUTE_CALL_STUB 0
  • Updated INVOKE_FUNCTION_PTR and RETURN_TYPE_HANDLER macros

Before

#define LOG_COMPUTE_CALL_STUB 0

PCODE GetGPRegRangeRoutine(int r1, int r2)
{
#if LOG_COMPUTE_CALL_STUB
    printf("GetGPRegRangeRoutine %d %d\n", r1, r2);
#endif
    // ...
}

After

PCODE GetGPRegRangeRoutine(int r1, int r2)
{
    LOG2((LF2_INTERPRETER, LL_INFO10000, "GetGPRegRangeRoutine %d %d\n", r1, r2));
    // ...
}

Logging now enabled via: DOTNET_LogFacility2=0x2 DOTNET_LogLevel=10000

Original prompt

This section details on the original issue you should resolve

<issue_title>[clr-interp] Convert logging in call stubs to use logging facility</issue_title>
<issue_description>I think we should convert it to the LOG mechanism. When I wrote these logging statements, I had thought they would likely be very temporary, but I've used them 4-5 times since then, so they have some ongoing value. However, I'd like to see that work done in a separate PR. We should convert them to using LOG statements probably with a new LF enum value. Probably what should be done is add a new log facility enum in log.h, call it LF2_INTERPRETER. And convert these log statements to use the LOG2 macro, with info level LL_INFO10000 instead of wrapping them in #if LOG_COMPUTE_CALL_STUB blocks.

Originally posted by @davidwrighton in #123142 (comment)
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 16, 2026
Copilot AI and others added 2 commits January 16, 2026 18:55
- Added LF2_INTERPRETER to log facility enum in log.h
- Converted all #if LOG_COMPUTE_CALL_STUB blocks to use LOG2 macro with LF2_INTERPRETER and LL_INFO10000
- Removed #define LOG_COMPUTE_CALL_STUB 0 definition
- Updated all printf statements to use LOG2 instead

Co-authored-by: davidwrighton <[email protected]>
Copilot AI changed the title [WIP] Convert call stubs logging to use logging facility [clr-interp] Convert call stub logging to LOG2 facility Jan 16, 2026
Copilot AI requested a review from davidwrighton January 16, 2026 19:13
@davidwrighton davidwrighton added area-CodeGen-Interpreter-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 16, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[clr-interp] Convert logging in call stubs to use logging facility

2 participants