-
Notifications
You must be signed in to change notification settings - Fork 54
mali: Avoid splitting lines across multiple printf calls #36
base: master
Are you sure you want to change the base?
Conversation
Prevents single lines from being shown as two lines in dmesg output with | ||
newer Linux kernels. | ||
|
||
Signed-off-by: Jonathan Liu <[email protected]> |
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.
Some more details about the issue would be nice here.
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 have added more details about the issue.
Signed-off-by: Jonathan Liu <[email protected]>
Updated commit message in patch with more details. |
|
||
-#define MALI_PRINT(args) do{ \ | ||
- MALI_PRINTF(("Mali: ")); \ | ||
- MALI_PRINTF(args); \ |
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.
MALI_PRINTF seems to be defined to _mali_osk_dbgmsg, which in turn is just a "glorified" printk.
If it's just about printing a prefix, maybe we can just define pr_fmt?
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 is different prefix depending on debug level. Wouldn't that be more complex to handle with pr_fmt?
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.
Hmmm, indeed. As far as I can see, there's three cases: debug (MALI_DEBUG_PRINT), error (MALI_PRINT_ERROR), and "normal" (MALI_PRINT).
Maybe we can just use pr_err, pr_debug and pr_info, with pr_fmt set? That would simplify things a lot, while keeping the log levels.
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.
$ grep -hro 'MALI_DEBUG_PRINT([0-9]' r6p2 | sed 's/[^0-9]*//' | sort -u | xargs
1 2 3 4 5 6 7
Wouldn't we need a big switch statement in MALI_DEBUG_PRINT to call pr_alert, pr_crit, pr_err, pr_warn, pr_notice, pr_info, pr_debug according to the level argument?
The behavior and formatting of the debug level would also be changed by switching to pr_fmt.
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.
Sorry if that wasn't really clear, I meant ignoring the log level in MALI_DEBUG_PRINT and just forward everything to pr_debug.
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.
Changing MALI_PRINT_ERROR to use pr_debug would change the formatting so that all lines include the Mali prefix (using pr_fmt) instead of just the first line.
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.
Is that really an issue though? That would cause an issue only with messages that are not ended by a \n, and as you mentionned already PR_CONT is deprecated now, and grepping through it, I don't really see a lot of them.
Signed-off-by: Jonathan Liu [email protected]