Commit Graph

311 Commits

Author SHA1 Message Date
Xiang Xiao f01deff80f mm: Rename MM_BACKTRACE_XXX_PID to PID_MM_XXX
and move the definition to malloc.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 09:12:14 +03:00
Xiang Xiao ddbe9eb6ab mm: Rename mm_memdump_s to malltask
align with the naming of mallinfo_task

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 09:12:14 +03:00
zhanghongyu b723e90356 fs: move memset to upper lever for statfs
if struct statfs add new members, such as f_fsid, no additional code
changes are required.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-16 11:10:25 +08:00
anjiahao 7732791cd6 mempool:Add mail_info support for multiple pools
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-06-08 23:56:40 +08:00
chao an fb9b41221d semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
liaoao 6ea3eb3ce2 procfs:add /proc/cpuinfo
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-05-27 03:29:41 +08:00
anjiahao c60dd72a2a Support memdump to realize incremental dump function
Add a new field to record the global on the basis of mm_backtrace.
When using alloc, the field is incremented by 1,
so that the memory usage can be dumped within the range
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-22 12:31:32 +08:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
Xiang Xiao dd631265c4 fs: Add g_ prefix for all global mountpt_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
yinshengkai c418d147fe procfs: add total time running time of task
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-24 19:38:29 +08:00
anjiahao 49cd7a795a mm:change special pid to macro
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-23 23:28:32 +08:00
chao an 13cdffd302 fs/procfs: fix readdir loss last character
nsh> ls proc/fs
/proc/fs: ----> /proc/fs:
 block           blocks
 moun            mount
 usag            usage

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-23 17:13:51 +08:00
Xiang Xiao 4be499a243 procfs: Make g_procfs_entries in the alphabetic order
and option in procfs/Kconfig

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-22 03:33:50 -04:00
Xiang Xiao c6d210289f procfs: remove procfs_ from procfs_operations variables
to aglin the naming style with other implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-22 03:33:50 -04:00
Xiang Xiao 149cafe450 procfs: Add g_ prefix to all procfs_operations
to conform the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-22 03:33:50 -04:00
Gregory Nutt 717bb04cb7 Increase the number of real time signals. Two is not enough.
Refer to issue #8867 for details and rational.

Convert sigset_t to an array type so that more than 32 signals can be supported.

Why not use a uin64_t?
- Using a uin32_t is more flexible if we decide to increase the number of signals beyound 64.
- 64-bit accesses are not atomic, at least not on 32-bit ARMv7-M and similar
- Keeping the base type as uint32_t does not introduce additional overhead due to padding to achieve 64-bit alignment of uin64_t
- Some architectures still supported by NuttX do not support uin64_t
  types,

Increased the number of signals to 64. This matches Linux. This will support all xsignals defined by Linux and also 32 real time signals (also like Linux).

This is is a work in progress; a draft PR that you are encouraged to comment on.
2023-03-27 16:59:04 +03:00
lilei19 38f64f559d change strcpy to strlcpy
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-24 12:15:40 +08:00
chao an 9c30d3bf33 procfs/meminfo: skip invalid character before memdump
In the case of echo characters, atoi will mistake CRLF as a digit character and convert it to 0

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-23 13:51:12 +08:00
lilei19 77f6319268 sync ps/assert output 2023-02-17 23:35:44 +08:00
Ville Juven 905cba3ee3 group/tg_info/argv: Make utility function to read argv as string
This creates a generic and safe way to read a process argument vector
as string from any context.
2023-02-17 01:27:16 +08:00
fangxiang 2c8c35431d fs/procfs: fix the issue of /proc/cpuload in SMP
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-02 22:48:30 +08:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Gustavo Henrique Nihei e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Xiang Xiao 3904fd775a sched: Remove the unused TCB_FLAG_SCHED_OTHER
after https://github.com/apache/nuttx/pull/8330

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 16:16:25 +02:00
chao an 2ffe564fa2 fs/procfs: sort level0 process id
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-30 14:57:43 +08:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Xiang Xiao 72e76600c3 fs/procfs: Avoid the cast in uptime_read
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-24 11:26:48 -03:00
anjiahao 70791af8e2 procmeminfo:support memdump can show specific task
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-12-19 20:43:33 +08:00
zhangyuan21 3462061624 task: show thread main entry when display thread name
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-17 14:53:59 +08:00
Gao Feng 08f5a5a3be meminfo: buflen identify the left of buffer
It is enought to only checking the buflen's avaiable or not.
(total size means total copied size)

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-11-29 01:29:55 +08:00
qinwei1 8021dfece6 sched/task/task_getpid: getpid should return process id not thread id
Summary:
   implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer to:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:08 +08:00
zhangyuan21 f27065cb9e sched/mqueue: make mqueue and mqueue sysv can disable separately 2022-11-16 20:03:40 +08:00
Xiang Xiao 6f33dd6ea0 mm/heap: Change TCB_FLAG_HEAPCHECK to TCB_FLAG_HEAP_CHECK
align with other flags naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-12 09:39:01 +01:00
Xiang Xiao 38d1244751 mm/mempool: Remove MM_MEMPOOL option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
chao an 205c8934a3 sched/msgq: add support of System V message queue
https://man.openbsd.org/msgget.2

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
zhangyuan21 16b6d365e9 fs/procfs: check task status before get group info
When ps cmd is invoked during the task exit process, the group information of the task may be deleted.
So need check the task flag before get the task group information.
2022-10-21 18:47:58 +08:00
Xiang Xiao b9a4bedc7f fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 15:10:26 +09:00
Xiang Xiao 36c05601df fs/procfs: Fix warning when all CONFIG_FS_PROCFS_EXCLUDE_xxx are enabled
procfs/fs_procfs.c: In function 'procfs_readdir':
Error: procfs/fs_procfs.c:719:9: error: unused variable 'pid' [-Werror=unused-variable]
  719 |   pid_t pid;
      |         ^~~
Error: procfs/fs_procfs.c:716:21: error: unused variable 'tcb' [-Werror=unused-variable]
  716 |   FAR struct tcb_s *tcb;
      |                     ^~~
procfs/fs_procfs.c: At top level:
Error: procfs/fs_procfs.c:206:16: error: 'procfs_enum' declared 'static' but never defined [-Werror=unused-function]
  206 | static void    procfs_enum(FAR struct tcb_s *tcb, FAR void *arg);
      |                ^~~~~~~~~~~
procfs/fs_procfs.c: In function 'procfs_readdir':
Error: procfs/fs_procfs.c:878:35: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
  878 |       if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
      |                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
procfs/fs_procfs.c:98:36: note: while referencing 'g_procfs_entries'
   98 | static const struct procfs_entry_s g_procfs_entries[] =
      |                                    ^~~~~~~~~~~~~~~~
Error: procfs/fs_procfs.c:879:35: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
  879 |                   g_procfs_entries[level1->firstindex].pathpattern,
      |                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
procfs/fs_procfs.c:98:36: note: while referencing 'g_procfs_entries'
   98 | static const struct procfs_entry_s g_procfs_entries[] =
      |                                    ^~~~~~~~~~~~~~~~
Error: procfs/fs_procfs.c:745:24: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
  745 |               pentry = &g_procfs_entries[index - priv->nentries];
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
procfs/fs_procfs.c:98:36: note: while referencing 'g_procfs_entries'
   98 | static const struct procfs_entry_s g_procfs_entries[] =
      |                                    ^~~~~~~~~~~~~~~~
Error: procfs/fs_procfs.c:745:41: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
  745 |               pentry = &g_procfs_entries[index - priv->nentries];
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 15:10:26 +09:00
Xiang Xiao befc748460 fs/procfs: Simplify the code logic and fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 15:10:26 +09:00
Masayuki Ishikawa 27985fa639 fs: procfs: Skip to register for meminfo if the name is NULL
Summary:
- This commit skips to register for meminfo if the name is NULL

Impact:
- None

Testing:
- Tested with sabre-6quad:netknsh (umm_heap will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-01 23:25:53 +02:00
Fotis Panagiotopoulos 484bdc54d3 Fixed warnings in various prints. 2022-08-30 22:53:01 +08:00
Huang Qi e4e3208180 Replace all strncpy with strlcpy for safety
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-25 13:38:36 +08:00
Xiang Xiao ba9486de4a iob: Remove iob_user_e enum and related code
since it is impossible to track producer and consumer
correctly if TCP/IP stack pass IOB directly to netdev

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 08:41:20 +03:00
Jiuzhu Dong fe17f747a7 fs/directory: move private directory information to filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong 90db4daca9 fs/directory: update readdir interface for all filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong c18b5602e8 fs/procfs: add mempool info to proc/mempool
server> cat /proc/mempool
                   total    bsize    nused    nfree   nifree  nwaiter
       hello:        400       20       17        3        0        0

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
haopengxiang 9bb5148d10 procfs: add heapcheck flag
1 for open heapcheck, 0 for close
echo 1 > /proc/xxx/heapcheck
echo 0 > /proc/xxx/heapcheck

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2022-08-02 10:46:44 +08:00
Jiuzhu Dong 9899dd0ec0 mm/mm_heap: change CONFIG_MM_BACKTRACE to int type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 23:45:31 +08:00
ligd c0f2b7811e pm: add pm procfs support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd 1f854486c3 procfs: procfs_opendir should return fail if can't match
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 10:53:44 +08:00
Fotis Panagiotopoulos 66f49c1f3c mm: Fixed the usage of CONFIG_MM_BACKTRACE & CONFIG_DEBUG_MM. 2022-07-22 00:53:02 +08:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Xiang Xiao 53c6789bef mm: Add mm_uninitialize to release the resource
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-12 19:41:14 +09:00
Xiang Xiao 3e32b605fe libc/tls: Make tls_get_info as the pulibc function instead up_tls_info
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 23:56:50 +03:00
YAMAMOTO Takashi b05320cac2 mm: Move backtrace stuff into a separate option
The functionality has too much overhead for CONFIG_DEBUG_MM.
2022-05-21 14:28:41 +08:00
Jiuzhu Dong b5fb93aefb fs/procfstcbinfo: minor bug about print address
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 12:14:52 +03:00
Jiuzhu Dong 709207b8d3 mm/memdump: dynamic turn on backtrace in heap when enable DEBUG_MM
default turn off.
turn on: echo on > /proc/memdump
turn off: echo off > proc/memdump

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-27 13:21:48 +08:00
Petro Karashchenko 68902d8732 pid_t: unify usage of special task IDs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 21:22:32 +08:00
Xiang Xiao 0f2f48f8ba sys/type.h: Change pid_t from int16_t to int
to fix the following warning:
include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
pid_t   vfork(void);
        ^
include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'

and change 32768 to INT_MAX to match the type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 15:48:33 +02:00
Xiang Xiao c2a1d0f5ae procfs: Remove mallinfo from struct procfs_meminfo_entry_s
let's call mm_mallinfo directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-17 13:59:03 -03:00
Jiuzhu Dong 4f79a1e22c procfs/group/fd: add path for every file descriptor
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-01 12:25:19 +08:00
Jiuzhu Dong 7ae3c572dc procfs: add heap info for every task
cat /proc/2/heap
AllocSize:  512
AllocBlks:  10

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-26 14:32:42 +08:00
Jiuzhu Dong 2dcc4a359d mm/dump: add pid and backtrace for every memory node
usage:
echo <pid/used/free> trace > /proc/memdump
echo used > /proc/memdump //output all used memory info with backtrace
echo free > /proc/memdump //output all free memory info
echo 22 > /proc/memdump //output used memory info for task pid is 22 with backtrace

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-26 14:32:42 +08:00
Jiuzhu Dong c5ba9261bc procfs: add memdump interface to dump used/free memory info
usage:echo <used/free> > /proc/memdump
echo used > /proc/memdump // output all used memory node info(address + size)
echo free > /proc/memdump // output all free memory node info(address + size)

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-26 14:32:42 +08:00
Oki Minabe e9bd959425 add new line to /proc/*/loadavg snprintf format. 2022-02-19 22:35:27 +01:00
chao.an 99cde13a11 net/inet: move socket flags into socket_conn_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
Xiang Xiao a24ae559c2 arch: Decouple up_critmon_[gettime|convert] from critmon
and rename to up_perf_[gettime|convert] since it's useful in other case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-25 14:43:34 +08:00
Xiang Xiao 77792a1598 sched: Define CONFIG_SMP_NCPUS to 1 in no SMP case
to simplify the SMP related code logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 23:21:21 +08:00
Xiang Xiao 1b77ae88ef fs/procfs: Remove the unnecessary strcmp
since the procfs already make the same check for us

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-12 07:19:40 +01:00
Jiuzhu Dong f93c17be94 fs/procfs: fix readdir loss last character
nsh> ls
/proc:
 0/
 1/
 2/
 3/
 4/
 5/
 meminf
 iobinf
 f/
 ne/
 sel/
 uptim
 versio

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 21:58:38 +08:00
zhouliang3 1f53a058fa nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2021-12-30 18:06:00 +08:00
Xiang Xiao 1af8cd4de8 sched: Move argv from tcb_s to task_info_s
argv is allocated from stack and then belong to userspace,
so task_info_s is a best location to hold this information.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-11 10:08:53 -06:00
Xiang Xiao d2b693a204 sched: Move g_tcbinfo to include/nuttx/sched.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-22 14:59:48 -03:00
ligd 87c47b8758 procfs: fix ps can't log out Group id
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-11 11:13:12 -03:00
zhuyanlin e53aeea60e fs:procfs: add tcbinfo procfs interface
Add tcbinfo in procfs system.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-10 14:31:10 -03:00
zhuyanlin 3e92a4e5fb fs:procfs: add waiting_paging_fill state names
Follow task_state in tcb_s.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-18 10:08:00 -03:00
Xiang Xiao a262eebe34 libc: Rename match to fnmatch
specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/fnmatch.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 08:23:35 -03:00
Xiang Xiao 307cc61893 fs: Add fchstat and chstat callback into mountpt_operations
and implement all status related change function. the individual
file system change will provide in other upcoming patchset.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8fde9db8eba9586e9c8da078b67e020c26623cf4
2021-07-29 06:33:49 -03:00
Xiang Xiao c3c4053263 fs/profs: Add ordblks in meminfo_progmem
forget in commit:
Author: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Date:   Wed Apr 28 11:05:20 2021 +0800

    cmd/free: add nused/nfree field in command free

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-12 16:49:56 -03:00
Xiang Xiao 7ef29ecce6 profs: Print StackAlloc by procfs_snprintf
since snprintf return the wrong number in case of insufficient buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-12 16:49:56 -03:00
Jiuzhu Dong 9b1f554429 sched: Dynamically extend the pid hash table
Change-Id: I3a719bc575cd408cd530a39efa203f507b44fa9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-11 19:42:30 -07:00
Xiang Xiao d5c1979aad fs/procfs: layout the output of meminfo correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic30e70772e19a43e2ad3b298e3ba1ac77f2f2219
2021-07-06 05:39:02 -07:00
ligd 2d32a52353 sched_critmon: add thread run time to critmonitor
Change-Id: Ib44e45f0f9a1b249b4067db324c9dbdf0cf3f288
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:25:02 -05:00
ligd dbdb24e2e0 procfs: fix cat status error when meet long thread name
nsh> cat /proc/3/status
Name:       init123456789987654Type:       Task
Group:      3
State:      Running

Change-Id: Iddef8fa1fe3a02d407244f46fa05e3f35dd7c84e
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:25:02 -05:00
ligd 2c775bb0c9 fs/procfs: fix heap overflow when snprintf meet long string
Change-Id: I90f2d9fab55b6e69f159855af3d6dbcb81142eb8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:25:02 -05:00
Jiuzhu Dong f57ba35151 fs/procfs: add StackAlloc field for task stack info
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-02 04:51:55 -05:00
Alin Jerpelea 75797039fb fs: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-05-27 08:07:25 +09:00
Jiuzhu Dong fea1da2f53 cmd/free: add nused/nfree field in command free
Change-Id: I74aa4b1e7394a17c3b117322a4cc24aa52aac3b8
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-25 01:01:38 -07:00
Xiang Xiao 2335b69120 arch: Allocate the space from the beginning in up_stack_frame
arch: Allocate the space from the beginning in up_stack_frame

and modify the affected portion:
1.Correct the stack dump and check
2.Allocate tls_info_s by up_stack_frame too
3.Move the stack fork allocation from arch to sched

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-04-16 12:41:41 +09:00
Alin Jerpelea 231b8518b7 NuttX: Ken Pettit: update licenses to Apache
Ken Pettit has submitted the ICLA and we can migrate the licenses
 to Apache.

Sebastien Lorquet has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-10 06:42:19 -05:00
Jiuzhu Dong e96c8b9283 fs: allocate file/socket dynamically
Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 06:46:42 -07:00
Xiang Xiao 90be95bb89 sched: Remove all group id related stuff
it is wrong to define a new grpid_t, but not reuse pid_t,
because it make getpid(parent) == getppid(child) impossible.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-05 20:35:22 +08:00
Jiuzhu Dong 4d5a964f29 net: unify socket into file descriptor
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 19:01:41 -08:00
Xiang Xiao 72928cebcf fs/procfs: Avoid the duplicated 0x prefix in pthread cmdline
like this:
... <pthread> 0x0x341de68c
by removing "0x" from format string

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-02-20 10:11:30 -08:00
YAMAMOTO Takashi 73dde4b63b fs/procfs/fs_procfsmeminfo.c: Allow longer heap names 2021-02-12 03:16:03 -08:00
YAMAMOTO Takashi 929e438052 procfs: Use procfs_register_meminfo for "Kmem" 2021-02-12 03:16:03 -08:00
YAMAMOTO Takashi c25f4233aa procfs: Use procfs_register_meminfo for "Umem" 2021-02-12 03:16:03 -08:00
YAMAMOTO Takashi f305cefe82 procfs: Add procfs_register_meminfo
This allows subsystems to register their mallinfo-like functions
to be shown in /proc/meminfo.
2021-02-12 03:16:03 -08:00