print_load:Support NuttX Dynamic FDs

This commit is contained in:
David Sidrane 2021-06-18 12:00:23 -07:00 committed by Daniel Agar
parent ec61512cdf
commit 4353d0faf3

View File

@ -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;
unsigned int tcb_num_used_fds = 0; // number of used file descriptors
#if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct task_group_s *group = system_load.tasks[i].tcb->group;
struct filelist *filelist = &system_load.tasks[i].tcb->group->tg_filelist;
if (group) {
for (int fd_index = 0; fd_index < CONFIG_NFILE_DESCRIPTORS; ++fd_index) {
if (group->tg_filelist.fl_files[fd_index].f_inode) {
for (int fdr = 0; fdr < filelist->fl_rows; fdr++) {
for (int fdc = 0; fdc < CONFIG_NFILE_DESCRIPTORS_PER_BLOCK; fdc++) {
if (filelist->fl_files[fdr][fdc].f_inode) {
++tcb_num_used_fds;
}
}
}
#endif
sched_unlock();
switch (tcb_task_state) {