From 62fec5d57df4f75da0cc3ec70ed0774e3951121a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 18 May 2016 19:22:47 -0600 Subject: [PATCH] apps/system/sched_note: Move the schduler note monitor from example/ to system/ --- examples/Kconfig | 1 - examples/README.txt | 5 --- examples/sched_note/Make.defs | 39 --------------------- system/Kconfig | 1 + system/Make.defs | 4 +++ system/hex2bin/Makefile | 8 ++--- system/mdio/Makefile | 2 +- system/mdio/mdio_main.c | 2 +- system/prun/prun.h | 8 ++--- {examples => system}/sched_note/.gitignore | 0 {examples => system}/sched_note/Kconfig | 20 +++++------ {examples => system}/sched_note/Makefile | 14 ++++---- {examples => system}/sched_note/note_main.c | 12 +++---- 13 files changed, 38 insertions(+), 78 deletions(-) delete mode 100644 examples/sched_note/Make.defs rename {examples => system}/sched_note/.gitignore (100%) rename {examples => system}/sched_note/Kconfig (64%) rename {examples => system}/sched_note/Makefile (86%) rename {examples => system}/sched_note/note_main.c (97%) diff --git a/examples/Kconfig b/examples/Kconfig index 780502cff..bf8a2b3de 100644 --- a/examples/Kconfig +++ b/examples/Kconfig @@ -68,7 +68,6 @@ source "$APPSDIR/examples/relays/Kconfig" source "$APPSDIR/examples/rgbled/Kconfig" source "$APPSDIR/examples/rgmp/Kconfig" source "$APPSDIR/examples/romfs/Kconfig" -source "$APPSDIR/examples/sched_note/Kconfig" source "$APPSDIR/examples/sendmail/Kconfig" source "$APPSDIR/examples/serialblaster/Kconfig" source "$APPSDIR/examples/serialrx/Kconfig" diff --git a/examples/README.txt b/examples/README.txt index ee603ace6..14291a07f 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1751,11 +1751,6 @@ examples/romfs * CONFIG_EXAMPLES_ROMFS_MOUNTPOINT The location to mount the ROM disk. Deafault: "/usr/local/share" -examples/sched_note -^^^^^^^^^^^^^^^^^^^ - - This is a simple test of the Scheduler instrumentation logic. - examples/sendmail ^^^^^^^^^^^^^^^^^ diff --git a/examples/sched_note/Make.defs b/examples/sched_note/Make.defs deleted file mode 100644 index ba503e473..000000000 --- a/examples/sched_note/Make.defs +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# apps/examples/note/Make.defs -# Adds selected applications to apps/ build -# -# Copyright (C) 2016 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -ifeq ($(CONFIG_EXAMPLES_NOTE),y) -CONFIGURED_APPS += examples/sched_note -endif diff --git a/system/Kconfig b/system/Kconfig index 8ad2b6769..3a57198fb 100644 --- a/system/Kconfig +++ b/system/Kconfig @@ -22,6 +22,7 @@ source "$APPSDIR/system/mdio/Kconfig" source "$APPSDIR/system/sudoku/Kconfig" source "$APPSDIR/system/lm75/Kconfig" source "$APPSDIR/system/vi/Kconfig" +source "$APPSDIR/system/sched_note/Kconfig" source "$APPSDIR/system/stackmonitor/Kconfig" source "$APPSDIR/system/symtab/Kconfig" source "$APPSDIR/system/cdcacm/Kconfig" diff --git a/system/Make.defs b/system/Make.defs index 2caba6179..984d9f670 100644 --- a/system/Make.defs +++ b/system/Make.defs @@ -102,6 +102,10 @@ ifeq ($(CONFIG_SYSTEM_READLINE),y) CONFIGURED_APPS += system/readline endif +ifeq ($(CONFIG_SYSTEM_NOTE),y) +CONFIGURED_APPS += system/sched_note +endif + ifeq ($(CONFIG_SYSTEM_SUDOKU),y) CONFIGURED_APPS += system/sudoku endif diff --git a/system/hex2bin/Makefile b/system/hex2bin/Makefile index 9c49afad5..6c5b34340 100644 --- a/system/hex2bin/Makefile +++ b/system/hex2bin/Makefile @@ -87,11 +87,11 @@ else INSTALL_DIR = $(BIN_DIR) endif -CONFIG_EXAMPLES_HEX2BIN_PROGNAME ?= hex2bin$(EXEEXT) -HEX2BIN_PROGNAME = $(CONFIG_EXAMPLES_HEX2BIN_PROGNAME) +CONFIG_SYSTEM_HEX2BIN_PROGNAME ?= hex2bin$(EXEEXT) +HEX2BIN_PROGNAME = $(CONFIG_SYSTEM_HEX2BIN_PROGNAME) -CONFIG_EXAMPLES_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT) -HEX2MEM_PROGNAME = $(CONFIG_EXAMPLES_HEX2MEM_PROGNAME) +CONFIG_SYSTEM_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT) +HEX2MEM_PROGNAME = $(CONFIG_SYSTEM_HEX2MEM_PROGNAME) ROOTDEPPATH = --dep-path . VPATH = diff --git a/system/mdio/Makefile b/system/mdio/Makefile index 2fa178583..2d400ea09 100644 --- a/system/mdio/Makefile +++ b/system/mdio/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/mdio/Makefile +# apps/system/mdio/Makefile # # Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/system/mdio/mdio_main.c b/system/mdio/mdio_main.c index 74549a27d..9300458ce 100644 --- a/system/mdio/mdio_main.c +++ b/system/mdio/mdio_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/mdio/mdio_main.c + * system/mdio/mdio_main.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/system/prun/prun.h b/system/prun/prun.h index ddb6ee650..fb5b96ab3 100644 --- a/system/prun/prun.h +++ b/system/prun/prun.h @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/prun/prun.h + * apps/system/prun/prun.h * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __EXAMPLES_PASHELLO_H -#define __EXAMPLES_PASHELLO_H +#ifndef __APPS_SYSTEM_PRUN_H +#define __APPS_SYSTEM_PRUN_H /**************************************************************************** * Included Files @@ -52,4 +52,4 @@ extern void hello_register(void); -#endif /* __EXAMPLES_PASHELLO_H */ +#endif /* __APPS_SYSTEM_PRUN_H */ diff --git a/examples/sched_note/.gitignore b/system/sched_note/.gitignore similarity index 100% rename from examples/sched_note/.gitignore rename to system/sched_note/.gitignore diff --git a/examples/sched_note/Kconfig b/system/sched_note/Kconfig similarity index 64% rename from examples/sched_note/Kconfig rename to system/sched_note/Kconfig index eeae2e660..9ad1f1e0c 100644 --- a/examples/sched_note/Kconfig +++ b/system/sched_note/Kconfig @@ -3,16 +3,16 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config EXAMPLES_NOTE - bool "Scheduler instrumentation example" +config SYSTEM_NOTE + bool "Scheduler monitor" default n depends on DRIVER_NOTE ---help--- - Enable the schedler instrumentation example + Enable the schedler instrumentation monitor -if EXAMPLES_NOTE +if SYSTEM_NOTE -config EXAMPLES_NOTE_PROGNAME +config SYSTEM_NOTE_PROGNAME string "Program name" default "note" depends on BUILD_KERNEL @@ -20,20 +20,20 @@ config EXAMPLES_NOTE_PROGNAME This is the name of the program that will be use when the NSH ELF program is installed. -config EXAMPLES_NOTE_PRIORITY +config SYSTEM_NOTE_PRIORITY int "Note daemon task priority" default 100 -config EXAMPLES_NOTE_STACKSIZE +config SYSTEM_NOTE_STACKSIZE int "Note daemon stack size" default 2048 -config EXAMPLES_NOTE_BUFFERSIZE +config SYSTEM_NOTE_BUFFERSIZE int "Note daemon I/O buffer size" default 1024 -config EXAMPLES_NOTE_DELAY +config SYSTEM_NOTE_DELAY int "Note daemon sample delay (msec)" default 1000 -endif # EXAMPLES_NOTE +endif # SYSTEM_NOTE diff --git a/examples/sched_note/Makefile b/system/sched_note/Makefile similarity index 86% rename from examples/sched_note/Makefile rename to system/sched_note/Makefile index 89d0bfee8..913d7ae20 100644 --- a/examples/sched_note/Makefile +++ b/system/sched_note/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/note/Makefile +# apps/system/note/Makefile # # Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -37,12 +37,12 @@ # LED driver test built-in application info -CONFIG_EXAMPLES_NOTE_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_NOTE_STACKSIZE ?= 2048 +CONFIG_SYSTEM_NOTE_PRIORITY ?= SCHED_PRIORITY_DEFAULT +CONFIG_SYSTEM_NOTE_STACKSIZE ?= 2048 APPNAME = note -PRIORITY = $(CONFIG_EXAMPLES_NOTE_PRIORITY) -STACKSIZE = $(CONFIG_EXAMPLES_NOTE_STACKSIZE) +PRIORITY = $(CONFIG_SYSTEM_NOTE_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_NOTE_STACKSIZE) # LED driver test @@ -50,7 +50,7 @@ ASRCS = CSRCS = MAINSRC = note_main.c -CONFIG_EXAMPLES_NOTE_PROGNAME ?= note$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_NOTE_PROGNAME) +CONFIG_SYSTEM_NOTE_PROGNAME ?= note$(EXEEXT) +PROGNAME = $(CONFIG_SYSTEM_NOTE_PROGNAME) include $(APPDIR)/Application.mk diff --git a/examples/sched_note/note_main.c b/system/sched_note/note_main.c similarity index 97% rename from examples/sched_note/note_main.c rename to system/sched_note/note_main.c index dd0ea4219..fa76f8e5c 100644 --- a/examples/sched_note/note_main.c +++ b/system/sched_note/note_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/note/note_main.c + * system/note/note_main.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -54,7 +54,7 @@ ****************************************************************************/ static bool g_note_daemon_started; -static uint8_t g_note_buffer[CONFIG_EXAMPLES_NOTE_BUFFERSIZE]; +static uint8_t g_note_buffer[CONFIG_SYSTEM_NOTE_BUFFERSIZE]; /* Names of task/thread states */ @@ -377,13 +377,13 @@ static int note_daemon(int argc, char *argv[]) for (; ; ) { - nread = read(fd, g_note_buffer, CONFIG_EXAMPLES_NOTE_BUFFERSIZE); + nread = read(fd, g_note_buffer, CONFIG_SYSTEM_NOTE_BUFFERSIZE); if (nread > 0) { dump_notes(nread); } - usleep(CONFIG_EXAMPLES_NOTE_DELAY * 1000L); + usleep(CONFIG_SYSTEM_NOTE_DELAY * 1000L); } (void)close(fd); @@ -422,8 +422,8 @@ int note_main(int argc, FAR char *argv[]) ledargv[0] = "note_daemon"; ledargv[1] = NULL; - ret = task_create("note_daemon", CONFIG_EXAMPLES_NOTE_PRIORITY, - CONFIG_EXAMPLES_NOTE_STACKSIZE, note_daemon, + ret = task_create("note_daemon", CONFIG_SYSTEM_NOTE_PRIORITY, + CONFIG_SYSTEM_NOTE_STACKSIZE, note_daemon, (FAR char * const *)ledargv); if (ret < 0) {