procfs: Make g_procfs_entries in the alphabetic order

and option in procfs/Kconfig

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-04-18 02:33:48 +08:00 committed by David Sidrane
parent c6d210289f
commit 4be499a243
3 changed files with 104 additions and 106 deletions

View File

@ -29,29 +29,6 @@ config FS_PROCFS_MAX_TASKS
menu "Exclude individual procfs entries"
config FS_PROCFS_EXCLUDE_PROCESS
bool "Exclude process information"
default DEFAULT_SMALL
---help---
Causes the process information to be excluded from the procfs system.
This will reduce code space, but then giving access to process info
was kinda the whole point of procfs, but hey, whatever.
config FS_PROCFS_EXCLUDE_ENVIRON
bool "Exclude environment information"
default DEFAULT_SMALL
depends on !FS_PROCFS_EXCLUDE_PROCESS
---help---
Causes the environment variable information to be excluded from the
procfs system. This will reduce code space slightly.
config FS_PROCFS_EXCLUDE_MODULE
bool "Exclude module information"
depends on MODULE
default DEFAULT_SMALL
---help---
Causes the module information to be excluded from the procfs system.
config FS_PROCFS_EXCLUDE_BLOCKS
bool "Exclude fs/blocks information"
depends on !DISABLE_MOUNTPOINT
@ -61,6 +38,53 @@ config FS_PROCFS_EXCLUDE_BLOCKS
system. This procfs file provides the text output for the NSH 'df'
command.
config FS_PROCFS_EXCLUDE_CPULOAD
bool "Exclude CPU load"
depends on SCHED_CPULOAD
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_ENVIRON
bool "Exclude environment information"
depends on !FS_PROCFS_EXCLUDE_PROCESS
default DEFAULT_SMALL
---help---
Causes the environment variable information to be excluded from the
procfs system. This will reduce code space slightly.
config FS_PROCFS_EXCLUDE_IOBINFO
bool "Exclude iobinfo"
depends on MM_IOB
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_PROCESS
bool "Exclude process information"
default DEFAULT_SMALL
---help---
Causes the process information to be excluded from the procfs system.
This will reduce code space, but then giving access to process info
was kinda the whole point of procfs, but hey, whatever.
config FS_PROCFS_INCLUDE_PROGMEM
bool "Include prog mem"
depends on ARCH_HAVE_PROGMEM && !FS_PROCFS_EXCLUDE_MEMINFO
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_MEMDUMP
bool "Exclude memdump"
depends on !FS_PROCFS_EXCLUDE_MEMINFO
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_MEMINFO
bool "Exclude meminfo"
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_MODULE
bool "Exclude module information"
depends on MODULE
default DEFAULT_SMALL
---help---
Causes the module information to be excluded from the procfs system.
config FS_PROCFS_EXCLUDE_MOUNT
bool "Exclude fs/mount information"
depends on !DISABLE_MOUNTPOINT
@ -70,50 +94,10 @@ config FS_PROCFS_EXCLUDE_MOUNT
system. This procfs file provides the text output for the NSH 'mount'
command.
config FS_PROCFS_EXCLUDE_USAGE
bool "Exclude fs/usage information"
depends on !DISABLE_MOUNTPOINT
default DEFAULT_SMALL
---help---
Causes the fs usage information to be excluded from the procfs
system. This procfs file provides the text output for the NSH 'df -h'
command.
config FS_PROCFS_EXCLUDE_UPTIME
bool "Exclude uptime"
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_VERSION
bool "Exclude version"
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_CPULOAD
bool "Exclude CPU load"
default DEFAULT_SMALL
depends on SCHED_CPULOAD
config FS_PROCFS_EXCLUDE_MEMINFO
bool "Exclude meminfo"
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_MEMDUMP
bool "Exclude memdump"
default DEFAULT_SMALL
config FS_PROCFS_INCLUDE_PROGMEM
bool "Include prog mem"
default DEFAULT_SMALL
depends on ARCH_HAVE_PROGMEM && !FS_PROCFS_EXCLUDE_MEMINFO
config FS_PROCFS_EXCLUDE_IOBINFO
bool "Exclude iobinfo"
depends on MM_IOB
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_MOUNTS
bool "Exclude mounts"
default DEFAULT_SMALL
depends on !DISABLE_MOUNTPOINT
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_NET
bool "Exclude network"
@ -140,5 +124,22 @@ config FS_PROCFS_EXCLUDE_TCBINFO
depends on DEBUG_TCBINFO
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_UPTIME
bool "Exclude uptime"
default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_USAGE
bool "Exclude fs/usage information"
depends on !DISABLE_MOUNTPOINT
default DEFAULT_SMALL
---help---
Causes the fs usage information to be excluded from the procfs
system. This procfs file provides the text output for the NSH 'df -h'
command.
config FS_PROCFS_EXCLUDE_VERSION
bool "Exclude version"
default DEFAULT_SMALL
endmenu # Exclude individual procfs entries
endif # FS_PROCFS

View File

@ -21,13 +21,10 @@
ifeq ($(CONFIG_FS_PROCFS),y)
# Files required for procfs file system support
CSRCS += fs_procfs.c fs_procfsutil.c fs_procfsproc.c fs_procfsuptime.c
CSRCS += fs_procfscpuload.c fs_procfsmeminfo.c fs_procfsiobinfo.c
CSRCS += fs_procfsversion.c fs_procfstcbinfo.c
ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
CSRCS += fs_procfscritmon.c
endif
CSRCS += fs_procfs.c fs_procfscpuload.c fs_procfscritmon.c
CSRCS += fs_procfsiobinfo.c fs_procfsmeminfo.c fs_procfsproc.c
CSRCS += fs_procfstcbinfo.c fs_procfsuptime.c fs_procfsutil.c
CSRCS += fs_procfsversion.c
# Include procfs build support

View File

@ -52,19 +52,19 @@
* External Definitions
****************************************************************************/
extern const struct procfs_operations g_proc_operations;
extern const struct procfs_operations g_pm_operations;
extern const struct procfs_operations g_irq_operations;
extern const struct procfs_operations g_cpuload_operations;
extern const struct procfs_operations g_critmon_operations;
extern const struct procfs_operations g_iobinfo_operations;
extern const struct procfs_operations g_irq_operations;
extern const struct procfs_operations g_meminfo_operations;
extern const struct procfs_operations g_memdump_operations;
extern const struct procfs_operations g_mempool_operations;
extern const struct procfs_operations g_iobinfo_operations;
extern const struct procfs_operations g_module_operations;
extern const struct procfs_operations g_pm_operations;
extern const struct procfs_operations g_proc_operations;
extern const struct procfs_operations g_tcbinfo_operations;
extern const struct procfs_operations g_uptime_operations;
extern const struct procfs_operations g_version_operations;
extern const struct procfs_operations g_tcbinfo_operations;
/* This is not good. These are implemented in other sub-systems. Having to
* deal with them here is not a good coupling. What is really needed is a
@ -72,10 +72,10 @@ extern const struct procfs_operations g_tcbinfo_operations;
* configuration.
*/
extern const struct procfs_operations g_mount_operations;
extern const struct procfs_operations g_net_operations;
extern const struct procfs_operations g_netroute_operations;
extern const struct procfs_operations g_part_operations;
extern const struct procfs_operations g_mount_operations;
extern const struct procfs_operations g_smartfs_operations;
/****************************************************************************
@ -103,29 +103,6 @@ static const struct procfs_entry_s g_procfs_entries[] =
{ "critmon", &g_critmon_operations, PROCFS_FILE_TYPE },
#endif
#ifdef CONFIG_SCHED_IRQMONITOR
{ "irqs", &g_irq_operations, PROCFS_FILE_TYPE },
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMINFO
{ "meminfo", &g_meminfo_operations, PROCFS_FILE_TYPE },
# ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP
{ "memdump", &g_memdump_operations, PROCFS_FILE_TYPE },
# endif
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL
{ "mempool", &g_mempool_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_MM_IOB) && !defined(CONFIG_FS_PROCFS_EXCLUDE_IOBINFO)
{ "iobinfo", &g_iobinfo_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_MODULE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
{ "modules", &g_module_operations, PROCFS_FILE_TYPE },
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_BLOCKS
{ "fs/blocks", &g_mount_operations, PROCFS_FILE_TYPE },
#endif
@ -134,12 +111,35 @@ static const struct procfs_entry_s g_procfs_entries[] =
{ "fs/mount", &g_mount_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_FS_SMARTFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS)
{ "fs/smartfs**", &g_smartfs_operations, PROCFS_UNKOWN_TYPE },
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_USAGE
{ "fs/usage", &g_mount_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_FS_SMARTFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS)
{ "fs/smartfs**", &g_smartfs_operations, PROCFS_UNKOWN_TYPE },
#if defined(CONFIG_MM_IOB) && !defined(CONFIG_FS_PROCFS_EXCLUDE_IOBINFO)
{ "iobinfo", &g_iobinfo_operations, PROCFS_FILE_TYPE },
#endif
#ifdef CONFIG_SCHED_IRQMONITOR
{ "irqs", &g_irq_operations, PROCFS_FILE_TYPE },
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMINFO
# ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP
{ "memdump", &g_memdump_operations, PROCFS_FILE_TYPE },
# endif
{ "meminfo", &g_meminfo_operations, PROCFS_FILE_TYPE },
#endif
#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL
{ "mempool", &g_mempool_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_MODULE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
{ "modules", &g_module_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_NET) && !defined(CONFIG_FS_PROCFS_EXCLUDE_NET)
@ -165,6 +165,10 @@ static const struct procfs_entry_s g_procfs_entries[] =
{ "self/**", &g_proc_operations, PROCFS_UNKOWN_TYPE },
#endif
#if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
{ "tcbinfo", &g_tcbinfo_operations, PROCFS_FILE_TYPE },
#endif
#if !defined(CONFIG_FS_PROCFS_EXCLUDE_UPTIME)
{ "uptime", &g_uptime_operations, PROCFS_FILE_TYPE },
#endif
@ -172,10 +176,6 @@ static const struct procfs_entry_s g_procfs_entries[] =
#if !defined(CONFIG_FS_PROCFS_EXCLUDE_VERSION)
{ "version", &g_version_operations, PROCFS_FILE_TYPE },
#endif
#if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
{ "tcbinfo", &g_tcbinfo_operations, PROCFS_FILE_TYPE },
#endif
};
#ifdef CONFIG_FS_PROCFS_REGISTER