mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 07:43:33 +08:00
print_load:Support NuttX Dynamic FDs
This commit is contained in:
committed by
Daniel Agar
parent
ec61512cdf
commit
4353d0faf3
@@ -222,19 +222,16 @@ void print_load_buffer(char *buffer, int buffer_length, print_load_callback_f cb
|
|||||||
uint8_t tcb_sched_priority = system_load.tasks[i].tcb->sched_priority;
|
uint8_t tcb_sched_priority = system_load.tasks[i].tcb->sched_priority;
|
||||||
|
|
||||||
unsigned int tcb_num_used_fds = 0; // number of used file descriptors
|
unsigned int tcb_num_used_fds = 0; // number of used file descriptors
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
struct filelist *filelist = &system_load.tasks[i].tcb->group->tg_filelist;
|
||||||
FAR struct task_group_s *group = system_load.tasks[i].tcb->group;
|
|
||||||
|
|
||||||
if (group) {
|
for (int fdr = 0; fdr < filelist->fl_rows; fdr++) {
|
||||||
for (int fd_index = 0; fd_index < CONFIG_NFILE_DESCRIPTORS; ++fd_index) {
|
for (int fdc = 0; fdc < CONFIG_NFILE_DESCRIPTORS_PER_BLOCK; fdc++) {
|
||||||
if (group->tg_filelist.fl_files[fd_index].f_inode) {
|
if (filelist->fl_files[fdr][fdc].f_inode) {
|
||||||
++tcb_num_used_fds;
|
++tcb_num_used_fds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sched_unlock();
|
sched_unlock();
|
||||||
|
|
||||||
switch (tcb_task_state) {
|
switch (tcb_task_state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user