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

lib/ukdebug: Add LVLC_THREAD macro #929

Conversation

StefanJum
Copy link
Member

If LIBUKDEBUG_PRINT_THREAD is selected in the configuration menu and LIBUKDEBUG_ANSI_COLOR is not, a build error is thrown because the LVLC_THREAD macro is not set.

Fix this by setting the macro to an empty string if LIBUKDEBUG_ANSI_COLOR is not set.

You can replicate the crash by enabling ukdebug -> Show thread identifier and making sure ukdebug -> Colored output is not selected in the menuconfig.

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

If `LIBUKDEBUG_PRINT_THREAD` is selected in the configuration menu and
`LIBUKDEBUG_ANSI_COLOR` is not, a build error is thrown because the
`LVLC_THREAD` macro is not set.

Fix this by setting the macro to an empty string if `LIBUKDEBUG_ANSI_COLOR`
is not set.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
@StefanJum StefanJum requested a review from a team as a code owner June 4, 2023 19:05
@StefanJum StefanJum requested review from Starnox and removed request for a team June 4, 2023 19:05
@StefanJum StefanJum added lib/ukdebug lang/c Issues or PRs to do with C/C++ bug/compile-time Bug occurs during compile-time bug/fix This PR fixes a bug labels Jun 4, 2023
@unikraft-bot unikraft-bot added the area/lib Internal Unikraft Microlibrary label Jun 4, 2023
@unikraft-bot
Copy link
Member

Checkpatch passed

Beep boop! I ran Unikraft's checkpatch.pl support script on your pull request and it all looks good!

SHA commit checkpatch
2ece76c lib/ukdebug: Add `LVLC_THREAD` macro

Copy link
Contributor

@Starnox Starnox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected!

Reviewed-by: Eduard-Florin Mihailescu mihailescu.eduard@gmail.com

Copy link
Contributor

@mariasfiraiala mariasfiraiala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, what a pity @StefanJum found this first...

Reviewed-by: Maria Sfiraiala maria.sfiraiala@gmail.com

@mariasfiraiala
Copy link
Contributor

@razvand Let's merge this long awaited PR!

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

@unikraft-bot unikraft-bot added the ci/merged Merged by CI label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary bug/compile-time Bug occurs during compile-time bug/fix This PR fixes a bug ci/merged Merged by CI lang/c Issues or PRs to do with C/C++ lib/ukdebug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants