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

Makefile.include: enable verbose asserts with DEVELHELP=2 #16864

Closed
wants to merge 1 commit into from

Conversation

benpicco
Copy link
Contributor

Contribution description

Verbose asserts can be useful, but I always forget how to enable them.
To ease use, add a second level to the DEVELHELP option that can be used to enable more 'expensive' helpers.

Testing procedure

Issues/PRs references

Verbose asserts can be useful, but I always forget how to enable them.
To ease use, add a second level to the `DEVELHELP` option that can be
used to enable more 'expensive' helpers.
@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Area: sys Area: System Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Sep 16, 2021
@benpicco benpicco added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Sep 16, 2021
@kaspar030
Copy link
Contributor

My gut feeling is that it is not a good idea to change DEVELHELP values from (0,1) to (0,1,2).

@chrysn
Copy link
Member

chrysn commented Sep 17, 2021

Just for context, is the intention that DEVELHELP=2 would enable DEBUG_ASSERT_VERBOSE? I find that easier to understand than overloading DEVELHELP which already does a lot of things.

As for discoverability, I see potential for enhancement -- maybe DEBUG_ASSERT_VERBOSE could be grouped in the docs in the utilities group next to DEVELHELP? Then it'd show up right next when looking up what DEVELHELP is doing.

@benpicco
Copy link
Contributor Author

I thought it might be similar to how some tools have multiple levels of verbosity -v, -vv, …

Comment on lines +294 to +296
ifeq (2, $(DEVELHELP))
CFLAGS += -DDEBUG_ASSERT_VERBOSE
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

How about as a first step add

Suggested change
ifeq (2, $(DEVELHELP))
CFLAGS += -DDEBUG_ASSERT_VERBOSE
endif
DEBUG_ASSERT_VERBOSE ?=0
ifeq ($(DEBUG_ASSERT_VERBOSE),1)
CFLAGS += -DDEBUG_ASSERT_VERBOSE
endif

Copy link
Member

Choose a reason for hiding this comment

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

That would already be quite helpful. Maybe even a shorter name, e.g. VERBOSE_ASSERT or ASSERT_VERBOSE, as this is often typed by hand?

@benpicco
Copy link
Contributor Author

closed in favor of #16884

@benpicco benpicco closed this Sep 26, 2021
@benpicco benpicco deleted the DEVELHELP-2 branch September 26, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Area: sys Area: System Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants