-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono] Make mono_inst_name less misleading #91042
[mono] Make mono_inst_name less misleading #91042
Conversation
LGTM - we'll have to wait for another review too. |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
@sayeedkhannabil I ran the |
@ivanpovazan I am looking into the build failures. Is it possible to have a 15 minute chat about the runtime-extra-platforms errors? I am new to automated testing. If you can give me some guideline about this, it would be really great for me. |
Sure, you can reach me out on Discord. My Discord ID is: |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
After our offline discussion I reran the failing pipeline since it expired and logs were removed from AzDO. To reach the link I posted above by yourself, you can follow these steps:
The error indicates there is an issue around Let me know if you need any help or/and if you have any additional questions with resolving the CI/CD errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple changes that need to be fixed, though I'm still wondering why we don't instead change mono_inst_name
to return the opcode number as a string in the DISABLE_LOGGING case so we don't need to change any callers
So one problem with changing I took a look, and So what about doing something like this: make a new printf specifier macro that is // in mini.h
#ifndef DISABLE_LOGGING
#define M_PRI_INST "%s"
const char * mono_inst_name(int opcode);
#else
#define M_PRI_INST "%d"
static inline int
mono_inst_name(int opcode)
{
return opcode;
}
#endif and then for call sites, change them like this: - g_assertf (op >= 0 && op < OP_LAST, "unknown opcode %s in function %s", mono_inst_name (op), __FUNCTION__);
+ g_assertf (op >= 0 && op < OP_LAST, "unknown opcode " M_PRI_INST " in function %s", mono_inst_name (op), __FUNCTION__); That way we still get useful assertions or warnings, but if we disabled logging we'll just get a number instead of the opcode mnemonic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach!
Fixes dotnet#83545 Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com> Co-authored-by: Steve Pfister <stpfiste@microsoft.com> Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Fixes #83545