Skip to content
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

logging: dictionary: Support unsigned integers #79228

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

glarsennordic
Copy link
Contributor

Add unsigned integer support to the log parser.

This does not change the underlying log format,
it only allows the log parser to more accurately
read the log format.

Add unsigned integer support to the log parser.

This does not change the underlying log format,
it only allows the log parser to more accurately
read the log format.

Signed-off-by: Georges Oates_Larsen <[email protected]>
@glarsennordic glarsennordic added the DNM This PR should not be merged (Do Not Merge) label Sep 30, 2024
@glarsennordic
Copy link
Contributor Author

Adding DNM until @plskeggs has a chance to review

@glarsennordic
Copy link
Contributor Author

Keeping DNM until I do a little extra testing for good measure

@glarsennordic
Copy link
Contributor Author

I experienced some technical difficulties tonight. I will do the thorough testing tomorrow.

@glarsennordic
Copy link
Contributor Author

I have now tested the following function with a variety of input numbers:

static void test_number(unsigned long long int num) {
	LOG_ERR("TEST c: %c", (char)num);
	LOG_ERR("TEST d: %d", (int)num);
	LOG_ERR("TEST ld: %ld", (long int)num);
	LOG_ERR("TEST lld: %lld", (long long int)num);
	LOG_ERR("TEST i: %i", (int)num);
	LOG_ERR("TEST li: %li", (long int)num);
	LOG_ERR("TEST lli: %lli", (long long int)num);
	LOG_ERR("TEST o: %o", (int)num);
	LOG_ERR("TEST lo: %lo", (long int)num);
	LOG_ERR("TEST llo: %llo", (long long int)num);
	LOG_ERR("TEST u: %u", (unsigned int)num);
	LOG_ERR("TEST lu: %lu", (unsigned long int)num);
	LOG_ERR("TEST llu: %llu", (unsigned long long int)num);
	LOG_ERR("TEST x: %u", (unsigned int)num);
	LOG_ERR("TEST lx: %lu", (unsigned long int)num);
	LOG_ERR("TEST llx: %llu", (unsigned long long int)num);
	LOG_ERR("TEST X: %u", (unsigned int)num);
	LOG_ERR("TEST lX: %lu", (unsigned long int)num);
	LOG_ERR("TEST llX: %llu", (unsigned long long int)num);
}

Both binary logs and UART logs agree on all inputs I've provided with a single exception: Invalid char values are just printed as 0 on the binary logs side.

Which TBH I think is fine.

@glarsennordic glarsennordic removed the DNM This PR should not be merged (Do Not Merge) label Oct 1, 2024
@glarsennordic
Copy link
Contributor Author

So, to be clear, ready for merge

@fabiobaltieri fabiobaltieri merged commit a459921 into zephyrproject-rtos:main Oct 3, 2024
28 of 29 checks passed
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.

6 participants