Commit Graph

816 Commits

Author SHA1 Message Date
Xiang Xiao
dd7e98129a system/libuv: Fix the undefined reference to `uv__strscpy'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 20:25:52 +03:00
Xiang Xiao
f5c094aef1 system/libuv: Skip compile strscpy.c when CONFIG_LIBUV_UTILS_TEST enable
since test/test-strscpy.c will include it in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 20:25:52 +03:00
Xiang Xiao
8d1484b562 system/libuv: Include nuttx/tls.h to call task local storage api
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-01 22:50:54 +03:00
Huang Qi
24c16780e2 libuv: Don't add idna.c to CSRCS if test enabled
test-idna.c will include idna.c and then cause multiple definition.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-05-13 08:23:23 +03:00
chao.an
725fe76b91 trace: format the usage output
before:
Usage: trace <subcommand>...
Subcommand:
  start [-c][<duration>]          : Start task tracing
  stop                            : Stop task tracing
  dump [-a][-c][<filename>]           : Output the trace result
 [-a] <Android SysTrace>
  mode [{+|-}{o|w|s|a|i|d}...]        : Set task trace options
  switch [+|-] : Configure switch trace filter
  syscall [{+|-}<syscallname>...] : Configure syscall trace filter
  irq [{+|-}<irqnum>...]          : Configure IRQ trace filter
  print [+|-] : Configure dump tnsh>

after:
Usage: trace <subcommand>...
Subcommand:
 start   [-c][<duration>]            : Start task tracing
 stop                                : Stop task tracing
 cmd     [-c] <command> [<args>...]  : Get the trace while running <command>
 dump    [-a][-c][<filename>]        : Output the trace result
                                       [-a] <Android SysTrace>
 mode    [{+|-}{o|w|s|a|i|d}...]     : Set task trace options
 switch  [+|-]                       : Configure switch trace filter
 syscall [{+|-}<syscallname>...]     : Configure syscall trace filter
 irq     [{+|-}<irqnum>...]          : Configure IRQ trace filter
 print   [+|-]                       : Configure dump trace filter

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
chao.an
089c05cbd8 system/trace: correct arg index if command is alreay set
An error occurs when the same command is executed twice

$ trace switch +
$ trace switch +
Usage: trace <subcommand>...
Subcommand:
  start [-c][<duration>]          : Start task tracing
  stop                            : Stop task tracing
  dump [-a][-c][<filename>]           : Output the trace result
 [-a] <Android SysTrace>
  mode [{+|-}{o|w|s|a|i|d}...]        : Set task trace options
  switch [+|-] : Configure switch trace filter
  syscall [{+|-}<syscallname>...] : Configure syscall trace filter
  irq [{+|-}<irqnum>...]          : Configure IRQ trace filter
  print [+|-] : Configure dump tnsh>

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
chao.an
8ce86fe572 system/sched_note: fix build break
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
Xiang Xiao
385603666b system: Add gcov command
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 18:08:07 +03:00
Abdelatif Guettouche
473611d51d system/ping: Guard against division by zero when calculating the RTT.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-23 20:17:45 +03:00
Huang Qi
768a21b587 system/i2c: Fix fd leak in i2ccmd_reset
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-19 14:53:51 +03:00
Huang Qi
c7413ee859 system/critmon: Fix dead code
Remove branch since errcount could never bigger than 100.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-19 18:21:00 +08:00
okayserh
c8bc287a29 According to the help text, the balance command without value
should display the current balance value. This patch adjusts
the code accordingly.
2022-04-11 11:07:49 +08:00
chao.an
8c1a4994cc system/note: correct unflatten format
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-08 01:38:13 +08:00
Petro Karashchenko
319203d5d8 apps: unify FAR attribute usage across apps
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-05 00:55:22 +08:00
chao.an
124c1328a6 sched/note: add support of trace section mark
The implementation of this feature is based on android systrace:

https://source.android.com/devices/tech/debug/ftrace

Application developers are more concerned about the performance of
the specified application section,
added two APIs to implement performance measurement:

void sched_note_begin(FAR const char *str);
void sched_note_end(FAR const char *str);
or
SCHED_NOTE_BEGIN();  /* defined to sched_note_begin(__FUNCTION__) */
SCHED_NOTE_END();    /* defined to sched_note_end(__FUNCTION__) */

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
f4a41c6ed4 system/trace: fix the irq print compatibility with systrace
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
023971d46c system/trace: add switch priority print to align with ftrace
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
2fd38eb57b system/trace: force flush the output stream
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
7612d2aea8 system/trace: correct preamble header pid
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
90484a33e9 sched/trace: correct the note print format
note print should with Instruction pointer.

e.g:

        trace_printk("hello NuttX");

trace dump:

        hello-6  [000] .... 23080.367994: 0xc044a005: hello NuttX

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
0dc716d426 sched/note: unify the data format
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
Petro Karashchenko
214dbe51b4 open() options: pass file options 0 if only ioctl is used
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-01 12:22:07 -03:00
qiaohaijiao1
442d52e878 system/nxlooper: fix warning
nxlooper.c:615:7: warning: 'playbufs' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2022-03-31 16:59:16 +08:00
qiaohaijiao1
68fa377c5e system/nxplayer: fix warning
nxplayer.c:400:57: warning: array subscript 4 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 5 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 6 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 7 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2022-03-31 16:59:16 +08:00
ligd
9730eaad9e nsh: sh_main also support isctty = true
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 22:47:37 +03:00
ligd
427798f7ee nxlooper: support different period size of player & recorder
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 02:46:07 +08:00
Huang Qi
ec15dc0344 system/libuv: Support specify stack size for worker thread
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-03-29 18:09:10 +03:00
Petro Karashchenko
41dd5f15bd system/cfgdata: add missing include file
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 17:19:00 -03:00
zhuyanlin
e3df21cd4c trace: fix pointer cross the border
Fix pointer cross the border

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-03-28 22:17:59 +08:00
Xiang Xiao
d364d7a810 system: Fix nx[looper|player|recorder] warning
nxlooper.c:879:7: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  879 |       strncpy(plooper->recorddev, pdevice, sizeof(plooper->playdev));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxlooper.c:875:7: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  875 |       strncpy(plooper->playdev, pdevice, sizeof(plooper->playdev));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxlooper.c: In function 'nxlooper_loopraw':
nxlooper.c:165:52: warning: '%s' directive output may be truncated writing up to 96 bytes into a region of size 53 [-Wformat-truncation=]
  165 |           snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |                                                    ^~
nxlooper.c:165:11: note: 'snprintf' output between 12 and 108 bytes into a destination of size 64
  165 |           snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxplayer.c: In function 'nxplayer_playinternal':
nxplayer.c:359:53: warning: '%s' directive output may be truncated writing up to 96 bytes into a region of size 53 [-Wformat-truncation=]
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |                                                     ^~
nxplayer.c:359:11: note: 'snprintf' output between 12 and 108 bytes into a destination of size 64
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxrecorder.c: In function 'nxrecorder_setdevice':
nxrecorder.c:695:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  695 |   strncpy(precorder->device, pdevice, sizeof(precorder->device));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxplayer.c: In function 'nxplayer_setdevice':
nxplayer.c:1686:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
 1686 |   strncpy(pplayer->prefdevice, pdevice, sizeof(pplayer->prefdevice));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC:  nxrecorder_main.c
nxplayer.c: In function 'nxplayer_setmediadir':
nxplayer.c:2090:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
 2090 |   strncpy(pplayer->mediadir, mediadir, sizeof(pplayer->mediadir));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-23 11:05:18 +02:00
Petro Karashchenko
c88dd4bbaf system/cfgdata: implement "format" option
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 10:30:50 +08:00
Xiang Xiao
282e44e3e0 system/ping: Don't include nuttx/lib/math.h
since the mdev is calculated through function provided by fixedmath.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-19 22:24:04 +02:00
Petro Karashchenko
29cc338dac system/cfgdata: fix compilation when MTD_CONFIG_NAMED is enabled
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-19 17:36:29 +08:00
xuewenliang
c69ec94d13 Modifying the ping command
1、Round trip times in the ping command range from millisecond to subtle
2、Add statistics on RTT related min/avg/Max/mdev in ping program
3、The ping command supports ctrl+c interruption operations

Signed-off-by: xuewenliang <xuewenliang@xiaomi.com>
2022-03-18 09:54:01 +08:00
Petro Karashchenko
566be8c7b1 definitions: unify MAX and MIN macro definitions
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:20:17 +08:00
Xiang Xiao
61007bcdb6 system/adb: Update to microADB to the latest version
and enable the port forwarding feature

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-15 09:16:27 +02:00
pengyiqiang
c53dca512e rename ramspeed to ramspeed_main
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-03-14 18:46:07 +08:00
pengyiqiang
c2f4d16db5 system: add ramspeed test.
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-03-14 18:46:07 +08:00
yinshengkai
db4fc86465 system/input: add input tool button support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-03-14 18:44:08 +08:00
Petro Karashchenko
f9baa422c1 style: unify path to files in comment section
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-09 10:37:33 +08:00
Alin Jerpelea
4cd9c5d0e1 apps: system: setlogmask: update licenses to Apache
Gregory Nutt has submitted the SGA
Verge Aero has submitted the SGA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 17:04:01 +02:00
Xiang Xiao
5a2c435035 system/hexed: fix error: 'memset' used with length equal to number of elements without multiplication by element size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-08 10:52:18 +02:00
Alin Jerpelea
cd79a79d00 Makefile: 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>
2022-03-08 01:44:49 +08:00
Xiang Xiao
df48f0bb73 system/termcurses: Fix the compiler warning
tcurses_vt100.c: In function 'tcurses_vt100_move':
Error: tcurses_vt100.c:121:48: error: '%d' directive writing between 1 and 11 bytes into a region of size between 2 and 12 [-Werror=format-overflow=]
  121 | static const char *g_movecurs       = "\033[%d;%dH";  /* Move cursor to x,y */
      |                                                ^~
tcurses_vt100.c:121:39: note: directive argument in the range [-2147483647, 2147483647]
  121 | static const char *g_movecurs       = "\033[%d;%dH";  /* Move cursor to x,y */
      |                                       ^~~~~~~~~~~~~
tcurses_vt100.c:795:9: note: 'sprintf' output between 7 and 27 bytes into a destination of size 16
  795 |         sprintf(str, g_movecurs, row + 1, col + 1);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-07 00:58:19 +08:00
Xiang Xiao
65a02ba9f9 system/nxplayer: Fix the compiler warning
nxplayer.c: In function 'nxplayer_playinternal':
Error: nxplayer.c:209:36: error: '%s' directive output may be truncated writing up to 99 bytes into a region of size 59 [-Werror=format-truncation=]
  209 |   snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", relurl);
      |                                    ^~                    ~~~~~~
nxplayer.c:209:3: note: 'snprintf' output between 19 and 118 bytes into a destination of size 64
  209 |   snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", relurl);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: nxplayer.c:1809:42: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
 1809 |       snprintf(path, sizeof(path), "%s/%s", pplayer->mediadir, pfilename);
      |                                          ^
nxplayer.c:1809:7: note: 'snprintf' output 2 or more bytes (assuming 129) into a destination of size 128
 1809 |       snprintf(path, sizeof(path), "%s/%s", pplayer->mediadir, pfilename);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: nxplayer.c:359:53: error: '%s' directive output may be truncated writing up to 128 bytes into a region of size 53 [-Werror=format-truncation=]
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |                                                     ^~
nxplayer.c:359:11: note: 'snprintf' output between 12 and 140 bytes into a destination of size 64
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-07 00:58:19 +08:00
Xiang Xiao
44b92d9254 Fix readline_common.c:277:19: error: 'strncpy' destination unchanged after copying no bytes
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-06 00:40:06 +08:00
Xiang Xiao
02a095bb76 system/adb: Download the last version of microADB
commit aa9c64896c7d47478656928d4dcf9b1a5e346da7
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sat Jan 22 16:41:23 2022 +0800

    remove NuttX special code

    since the new libuv porting for NuttX doesn't need the special process

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 09:00:30 +02:00
Xiang Xiao
29374c96c3 system/adb: Replace NuttX special shell service with microADB builtin one
since the new libuv porting support uv_proccess_t now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 09:00:30 +02:00
Xiang Xiao
77382e7209 process-spawn.c: switch uv_socketpair to uv_pipe
to remove the socket dependence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 09:00:30 +02:00
Xiang Xiao
f0bb6cf914 system/libuv: Switch process.c to process_spawn.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-02 23:41:32 +08:00