diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index 6d97b91d1e..a95f31847a 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -554,17 +554,6 @@ int file_allocate(FAR struct inode *inode, int oflags, off_t pos, pos, priv, minfd, addref); } -FAR char *file_dump_backtrace(FAR struct file *filep, FAR char *buffer, - size_t len) -{ -#if CONFIG_FS_BACKTRACE > 0 - backtrace_format(buffer, len, filep->f_backtrace, CONFIG_FS_BACKTRACE); -#else - buffer[0] = '\0'; -#endif - return buffer; -} - /**************************************************************************** * Name: files_duplist * diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index f8e570b8a1..1cf2a58f84 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -1246,7 +1246,6 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, { FAR struct task_group_s *group = tcb->group; FAR struct file *filep; - char backtrace[BACKTRACE_BUFFER_SIZE(CONFIG_FS_BACKTRACE)]; char path[PATH_MAX]; size_t remaining; size_t linesize; @@ -1306,22 +1305,23 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, } linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, - "%-3d %-7d %-4x %-9ld %-14s %s\n", + "%-3d %-7d %-4x %-9ld %-14s ", i, filep->f_oflags, INODE_GET_TYPE(filep->f_inode), - (long)filep->f_pos, path, - file_dump_backtrace(filep, - backtrace, - sizeof(backtrace) - ) - ); + (long)filep->f_pos, path); + if (linesize < STATUS_LINELEN) + { +#if CONFIG_FS_BACKTRACE > 0 + linesize += backtrace_format(procfile->line + linesize, + STATUS_LINELEN - linesize, + filep->f_backtrace, + CONFIG_FS_BACKTRACE); +#endif + procfile->line[linesize - 2] = '\n'; + } + copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); - if (linesize + 1 == STATUS_LINELEN) - { - procfile->line[STATUS_LINELEN - 2] = '\n'; - linesize = STATUS_LINELEN; - } totalsize += copysize; buffer += copysize; diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 9a541c4d99..bca2f8dd19 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -164,9 +164,6 @@ #define CH_STAT_ATIME (1 << 3) #define CH_STAT_MTIME (1 << 4) -#define FS_BACKTRACE_WIDTH (sizeof(uintptr_t) * 2 + 3) /* 3: ' 0x' prefix */ -#define FS_BACKTRACE_BUFFER_LEN (CONFIG_FS_BACKTRACE * FS_BACKTRACE_WIDTH + 1) - /**************************************************************************** * Public Type Definitions ****************************************************************************/ @@ -963,20 +960,6 @@ int file_allocate_from_tcb(FAR struct tcb_s *tcb, FAR struct inode *inode, int file_allocate(FAR struct inode *inode, int oflags, off_t pos, FAR void *priv, int minfd, bool addref); -/**************************************************************************** - * Name: file_dump_backtrace - * - * Description: - * Dump the backtrace of the file open to given buffer. - * - * Returned Value: - * Returns the backtrace string, it could be empty. - * - ****************************************************************************/ - -FAR char *file_dump_backtrace(FAR struct file *filep, FAR char *buffer, - size_t len); - /**************************************************************************** * Name: file_dup *