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

param command updates (change show default and add status) #11200

Merged
merged 2 commits into from
Jan 18, 2019
Merged

Conversation

dagar
Copy link
Member

@dagar dagar commented Jan 12, 2019

These PR contains 2 changes to the param command.

  1. param show change default to show active/used parameters and add -a to show all (the current default)
  2. Add param status to print status of the param system (current file, memory usage, perf counters)

Example

nsh> param status
INFO  [parameters] summary: 638/1241 (used/total)
INFO  [parameters] file: /fs/mtd_params
INFO  [parameters] storage array: 22/32 elements (512 bytes total)
INFO  [parameters] auto save: on
INFO  [parameters] last auto save: 3.109 seconds ago
param_export: 4 events, 17386us elapsed, 4346.50us avg, min 3598us max 5006us 577.939us rms
param_find: 786 events, 7474us elapsed, 9.51us avg, min 3us max 413us 25.181us rms
param_get: 14164 events, 94875us elapsed, 6.70us avg, min 3us max 1994us 36.532us rms
param_set: 23 events, 347us elapsed, 15.09us avg, min 5us max 27us 6.536us rms

@dagar dagar force-pushed the pr-param_cmd branch 2 times, most recently from d0aee88 to 540f577 Compare January 12, 2019 20:30
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

I'm ok with changing the semantics, but it also changes 'param show -c' (it should not have an effect in practise though).


const hrt_abstime rate_limit = 2000 * 1000; // rate-limit saving to 2 seconds
hrt_abstime last_save_elapsed = hrt_elapsed_time(&last_autosave_timestamp);
static constexpr const hrt_abstime rate_limit = 2_s; // rate-limit saving to 2 seconds
Copy link
Member

Choose a reason for hiding this comment

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

static constexpr const is a bit too much here, no? Does it actually make a difference?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ha, in this case it almost certainly not, but I guess the point would be that it's never going to be worse to make something a compile time constant.

Copy link
Member

Choose a reason for hiding this comment

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

True, I was just thinking that it hurts readability a bit.

src/lib/parameters/parameters.cpp Show resolved Hide resolved
src/systemcmds/param/param.cpp Outdated Show resolved Hide resolved
@dagar
Copy link
Member Author

dagar commented Jan 14, 2019

This will likely have to wait until after #11013 for more flash on fmu-v2.

bkueng
bkueng previously approved these changes Jan 15, 2019
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

Looks good.


const hrt_abstime rate_limit = 2000 * 1000; // rate-limit saving to 2 seconds
hrt_abstime last_save_elapsed = hrt_elapsed_time(&last_autosave_timestamp);
static constexpr const hrt_abstime rate_limit = 2_s; // rate-limit saving to 2 seconds
Copy link
Member

Choose a reason for hiding this comment

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

True, I was just thinking that it hurts readability a bit.

 - add -a option to display all possible system parameters
@dagar
Copy link
Member Author

dagar commented Jan 18, 2019

Rebase on master (should fit in px4_fmu-v2 now).

@dagar dagar merged commit 658d734 into master Jan 18, 2019
@dagar dagar deleted the pr-param_cmd branch January 18, 2019 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants