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

listener print strings #12114

Merged
merged 2 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msg/log_message.msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
uint64 timestamp # time since system start (microseconds)

uint8 severity # log level (same as in the linux kernel, starting with 0)
uint8[127] text
char[127] text
2 changes: 1 addition & 1 deletion msg/mavlink_log.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
uint64 timestamp # time since system start (microseconds)

uint8[50] text
char[50] text
uint8 severity # log level (same as in the linux kernel, starting with 0)
2 changes: 1 addition & 1 deletion msg/qshell_req.msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
uint64 timestamp # time since system start (microseconds)
uint8[100] cmd
char[100] cmd
uint32 MAX_STRLEN = 100
uint32 strlen
uint32 sequence
4 changes: 1 addition & 3 deletions msg/task_stack_info.msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

uint64 timestamp # time since system start (microseconds)

uint8 MAX_REPORT_TASK_NAME_LEN = 16

uint16 stack_free
uint8[16] task_name
char[24] task_name
2 changes: 2 additions & 0 deletions msg/tools/px_generate_uorb_topic_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ def print_field(field):
print("char device_id_buffer[80];")
print("device::Device::device_id_print_buffer(device_id_buffer, sizeof(device_id_buffer), message.device_id);")
print("PX4_INFO_RAW(\"\\tdevice_id: %d (%s) \\n\", message.device_id, device_id_buffer);")
elif is_array and 'char' in field.type:
print("PX4_INFO_RAW(\"\\t" + field.name + ": \\\"%." + str(array_length) + "s\\\" \\n\", message." + field.name + ");")
else:
print("PX4_INFO_RAW(\"\\t" + field.name + ": " +
c_type + "\\n\", " + field_name + ");")
Expand Down
10 changes: 6 additions & 4 deletions src/modules/load_mon/load_mon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ void LoadMon::_stack_usage()

task_stack_info_s task_stack_info = {};

if (system_load.tasks[task_index].valid && system_load.tasks[task_index].tcb->pid > 0) {
if (system_load.tasks[task_index].valid && (system_load.tasks[task_index].tcb->pid > 0)) {

stack_free = up_check_tcbstack_remain(system_load.tasks[task_index].tcb);

strncpy((char *)task_stack_info.task_name, system_load.tasks[task_index].tcb->name,
task_stack_info_s::MAX_REPORT_TASK_NAME_LEN);
static_assert(sizeof(task_stack_info.task_name) == CONFIG_TASK_NAME_SIZE,
"task_stack_info.task_name must match NuttX CONFIG_TASK_NAME_SIZE");
strncpy((char *)task_stack_info.task_name, system_load.tasks[task_index].tcb->name, CONFIG_TASK_NAME_SIZE - 1);
task_stack_info.task_name[CONFIG_TASK_NAME_SIZE - 1] = '\0';

#if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct task_group_s *group = system_load.tasks[task_index].tcb->group;
Expand All @@ -269,7 +271,7 @@ void LoadMon::_stack_usage()
fds_free = CONFIG_NFILE_DESCRIPTORS - tcb_num_used_fds;
}

#endif
#endif // CONFIG_NFILE_DESCRIPTORS

checked_task = true;
}
Expand Down