Skip to content

make: adapt develhelp for all examples#8081

Merged
cladmi merged 1 commit intoRIOT-OS:masterfrom
smlng:enh/examples/develhelp
Nov 28, 2017
Merged

make: adapt develhelp for all examples#8081
cladmi merged 1 commit intoRIOT-OS:masterfrom
smlng:enh/examples/develhelp

Conversation

@smlng
Copy link
Copy Markdown
Member

@smlng smlng commented Nov 17, 2017

factored out from #8029, disable develhelp for all examples

@smlng smlng added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: waiting for other PR State: The PR requires another PR to be merged first labels Nov 17, 2017
@smlng smlng requested a review from kaspar030 November 17, 2017 18:00
@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 17, 2017

Please remember to wait with this, until #7925 is merged.

@kaspar030
Copy link
Copy Markdown
Contributor

disable develhelp for all examples

Why? This would disable all assertions, ps, extra checks, ...

@smlng smlng force-pushed the enh/examples/develhelp branch from 5377a40 to 4303d17 Compare November 18, 2017 08:50
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 18, 2017

@kaspar030 IMHO the examples are more like productive applications, hence DEVELHELP would be off by default, but can still be enabled (e.g. in CI) when needed. On the other hand, for tests as in #8080 DEVELHELP is on by default, because those are tests and assertions etc should be checked.

@kaspar030
Copy link
Copy Markdown
Contributor

IMHO the examples are more like productive applications, hence DEVELHELP would be off by default

Why? What's there to gain?

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 19, 2017

Why? What's there to gain?

Could ask the same the other way around 😉 Or: what exactly is lost by disabling DEVELHELP for examples, it can be enabled (as said) easily e.g. for CI builds and any prevalent issues should be discovered/pop up compiling/running the tests not examples.

If the examples (should) target RIOT beginners and users (not only developers), I don't see the point of having DEVELHELP enabled by default. It increased binary sizes and may through rather pedantic compiler errors (not necessarily causing any runtime issues) which only irritate inexperienced users and frustrate them right at the start.

@bergzand
Copy link
Copy Markdown
Member

First thing that comes to mind is the shorted output of the ps command. I think that the expanded output including the process names gives some valuable insight in the threading of RIOT for newcomers. I dont know if it can be enabled by a separate flag, but I think that is one of the valuable "features" of enabling DEVELHELP.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 19, 2017

First thing that comes to mind is the shorted output of the ps command.

Agreed, but then IMHO it would be better to change/enhance the default output of the ps command, for instance by having thread names - while something like stack size and so on is still only available with DEVELHELP.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 19, 2017

I prefer DEVELHELP to be activated for most examples as well. Yes, examples can be seen as production code, but on the other hand they can also be seen as examples which help newcomers understand RIOT. As they should be as helpful as possible and that would be lost by deactivating DEVELHELP

First thing that comes to mind is the shorted output of the ps command.

Agreed, but then IMHO it would be better to change/enhance the default output of the ps command, for instance by having thread names - while something like stack size and so on is still only available with DEVELHELP.

Uhmm... Thread names are the epitome of a development helper. They serve no other purpose other than giving the developer a hint which thread is which. So activating them for anything else but DEVELHELP seems like a waste of memory to me, when it comes to production systems.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 19, 2017

Okay, to ease things (for now) I let DEVELHELP state unchanged for examples, i.e., leave as is: on for some off for other examples. We may change this later on.

Regarding ps output: what good is this command without thread names to anyone (user or developer)? Or what's its purpose for non-developers and its limited output (without DEVELHELP) anyway? But that is another discussion, unrelated here.

TL;DR: I revert my changes, and leave state of DEVELHELP (on/off) for examples as is now.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 19, 2017

Regarding ps output: what good is this command without thread names to anyone (user or developer)? Or what's its purpose for non-developers and its limited output (without DEVELHELP) anyway? But that is another discussion, unrelated here.

Seeing what state a thread is in. Very helpful if you run into a deadlock ;-).

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 19, 2017

Also not having no names doesn't mean you can't identify which thread is which (there is still the PID). It's just easier with names.

@smlng smlng force-pushed the enh/examples/develhelp branch from 4303d17 to 1060616 Compare November 19, 2017 13:12
@smlng smlng changed the title make: disable develhelp for all examples make: adapt develhelp for all examples Nov 19, 2017
Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK.

# which is not needed in a production environment but helps in the
# development process:
DEVELHELP ?= 1
DEVELHELP ?= 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: the comment doesn't make sense if the line says ?=0. Feel free to change the line to #DEVELHELP ?= 1

@jnohlgard
Copy link
Copy Markdown
Member

I agree with Martine and Kaspar, for newcomers the DEVELHELP switch should be on by default.

Regarding ps without DEVELHELP:
I sometimes call the ps function directly from GDB when I run into a hardfault or other bad situation, it's better to get some output without thread names than nothing, though it was more useful before the RIOT support was updated for openocd (http://openocd.zylin.com/#/c/4256/, please try it and add your code reviews to their tracker so it can be merged into master!), now the info threads command provides some of the same information.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 27, 2017

GNRC embargo is lifted. When this is ACK'd it may be merged

@smlng smlng removed the State: waiting for other PR State: The PR requires another PR to be merged first label Nov 28, 2017
@smlng smlng force-pushed the enh/examples/develhelp branch from 43ad593 to da5ff45 Compare November 28, 2017 09:46
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 28, 2017

rebased and squashed

@smlng smlng added the Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties label Nov 28, 2017
# which is not needed in a production environment but helps in the
# development process:
#CFLAGS += -DDEVELHELP
DEVELHELP ?= 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only problem here is the same as kaspaar, but it is not shown as he already ACKed

Nitpick: the comment doesn't make sense if the line says ?=0. Feel free to change the line to #DEVELHELP ?= 1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah right, missed to adapt that one

Copy link
Copy Markdown
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

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

I will ACK after this small fix.

@smlng smlng force-pushed the enh/examples/develhelp branch from da5ff45 to 9376acd Compare November 28, 2017 18:25
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 28, 2017

@cladmi adapted comment

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Nov 28, 2017

Fixing and amending commit in the same one, its harder to read… (just kidding :D)

@cladmi cladmi merged commit 9c25478 into RIOT-OS:master Nov 28, 2017
@aabadie aabadie added this to the Release 2018.01 milestone Jan 18, 2018
@smlng smlng deleted the enh/examples/develhelp branch February 6, 2018 19:42
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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants