mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-25 14:09:25 +08:00
2002-12-12 Ralf Corsepius <corsepius@faw.uni-ulm.de>
* .cvsignore: Moved to rtems/cpukit/libmisc. * ChangeLog: Moved to rtems/cpukit/libmisc. * Makefile.am: Moved to rtems/cpukit/libmisc. * README: Moved to rtems/cpukit/libmisc. * configure.ac: Moved to rtems/cpukit/libmisc. * capture/Makefile.am: Moved to rtems/cpukit/libmisc. * capture/README: Moved to rtems/cpukit/libmisc. * capture/capture-cli.c: Moved to rtems/cpukit/libmisc. * capture/capture-cli.h: Moved to rtems/cpukit/libmisc. * capture/capture.c: Moved to rtems/cpukit/libmisc. * capture/capture.h: Moved to rtems/cpukit/libmisc. * cpuuse/Makefile.am: Moved to rtems/cpukit/libmisc. * cpuuse/README: Moved to rtems/cpukit/libmisc. * cpuuse/cpuuse.c: Moved to rtems/cpukit/libmisc. * cpuuse/cpuuse.h: Moved to rtems/cpukit/libmisc. * devnull/.cvsignore: Moved to rtems/cpukit/libmisc. * devnull/Makefile.am: Moved to rtems/cpukit/libmisc. * devnull/devnull.c: Moved to rtems/cpukit/libmisc. * devnull/devnull.h: Moved to rtems/cpukit/libmisc. * dummy/.cvsignore: Moved to rtems/cpukit/libmisc. * dummy/Makefile.am: Moved to rtems/cpukit/libmisc. * dummy/README: Moved to rtems/cpukit/libmisc. * dummy/dummy.c: Moved to rtems/cpukit/libmisc. * dumpbuf/.cvsignore: Moved to rtems/cpukit/libmisc. * dumpbuf/Makefile.am: Moved to rtems/cpukit/libmisc. * dumpbuf/dumpbuf.c: Moved to rtems/cpukit/libmisc. * dumpbuf/dumpbuf.h: Moved to rtems/cpukit/libmisc. * monitor/.cvsignore: Moved to rtems/cpukit/libmisc. * monitor/Makefile.am: Moved to rtems/cpukit/libmisc. * monitor/README: Moved to rtems/cpukit/libmisc. * monitor/mon-command.c: Moved to rtems/cpukit/libmisc. * monitor/mon-config.c: Moved to rtems/cpukit/libmisc. * monitor/mon-dname.c: Moved to rtems/cpukit/libmisc. * monitor/mon-driver.c: Moved to rtems/cpukit/libmisc. * monitor/mon-extension.c: Moved to rtems/cpukit/libmisc. * monitor/mon-itask.c: Moved to rtems/cpukit/libmisc. * monitor/mon-manager.c: Moved to rtems/cpukit/libmisc. * monitor/mon-monitor.c: Moved to rtems/cpukit/libmisc. * monitor/mon-mpci.c: Moved to rtems/cpukit/libmisc. * monitor/mon-object.c: Moved to rtems/cpukit/libmisc. * monitor/mon-prmisc.c: Moved to rtems/cpukit/libmisc. * monitor/mon-queue.c: Moved to rtems/cpukit/libmisc. * monitor/mon-server.c: Moved to rtems/cpukit/libmisc. * monitor/mon-symbols.c: Moved to rtems/cpukit/libmisc. * monitor/mon-task.c: Moved to rtems/cpukit/libmisc. * monitor/monitor.h: Moved to rtems/cpukit/libmisc. * monitor/symbols.h: Moved to rtems/cpukit/libmisc. * mw-fb/.cvsignore: Moved to rtems/cpukit/libmisc. * mw-fb/Makefile.am: Moved to rtems/cpukit/libmisc. * mw-fb/mw_fb.c: Moved to rtems/cpukit/libmisc. * mw-fb/mw_fb.h: Moved to rtems/cpukit/libmisc. * mw-fb/mw_uid.c: Moved to rtems/cpukit/libmisc. * mw-fb/mw_uid.h: Moved to rtems/cpukit/libmisc. * rtmonuse/.cvsignore: Moved to rtems/cpukit/libmisc. * rtmonuse/Makefile.am: Moved to rtems/cpukit/libmisc. * rtmonuse/rtmonuse.c: Moved to rtems/cpukit/libmisc. * rtmonuse/rtmonuse.h: Moved to rtems/cpukit/libmisc. * serdbg/.cvsignore: Moved to rtems/cpukit/libmisc. * serdbg/Makefile.am: Moved to rtems/cpukit/libmisc. * serdbg/README: Moved to rtems/cpukit/libmisc. * serdbg/serdbg.c: Moved to rtems/cpukit/libmisc. * serdbg/serdbg.h: Moved to rtems/cpukit/libmisc. * serdbg/serdbgcnf.h: Moved to rtems/cpukit/libmisc. * serdbg/serdbgio.c: Moved to rtems/cpukit/libmisc. * serdbg/termios_printk.c: Moved to rtems/cpukit/libmisc. * serdbg/termios_printk.h: Moved to rtems/cpukit/libmisc. * serdbg/termios_printk_cnf.h: Moved to rtems/cpukit/libmisc. * shell/.cvsignore: Moved to rtems/cpukit/libmisc. * shell/Makefile.am: Moved to rtems/cpukit/libmisc. * shell/README: Moved to rtems/cpukit/libmisc. * shell/cmds.c: Moved to rtems/cpukit/libmisc. * shell/shell.c: Moved to rtems/cpukit/libmisc. * shell/shell.h: Moved to rtems/cpukit/libmisc. * stackchk/.cvsignore: Moved to rtems/cpukit/libmisc. * stackchk/Makefile.am: Moved to rtems/cpukit/libmisc. * stackchk/README: Moved to rtems/cpukit/libmisc. * stackchk/check.c: Moved to rtems/cpukit/libmisc. * stackchk/internal.h: Moved to rtems/cpukit/libmisc. * stackchk/stackchk.h: Moved to rtems/cpukit/libmisc. * untar/.cvsignore: Moved to rtems/cpukit/libmisc. * untar/Makefile.am: Moved to rtems/cpukit/libmisc. * untar/README: Moved to rtems/cpukit/libmisc. * untar/untar.c: Moved to rtems/cpukit/libmisc. * untar/untar.h: Moved to rtems/cpukit/libmisc. * wrapup/.cvsignore: Moved to rtems/cpukit/libmisc. * wrapup/Makefile.am: Moved to rtems/cpukit/libmisc.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
ACLOCAL_AMFLAGS = -I ../../../aclocal
|
||||
|
||||
SUBDIRS = capture cpuuse devnull dummy dumpbuf monitor mw-fb shell \
|
||||
rtmonuse serdbg stackchk untar wrapup
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
include $(top_srcdir)/../../../automake/subdirs.am
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
This directory contains for the "miscellaneous" library. Currently
|
||||
this library contains a number of useful support libraries:
|
||||
|
||||
+ Task Stack Overflow Checker
|
||||
+ Workspace Consistency Checker
|
||||
+ Task Execution Time Monitor
|
||||
+ Period Statistics Monitor
|
||||
+ Debug Monitor
|
||||
|
||||
The following ideas have been mentioned for items which could go
|
||||
in this library, but this list is not all inclusive:
|
||||
|
||||
+ there are no outstanding suggestions.
|
||||
|
||||
The intent of this library is to provide a home for useful utility routines
|
||||
which are dependent upon RTEMS.
|
||||
|
||||
--joel
|
||||
16 Sept 97
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,41 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libcapture-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
C_FILES = capture.c capture-cli.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
|
||||
include_rtems_HEADERS = capture.h capture-cli.h
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
@$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = README capture.c capture-cli.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,255 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
RTEMS Performance Monitoring and Measurement Framework
|
||||
|
||||
Copyright 2002 Chris Johns (ccj@acm.org)
|
||||
23 April 2002
|
||||
|
||||
This directory contains the source code for the performance monitoring and
|
||||
measurement framework. It is more commonly know as the capture engine.
|
||||
|
||||
The capture engine is in an early phase of development. Please review the Status
|
||||
section of this document for the current status.
|
||||
|
||||
Performance.
|
||||
|
||||
The capture engine is designed to not effect the system it is
|
||||
monitoring. Resources such as memory are used as well as a small performance
|
||||
hit in task creation, deletion and context switch. The overhead is small and
|
||||
will not be noticed unless the system is operating close to the performance
|
||||
limit of the target.
|
||||
|
||||
Structure.
|
||||
|
||||
The capture engine is implemented in a couple of layers. This lowest layer is
|
||||
the capture engine. Its interface is in the file 'capture.h'. Typically this
|
||||
interface is directly used unless you are implementing a target interface. The
|
||||
user interface is via a target interface.
|
||||
|
||||
Command Line Interface (CLI).
|
||||
|
||||
This is a target interface that provides a number of user commands via the
|
||||
RTEMS monitor. To use you need to provide the following in your
|
||||
application initialisation:
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
#include <rtems/capture-cli.h>
|
||||
|
||||
rtems_monitor_init (0);
|
||||
rtems_capture_cli_init (0);
|
||||
|
||||
Check the file capture-cli.h for documentation of the interface. The parameter
|
||||
is a pointer to your board support package's time stamp handler. The time stamp
|
||||
handler is yet to be tested so it is recommended this is left as 0, unless you
|
||||
wish to test this part of the engine.
|
||||
|
||||
The commands are:
|
||||
|
||||
copen - Open the capture engine.
|
||||
cclose - Close the capture engine.
|
||||
cenable - Enable the capture engine.
|
||||
cdisable - Disable the capture engine.
|
||||
ctlist - List the tasks known to the capture engine.
|
||||
ctload - Display the current load (sort of top).
|
||||
cwlist - List the watch and trigger controls.
|
||||
cwadd - Add a watch.
|
||||
cwdel - Delete a watch.
|
||||
cwctl - Enable or disable a watch.
|
||||
cwglob - Enable or disable the global watch.
|
||||
cwceil - Set the watch ceiling.
|
||||
cwfloor - Set the watch floor.
|
||||
ctrace - Dump the trace records.
|
||||
ctrig - Define a trigger.
|
||||
|
||||
Open
|
||||
|
||||
usage: copen [-i] size
|
||||
|
||||
Open the capture engine. The size parameter is the size of the capture engine
|
||||
trace buffer. A single record hold a single event, for example a task create or
|
||||
a context in or out. The option '-i' will enable the capture engine after it is
|
||||
opened.
|
||||
|
||||
Close
|
||||
|
||||
usage: cclose
|
||||
|
||||
Close the capture engine and release all resources held by the capture engine.
|
||||
|
||||
Enable
|
||||
|
||||
usage: cenable
|
||||
|
||||
Enable the capture engine if it has been opened.
|
||||
|
||||
Disable
|
||||
|
||||
usage: cdisable
|
||||
|
||||
Disable the capture engine. The enable and disable commands provide a means of
|
||||
removing the overhead of the capture engine from the context switch. This may
|
||||
be needed when testing if it is felt the capture engines overhead is effecting
|
||||
the system.
|
||||
|
||||
Task List
|
||||
|
||||
usage: ctlist
|
||||
|
||||
List the tasks the capture engine knows about. This may contain tasks that have
|
||||
been deleted.
|
||||
|
||||
Task Load
|
||||
|
||||
usage: ctload
|
||||
|
||||
List the tasks in the order of load in a similar way top does on Unix. The
|
||||
command sends ANSI terminal codes. You press enter to stop the update. The
|
||||
update period is fixed at 5 seconds. The output looks like:
|
||||
|
||||
Press ENTER to exit.
|
||||
|
||||
PID NAME RPRI CPRI STATE %CPU %STK FLGS EXEC TIME
|
||||
04010001 IDLE 255 255 READY 96.012% 0% a-----g 1
|
||||
08010009 CPlt 1 1 READY 3.815% 15% a------ 0
|
||||
08010003 ntwk 20 20 Wevnt 0.072% 0% at----g 0
|
||||
08010004 CSr0 20 20 Wevnt 0.041% 0% at----g 0
|
||||
08010001 main 250 250 DELAY 0.041% 0% a-----g 0
|
||||
08010008 test 100 100 Wevnt 0.000% 20% at-T-+g 0
|
||||
08010007 test 100 100 Wevnt 0.000% 0% at-T-+g 0
|
||||
08010005 CSt0 20 20 Wevnt 0.000% 0% at----g 0
|
||||
08010006 RMON 1 1 Wsem 0.000% 0% a------ 0
|
||||
|
||||
There are 7 flags and from left to right are:
|
||||
|
||||
1) 'a' the task is active, and 'd' the task has been deleted.
|
||||
2) 't' the task has been traced.
|
||||
3) 'F' the task has a from (TO_ANY) trigger.
|
||||
4) 'T' the task has a to (FROM_ANY) trigger.
|
||||
5) 'E' the task has an edge (FROM_TO) trigger.
|
||||
6) '+' the task as a watch control attached, 'w' a watch is enabled.
|
||||
7) 'g' the task is part of a global trigger.
|
||||
|
||||
The %STK is the percentage of stack used by a task. Currently only tasks
|
||||
created while the capture engine is enabled can be monitored.
|
||||
|
||||
The RPRI is the real priority. This is the priority set for the task. The
|
||||
current priority is the executing priority that may reflect a level set as a
|
||||
result of priority inversion.
|
||||
|
||||
Watch List
|
||||
|
||||
usage: cwlist
|
||||
|
||||
This command lists the watch and trigger controls the capture engine has. A
|
||||
control is a structure used by the capture engine to determine if a task is
|
||||
watched or triggers capturing.
|
||||
|
||||
Watch Add
|
||||
|
||||
usage: cwadd [task name] [id]
|
||||
|
||||
Add a watch for a task. You can provide a name or id or both. A name will cause
|
||||
all tasks with that name to have the watch added. An id results in a watch
|
||||
being for a specific task.
|
||||
|
||||
Using a name is useful when the task is not yet created.
|
||||
|
||||
Watch Delete
|
||||
|
||||
usage: cwdel [task name] [id]
|
||||
|
||||
Delete a watch that has been added.
|
||||
|
||||
Watch Control
|
||||
|
||||
usage: cwctl [task name] [id] on/off
|
||||
|
||||
Enable or disable a watch. The name and id parameters are the same as the watch
|
||||
add command.
|
||||
|
||||
Global Watch
|
||||
|
||||
usage: cwglob on/off
|
||||
|
||||
Enable or disable the global watch. A global watch is an easy way to enable
|
||||
watches for all tasks with real priorities between the watch ceiling and floor
|
||||
priorities.
|
||||
|
||||
Watch Priority Ceiling
|
||||
|
||||
usage: cwceil priority
|
||||
|
||||
Set the watch priority ceiling. All tasks with a priority less than the ceiling
|
||||
priority are not watched. This allow you to ignore high priority system and
|
||||
driver tasks.
|
||||
|
||||
Watch Priority Floor
|
||||
|
||||
usage: cwfloor priority
|
||||
|
||||
Set the watch priority floor. All tasks with a priority greater than the floor
|
||||
priority level are not watched. This allows you to remove tasks such as IDLE
|
||||
from being monitored.
|
||||
|
||||
Trace
|
||||
|
||||
usage: ctrace [-c] [-r records]
|
||||
|
||||
Dump the trace record. The option '-c' will output the records in comma
|
||||
separated variables (CSV). The '-r' option controls the number of records
|
||||
dumped. This can help stop the command looping for-ever.
|
||||
|
||||
Trigger
|
||||
|
||||
usage: ctrig type [from name] [from id] [to name] [to id]
|
||||
|
||||
Set a trigger. The types of triggers are :
|
||||
|
||||
from : trigger on a context switch from a task
|
||||
to : trigger on a context switch to a task
|
||||
edge : trigger on a context switch from a task to a task
|
||||
|
||||
The from and to trigger types requires a task name or task id or both be
|
||||
provided. The edge requires a from name and/or id and a to name and/or id be
|
||||
provided.
|
||||
|
||||
Flush
|
||||
|
||||
usage: cflush [-n]
|
||||
|
||||
Flush the trace record. The option '-n' stops the capture engine be
|
||||
primed. This means an exising trigger state will not be cleared and tracing
|
||||
will continue.
|
||||
|
||||
Status.
|
||||
|
||||
The following is a list of outstanding issues or bugs.
|
||||
|
||||
1) The capture engine does not scan the existing list of tasks in the kernel
|
||||
when initialised. This means tasks that exist but are not active are not
|
||||
seen. Not sure how to implement this one.
|
||||
|
||||
2) The blocking read of trace records has not been completely implemented or
|
||||
tested. This will wait until I complete the csv support for the cli for a
|
||||
serial UI or the tcp server is implemented.
|
||||
|
||||
3) Task control block clean up is not implemented. The control block should be
|
||||
dumped to the trace buffer. This requires extended record formats. This can
|
||||
be implemented using an event flag to indicate an extended record follows
|
||||
the trace record. This would allow a task delete record to be directly
|
||||
followed by the task information.
|
||||
|
||||
4) Complete csv (comma separated variable) support for the CLI.
|
||||
|
||||
5) Implement a tcp server interface.
|
||||
|
||||
6) Complete the capture engine API documentation.
|
||||
|
||||
7) Test the user supplied time stamp handler.
|
||||
|
||||
8) Task name support is only for the rtems_name type. This means the only the
|
||||
classic API tasks are currently supported. Partial support for the different
|
||||
task names is provided how-ever this is not clean and does not support the
|
||||
variable length task name such as found in the POSIX tasks.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
------------------------------------------------------------------------
|
||||
$Id$
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Copyright Objective Design Systems Pty Ltd, 2002
|
||||
All rights reserved Objective Design Systems Pty Ltd, 2002
|
||||
Chris Johns (ccj@acm.org)
|
||||
|
||||
COPYRIGHT (c) 1989-1998.
|
||||
On-Line Applications Research Corporation (OAR).
|
||||
|
||||
The license and distribution terms for this file may be
|
||||
found in the file LICENSE in this distribution.
|
||||
|
||||
This software with is provided ``as is'' and with NO WARRANTY.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
RTEMS Performance Monitoring and Measurement Framework.
|
||||
|
||||
This is the Target Interface Command Line Interface. You need
|
||||
start the RTEMS monitor.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __CAPTURE_CLI_H_
|
||||
#define __CAPTURE_CLI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/capture.h>
|
||||
|
||||
/*
|
||||
* rtems_capture_cli_init
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function initialises the command line interface to the capture
|
||||
* engine.
|
||||
*
|
||||
*/
|
||||
rtems_status_code
|
||||
rtems_capture_cli_init (rtems_capture_timestamp timestamp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,59 +0,0 @@
|
||||
## Process this file with autoconf to produce a configure script.
|
||||
##
|
||||
## $Id$
|
||||
|
||||
AC_PREREQ(2.52)
|
||||
AC_INIT([rtems-c-src-libmisc],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com])
|
||||
AC_CONFIG_SRCDIR([dumpbuf])
|
||||
RTEMS_TOP(../../..)
|
||||
AC_CONFIG_AUX_DIR(../../..)
|
||||
|
||||
RTEMS_CANONICAL_TARGET_CPU
|
||||
|
||||
AM_INIT_AUTOMAKE([no-define foreign 1.6])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
RTEMS_ENABLE_BARE
|
||||
|
||||
RTEMS_ENV_RTEMSBSP
|
||||
RTEMS_CHECK_CPU
|
||||
RTEMS_CANONICAL_HOST
|
||||
|
||||
RTEMS_PROJECT_ROOT
|
||||
|
||||
RTEMS_PROG_CC_FOR_TARGET
|
||||
RTEMS_CANONICALIZE_TOOLS
|
||||
|
||||
RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
|
||||
|
||||
AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes")
|
||||
|
||||
# shell/* wants to assign file descriptors to stdio file descriptors.
|
||||
AC_MSG_CHECKING([for assignable stdio])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <stdio.h>],
|
||||
[stdin = fopen("/tmp", "r")])],
|
||||
[HAVE_ASSIGNABLE_STDIO=yes],
|
||||
[HAVE_ASSIGNABLE_STDIO=no])
|
||||
AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
|
||||
|
||||
AM_CONDITIONAL([RTEMS_LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
|
||||
|
||||
# Explicitly list all Makefiles here
|
||||
AC_CONFIG_FILES([Makefile
|
||||
cpuuse/Makefile
|
||||
shell/Makefile
|
||||
devnull/Makefile
|
||||
dummy/Makefile
|
||||
dumpbuf/Makefile
|
||||
monitor/Makefile
|
||||
rtmonuse/Makefile
|
||||
serdbg/Makefile
|
||||
stackchk/Makefile
|
||||
capture/Makefile
|
||||
untar/Makefile
|
||||
mw-fb/Makefile
|
||||
wrapup/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,42 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libcpuuse-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
C_FILES = cpuuse.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
|
||||
include_rtems_HEADERS = cpuuse.h
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
@$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = README cpuuse.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
This directory contains a stack bounds checker. It provides two
|
||||
primary features:
|
||||
|
||||
+ check for stack overflow at each context switch
|
||||
+ provides an educated guess at each task's stack usage
|
||||
|
||||
The stack overflow check at context switch works by looking for
|
||||
a 16 byte pattern at the logical end of the stack to be corrupted.
|
||||
The "guesser" assumes that the entire stack was prefilled with a known
|
||||
pattern and assumes that the pattern is still in place if the memory
|
||||
has not been used as a stack.
|
||||
|
||||
Both of these can be fooled by pushing large holes onto the stack
|
||||
and not writing to them... or (much more unlikely) writing the
|
||||
magic patterns into memory.
|
||||
|
||||
This code has not been extensively tested. It is provided as a tool
|
||||
for RTEMS users to catch the most common mistake in multitasking
|
||||
systems ... too little stack space. Suggestions and comments are appreciated.
|
||||
|
||||
NOTES:
|
||||
|
||||
1. Stack usage information is questionable on CPUs which push
|
||||
large holes on stack.
|
||||
|
||||
2. The stack checker has a tendency to generate a fault when
|
||||
trying to print the helpful diagnostic message. If it comes
|
||||
out, congratulations. If not, then the variable Stack_check_Blown_task
|
||||
contains a pointer to the TCB of the offending task. This
|
||||
is usually enough to go on.
|
||||
|
||||
FUTURE:
|
||||
|
||||
1. Determine how/if gcc will generate stack probe calls and support that.
|
||||
|
||||
2. Get accurate stack usage numbers on i960.. it pushes very large
|
||||
holes on the stack.
|
||||
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
* CPU Usage Reporter
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999. 1996.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <rtems/cpuuse.h>
|
||||
|
||||
unsigned32 CPU_usage_Ticks_at_last_reset;
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* CPU_usage_Dump
|
||||
*/
|
||||
|
||||
void CPU_usage_Dump( void )
|
||||
{
|
||||
unsigned32 i;
|
||||
unsigned32 api_index;
|
||||
Thread_Control *the_thread;
|
||||
Objects_Information *information;
|
||||
unsigned32 u32_name;
|
||||
char name[5];
|
||||
unsigned32 total_units = 0;
|
||||
|
||||
for ( api_index = 1 ;
|
||||
api_index <= OBJECTS_APIS_LAST ;
|
||||
api_index++ ) {
|
||||
if ( !_Objects_Information_table[ api_index ] )
|
||||
continue;
|
||||
information = _Objects_Information_table[ api_index ][ 1 ];
|
||||
if ( information ) {
|
||||
for ( i=1 ; i <= information->maximum ; i++ ) {
|
||||
the_thread = (Thread_Control *)information->local_table[ i ];
|
||||
|
||||
if ( the_thread )
|
||||
total_units += the_thread->ticks_executed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("CPU Usage by thread\n");
|
||||
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
|
||||
printf( " ID NAME TICKS PERCENT\n" );
|
||||
#else
|
||||
printf( " ID NAME TICKS\n" );
|
||||
#endif
|
||||
|
||||
for ( api_index = 1 ;
|
||||
api_index <= OBJECTS_APIS_LAST ;
|
||||
api_index++ ) {
|
||||
if ( !_Objects_Information_table[ api_index ] )
|
||||
continue;
|
||||
information = _Objects_Information_table[ api_index ][ 1 ];
|
||||
if ( information ) {
|
||||
for ( i=1 ; i <= information->maximum ; i++ ) {
|
||||
the_thread = (Thread_Control *)information->local_table[ i ];
|
||||
|
||||
if ( !the_thread )
|
||||
continue;
|
||||
|
||||
if ( information->is_string )
|
||||
u32_name = *(unsigned32 *)the_thread->Object.name;
|
||||
else
|
||||
u32_name = (unsigned32)the_thread->Object.name;
|
||||
|
||||
name[ 0 ] = (u32_name >> 24) & 0xff;
|
||||
name[ 1 ] = (u32_name >> 16) & 0xff;
|
||||
name[ 2 ] = (u32_name >> 8) & 0xff;
|
||||
name[ 3 ] = (u32_name >> 0) & 0xff;
|
||||
name[ 4 ] = '\0';
|
||||
|
||||
if ( !isprint(name[0]) ) name[0] = '*';
|
||||
if ( !isprint(name[1]) ) name[1] = '*';
|
||||
if ( !isprint(name[2]) ) name[2] = '*';
|
||||
if ( !isprint(name[3]) ) name[3] = '*';
|
||||
|
||||
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
|
||||
printf( "0x%08x %4s %8d %5.3f\n",
|
||||
the_thread->Object.id,
|
||||
name,
|
||||
the_thread->ticks_executed,
|
||||
(total_units) ?
|
||||
(double)the_thread->ticks_executed / (double)total_units :
|
||||
(double)total_units
|
||||
);
|
||||
#else
|
||||
printf( "0x%08x %4s %8d\n",
|
||||
the_thread->Object.id,
|
||||
name,
|
||||
the_thread->ticks_executed
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf(
|
||||
"\nTicks since last reset = %d\n",
|
||||
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
|
||||
);
|
||||
printf( "\nTotal Units = %d\n", total_units );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* CPU_usage_Reset
|
||||
*/
|
||||
|
||||
void CPU_usage_Reset( void )
|
||||
{
|
||||
unsigned32 i;
|
||||
unsigned32 api_index;
|
||||
Thread_Control *the_thread;
|
||||
Objects_Information *information;
|
||||
|
||||
CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
|
||||
|
||||
for ( api_index = 1 ;
|
||||
api_index <= OBJECTS_APIS_LAST ;
|
||||
api_index++ ) {
|
||||
if ( !_Objects_Information_table[ api_index ] )
|
||||
continue;
|
||||
information = _Objects_Information_table[ api_index ][ 1 ];
|
||||
if ( information ) {
|
||||
for ( i=1 ; i <= information->maximum ; i++ ) {
|
||||
the_thread = (Thread_Control *)information->local_table[ i ];
|
||||
|
||||
if ( !the_thread )
|
||||
continue;
|
||||
|
||||
the_thread->ticks_executed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/* cpuuse.h
|
||||
*
|
||||
* This include file contains information necessary to utilize
|
||||
* and install the cpu usage reporting mechanism.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999. 1996.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __CPU_USE_h
|
||||
#define __CPU_USE_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CPU_usage_Dump
|
||||
*/
|
||||
|
||||
void CPU_usage_Dump( void );
|
||||
|
||||
/*
|
||||
* CPU_usage_Reset
|
||||
*/
|
||||
|
||||
void CPU_usage_Reset( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,42 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libdevnull-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
C_FILES = devnull.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
|
||||
include_rtems_HEADERS = devnull.h
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
@$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = devnull.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,180 +0,0 @@
|
||||
/* /dev/null
|
||||
*
|
||||
* Derived from rtems' stub driver.
|
||||
*
|
||||
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2000.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/devnull.h>
|
||||
#include <rtems/libio.h>
|
||||
|
||||
/* null_initialize
|
||||
*
|
||||
* This routine is the null device driver init routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargp - pointer to parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_unsigned32 NULL_major;
|
||||
static char initialized;
|
||||
|
||||
rtems_device_driver null_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
rtems_device_driver status;
|
||||
|
||||
if ( !initialized ) {
|
||||
initialized = 1;
|
||||
|
||||
status = rtems_io_register_name(
|
||||
"/dev/null",
|
||||
major,
|
||||
(rtems_device_minor_number) 0
|
||||
);
|
||||
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred(status);
|
||||
|
||||
NULL_major = major;
|
||||
}
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/* null_open
|
||||
*
|
||||
* This routine is the null device driver open routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargb - pointer to open parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_device_driver null_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
return NULL_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
/* null_close
|
||||
*
|
||||
* This routine is the null device driver close routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargb - pointer to close parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_device_driver null_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
return NULL_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
/* null_read
|
||||
*
|
||||
* This routine is the null device driver read routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargp - pointer to read parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_device_driver null_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
return NULL_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
/* null_write
|
||||
*
|
||||
* This routine is the null device driver write routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargp - pointer to write parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_device_driver null_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
|
||||
|
||||
if ( rw_args )
|
||||
rw_args->bytes_moved = rw_args->count;
|
||||
|
||||
return NULL_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
/* null_control
|
||||
*
|
||||
* This routine is the null device driver control routine.
|
||||
*
|
||||
* Input parameters:
|
||||
* major - device major number
|
||||
* minor - device minor number
|
||||
* pargp - pointer to cntrl parameter block
|
||||
*
|
||||
* Output parameters:
|
||||
* rval - NULL_SUCCESSFUL
|
||||
*/
|
||||
|
||||
rtems_device_driver null_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp
|
||||
)
|
||||
{
|
||||
return NULL_SUCCESSFUL;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/* devnull.h
|
||||
*
|
||||
* Null device driver, derived from rtems' stub driver.
|
||||
*
|
||||
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2000.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __NULL_DRIVER_h
|
||||
#define __NULL_DRIVER_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEVNULL_DRIVER_TABLE_ENTRY \
|
||||
{ null_initialize, null_open, null_close, null_read, \
|
||||
null_write, null_control }
|
||||
|
||||
#define NULL_SUCCESSFUL RTEMS_SUCCESSFUL
|
||||
|
||||
rtems_device_driver null_initialize(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
rtems_device_driver null_open(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
rtems_device_driver null_close(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
rtems_device_driver null_read(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
rtems_device_driver null_write(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
rtems_device_driver null_control(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
void *
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,32 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
LIBNAME = libdummy-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
C_FILES = dummy.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(PGMNAME)$(LIB_VARIANT).rel
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = README dummy.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,23 +0,0 @@
|
||||
dummy.rel
|
||||
=========
|
||||
|
||||
A relocatible objects which contains a dummy configuration for RTEMS.
|
||||
|
||||
Helps linking standard c-program code with RTEMS, which shall *not* be run
|
||||
on a target, such as configure script code fragments generated by autoconf's
|
||||
AC_TRY_LINK.
|
||||
|
||||
Example:
|
||||
|
||||
tar xzvf somepkg.tar.gz
|
||||
cd somepkg
|
||||
|
||||
LDFLAGS=/usr/local/rtems/<cpu>-rtems/<bsp>/lib/dummy.rel \
|
||||
CC="<cpu>-rtems-gcc \
|
||||
-B/usr/local/rtems/<cpu>-rtems/<bsp>/lib/ -specs bsp_specs -qrtems" \
|
||||
CC_FOR_BUILD="gcc" \
|
||||
configure --host=<cpu>-rtems --build=i686-pc-linux-gnu
|
||||
make
|
||||
|
||||
History:
|
||||
Starting dummy.c with a copy of rtems-19990528/c/src/tests/samples/minimum/init.c
|
||||
@@ -1,42 +0,0 @@
|
||||
/* Init
|
||||
*
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
int main( int, char **, char **);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
#define CONFIGURE_MAXIMUM_TASKS 10
|
||||
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
|
||||
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
|
||||
#define CONFIGURE_INIT_TASK_ENTRY_POINT (void *)main
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_INIT
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,42 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libdumpbuf-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
C_FILES = dumpbuf.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
|
||||
include_rtems_HEADERS = dumpbuf.h
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
@$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = dumpbuf.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1997.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may in
|
||||
* the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <rtems/dumpbuf.h>
|
||||
|
||||
/*
|
||||
* Put the body below Dump_Buffer so it won't get inlined.
|
||||
*/
|
||||
|
||||
static inline void Dump_Line(
|
||||
unsigned char *buffer,
|
||||
int length
|
||||
);
|
||||
|
||||
void Dump_Buffer(
|
||||
unsigned char *buffer,
|
||||
int length
|
||||
)
|
||||
{
|
||||
|
||||
int i, mod, max;
|
||||
|
||||
if ( !length ) return;
|
||||
|
||||
mod = length % 16;
|
||||
|
||||
max = length - mod;
|
||||
|
||||
for ( i=0 ; i<max ; i+=16 )
|
||||
Dump_Line( &buffer[ i ], 16 );
|
||||
|
||||
if ( mod )
|
||||
Dump_Line( &buffer[ max ], mod );
|
||||
}
|
||||
|
||||
static inline void Dump_Line(
|
||||
unsigned char *buffer,
|
||||
int length
|
||||
)
|
||||
{
|
||||
|
||||
int i;
|
||||
char line_buffer[120];
|
||||
|
||||
line_buffer[0] = '\0';
|
||||
|
||||
for( i=0 ; i<length ; i++ )
|
||||
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
|
||||
|
||||
for( ; i<16 ; i++ )
|
||||
strcat( line_buffer, " " );
|
||||
|
||||
strcat( line_buffer, "|" );
|
||||
for( i=0 ; i<length ; i++ )
|
||||
sprintf( line_buffer, "%s%c", line_buffer,
|
||||
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
|
||||
|
||||
for( ; i<16 ; i++ )
|
||||
strcat( line_buffer, " " );
|
||||
|
||||
strcat( line_buffer, "|\n" );
|
||||
|
||||
printf( line_buffer );
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1997.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may in
|
||||
* the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __DUMP_BUFFER_h
|
||||
#define __DUMP_BUFFER_h
|
||||
|
||||
void Dump_Buffer(
|
||||
unsigned char *buffer,
|
||||
int length
|
||||
);
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,55 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libmonitor-tmp
|
||||
LIB = $(ARCH)/$(LIBNAME).a
|
||||
|
||||
# We only build multiprocessing related files if HAS_MP was defined
|
||||
MP_C_FILES = mon-mpci.c
|
||||
|
||||
C_FILES = mon-command.c mon-symbols.c mon-prmisc.c mon-monitor.c \
|
||||
mon-object.c mon-server.c mon-task.c mon-queue.c mon-driver.c \
|
||||
mon-dname.c mon-itask.c mon-extension.c mon-manager.c mon-config.c
|
||||
|
||||
if HAS_MP
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) $(MP_C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
else
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
|
||||
endif
|
||||
|
||||
include_rtems_HEADERS = monitor.h symbols.h
|
||||
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = README mon-command.c mon-config.c mon-dname.c mon-driver.c \
|
||||
mon-extension.c mon-itask.c mon-manager.c mon-monitor.c mon-mpci.c \
|
||||
mon-object.c mon-prmisc.c mon-queue.c mon-server.c mon-symbols.c \
|
||||
mon-task.c
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
@@ -1,97 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
monitor task
|
||||
|
||||
The monitor task is an optional task that knows about RTEMS
|
||||
data structures and can print out information about them.
|
||||
It is a work-in-progress and needs many more commands, but
|
||||
is useful now.
|
||||
|
||||
The monitor works best when it is the highest priority task,
|
||||
so all your other tasks should ideally be at some priority
|
||||
greater than 1.
|
||||
|
||||
To use the monitor:
|
||||
-------------------
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
...
|
||||
|
||||
rtems_monitor_init(0);
|
||||
|
||||
The parameter to rtems_monitor_init() tells the monitor whether
|
||||
to suspend itself on startup. A value of 0 causes the monitor
|
||||
to immediately enter command mode; a non-zero value causes the
|
||||
monitor to suspend itself after creation and wait for explicit
|
||||
wakeup.
|
||||
|
||||
|
||||
rtems_monitor_wakeup();
|
||||
|
||||
wakes up a suspended monitor and causes it to reenter command mode.
|
||||
|
||||
Monitor commands
|
||||
----------------
|
||||
|
||||
The monitor prompt is 'rtems> '.
|
||||
Can abbreviate commands to "uniquity"
|
||||
There is a 'help' command. Here is the output from various
|
||||
help commands:
|
||||
|
||||
Commands (may be abbreviated)
|
||||
|
||||
help -- get this message or command specific help
|
||||
task -- show task information
|
||||
queue -- show message queue information
|
||||
symbol -- show entries from symbol table
|
||||
pause -- pause monitor for a specified number of ticks
|
||||
fatal -- invoke a fatal RTEMS error
|
||||
|
||||
task [id [id ...] ]
|
||||
display information about the specified tasks.
|
||||
Default is to display information about all tasks on this node
|
||||
|
||||
queue [id [id ... ] ]
|
||||
display information about the specified message queues
|
||||
Default is to display information about all queues on this node
|
||||
|
||||
symbol [ symbolname [symbolname ... ] ]
|
||||
display value associated with specified symbol.
|
||||
Defaults to displaying all known symbols.
|
||||
|
||||
pause [ticks]
|
||||
monitor goes to "sleep" for specified ticks (default is 1)
|
||||
monitor will resume at end of period or if explicitly awakened
|
||||
|
||||
fatal [status]
|
||||
Invoke 'rtems_fatal_error_occurred' with 'status'
|
||||
(default is RTEMS_INTERNAL_ERROR)
|
||||
|
||||
continue
|
||||
put the monitor to sleep waiting for an explicit wakeup from the
|
||||
program running.
|
||||
|
||||
|
||||
Sample output from 'task' command
|
||||
---------------------------------
|
||||
|
||||
rtems> task
|
||||
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES
|
||||
------------------------------------------------------------------------
|
||||
00010001 UI1 2 READY P:T:nA NONE15: 0x40606348
|
||||
00010002 RMON 1 READY nP NONE15: 0x40604110
|
||||
|
||||
'RMON' is the monitor itself, so we have 1 "user" task.
|
||||
Its modes are P:T:nA which translate to:
|
||||
|
||||
preemptable
|
||||
timesliced
|
||||
no ASRS
|
||||
|
||||
It has no events.
|
||||
It has a notepad value for notepad 15 which is 0x40606348
|
||||
(this is the libc thread state)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* RTEMS Config display support
|
||||
*
|
||||
* TODO
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* strtoul() */
|
||||
|
||||
#define DATACOL 15
|
||||
#define CONTCOL DATACOL /* continued col */
|
||||
|
||||
/*
|
||||
* Fill in entire monitor config table
|
||||
* for sending to a remote monitor or printing on the local system
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_config_canonical(
|
||||
rtems_monitor_config_t *canonical_config,
|
||||
void *config_void
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = (rtems_configuration_table *) config_void;
|
||||
rtems_api_configuration_table *r = c->RTEMS_api_configuration;
|
||||
|
||||
canonical_config->work_space_start = c->work_space_start;
|
||||
canonical_config->work_space_size = c->work_space_size;
|
||||
canonical_config->maximum_tasks = r->maximum_tasks;
|
||||
canonical_config->maximum_timers = r->maximum_timers;
|
||||
canonical_config->maximum_semaphores = r->maximum_semaphores;
|
||||
canonical_config->maximum_message_queues = r->maximum_message_queues;
|
||||
canonical_config->maximum_partitions = r->maximum_partitions;
|
||||
canonical_config->maximum_regions = r->maximum_regions;
|
||||
canonical_config->maximum_ports = r->maximum_ports;
|
||||
canonical_config->maximum_periods = r->maximum_periods;
|
||||
canonical_config->maximum_extensions = c->maximum_extensions;
|
||||
canonical_config->microseconds_per_tick = c->microseconds_per_tick;
|
||||
canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
|
||||
canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is easy, since there is only 1 (altho we could get them from
|
||||
* other nodes...)
|
||||
*/
|
||||
|
||||
void *
|
||||
rtems_monitor_config_next(
|
||||
void *object_info,
|
||||
rtems_monitor_config_t *canonical_config,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = _Configuration_Table;
|
||||
int n = rtems_get_index(*next_id);
|
||||
|
||||
if (n >= 1)
|
||||
goto failed;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) c;
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_config_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
INITIAL (startup) Configuration Info\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_config_dump(
|
||||
rtems_monitor_config_t *monitor_config,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length = 0;
|
||||
length += printf("WORKSPACE");
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
length += printf("start: 0x%x; size: 0x%x\n",
|
||||
(unsigned32) monitor_config->work_space_start,
|
||||
monitor_config->work_space_size);
|
||||
|
||||
length = 0;
|
||||
length += printf("TIME");
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
|
||||
monitor_config->microseconds_per_tick,
|
||||
monitor_config->ticks_per_timeslice,
|
||||
1000000 / monitor_config->microseconds_per_tick);
|
||||
|
||||
length = 0;
|
||||
length += printf("MAXIMUMS");
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
|
||||
monitor_config->maximum_tasks,
|
||||
monitor_config->maximum_timers,
|
||||
monitor_config->maximum_semaphores,
|
||||
monitor_config->maximum_message_queues,
|
||||
monitor_config->maximum_extensions);
|
||||
length = 0;
|
||||
length += rtems_monitor_pad(CONTCOL, length);
|
||||
length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
|
||||
monitor_config->maximum_partitions,
|
||||
monitor_config->maximum_regions,
|
||||
monitor_config->maximum_ports,
|
||||
monitor_config->maximum_periods);
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* RTEMS monitor driver names support.
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
*
|
||||
* 1. Regular RTEMS drivers.
|
||||
* This is a table indexed by major device number and
|
||||
* containing driver entry points only.
|
||||
*
|
||||
* 2. Driver name table.
|
||||
* A separate table of names for drivers.
|
||||
* The table converts driver names to a major number
|
||||
* as index into the driver table and a minor number
|
||||
* for an argument to driver.
|
||||
*
|
||||
* Drivers are displayed with 'driver' command.
|
||||
* Names are displayed with 'dname' command.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* strtoul() */
|
||||
#include <string.h> /* strncpy() */
|
||||
|
||||
#define DATACOL 15
|
||||
#define CONTCOL DATACOL /* continued col */
|
||||
|
||||
void
|
||||
rtems_monitor_dname_canonical(
|
||||
rtems_monitor_dname_t *canonical_dname,
|
||||
void *dname_void
|
||||
)
|
||||
{
|
||||
rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
|
||||
|
||||
(void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
|
||||
canonical_dname->major = np->major;
|
||||
canonical_dname->minor = np->minor;
|
||||
}
|
||||
|
||||
void *
|
||||
rtems_monitor_dname_next(
|
||||
void *object_information,
|
||||
rtems_monitor_dname_t *canonical_dname,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 n = rtems_get_index(*next_id);
|
||||
rtems_driver_name_t *table = _IO_Driver_name_table;
|
||||
rtems_driver_name_t *np = 0;
|
||||
|
||||
/* XXX should we be using _IO_Number_of_devices */
|
||||
for (np = table + n ; n<_IO_Number_of_devices; n++, np++)
|
||||
if (np->device_name)
|
||||
goto done;
|
||||
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
|
||||
done:
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
/*
|
||||
* dummy up a fake id and name for this item
|
||||
*/
|
||||
|
||||
canonical_dname->id = n;
|
||||
canonical_dname->name = rtems_build_name('-', '-', '-', '-');
|
||||
|
||||
*next_id += 1;
|
||||
return np;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_dname_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
Major:Minor Name\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_dname_dump(
|
||||
rtems_monitor_dname_t *monitor_dname,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length += rtems_monitor_pad(6, length);
|
||||
length += rtems_monitor_dump_hex(monitor_dname->major);
|
||||
length += printf(":");
|
||||
length += rtems_monitor_dump_hex(monitor_dname->minor);
|
||||
|
||||
length += rtems_monitor_pad(16, length);
|
||||
length += printf("%.*s",
|
||||
(int) sizeof(monitor_dname->name_string),
|
||||
(char *) monitor_dname->name_string);
|
||||
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* RTEMS monitor IO (device drivers) support
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
*
|
||||
* 1. Regular RTEMS drivers.
|
||||
* This is a table indexed by major device number and
|
||||
* containing driver entry points only.
|
||||
*
|
||||
* 2. Driver name table.
|
||||
* A separate table of names for drivers.
|
||||
* The table converts driver names to a major number
|
||||
* as index into the driver table and a minor number
|
||||
* for an argument to driver.
|
||||
*
|
||||
* Drivers are displayed with 'driver' command.
|
||||
* Names are displayed with 'name' command.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* strtoul() */
|
||||
|
||||
#define DATACOL 15
|
||||
#define CONTCOL DATACOL /* continued col */
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_driver_canonical(
|
||||
rtems_monitor_driver_t *canonical_driver,
|
||||
void *driver_void
|
||||
)
|
||||
{
|
||||
rtems_driver_address_table *d = (rtems_driver_address_table *) driver_void;
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->initialization,
|
||||
(void *) d->initialization_entry);
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->open,
|
||||
(void *) d->open_entry);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->close,
|
||||
(void *) d->close_entry);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->read,
|
||||
(void *) d->read_entry);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->write,
|
||||
(void *) d->write_entry);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_driver->control,
|
||||
(void *) d->control_entry);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
rtems_monitor_driver_next(
|
||||
void *object_info,
|
||||
rtems_monitor_driver_t *canonical_driver,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = _Configuration_Table;
|
||||
rtems_unsigned32 n = rtems_get_index(*next_id);
|
||||
|
||||
if (n >= c->number_of_device_drivers)
|
||||
goto failed;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
/*
|
||||
* dummy up a fake id and name for this item
|
||||
*/
|
||||
|
||||
canonical_driver->id = n;
|
||||
canonical_driver->name = rtems_build_name('-', '-', '-', '-');
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) (c->Device_driver_table + n);
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_driver_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
Major Entry points\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_driver_dump(
|
||||
rtems_monitor_driver_t *monitor_driver,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length += printf(" %d", monitor_driver->id);
|
||||
|
||||
length += rtems_monitor_pad(13, length);
|
||||
length += printf("init: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
|
||||
length += printf("; control: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
|
||||
length += rtems_monitor_pad(13, length);
|
||||
|
||||
length += printf("open: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
|
||||
length += printf("; close: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
|
||||
length += rtems_monitor_pad(13, length);
|
||||
|
||||
length += printf("read: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
|
||||
length += printf("; write: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* RTEMS Monitor extension support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
rtems_monitor_extension_canonical(
|
||||
rtems_monitor_extension_t *canonical_extension,
|
||||
void *extension_void
|
||||
)
|
||||
{
|
||||
Extension_Control *rtems_extension = (Extension_Control *) extension_void;
|
||||
rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
|
||||
(void *) e->thread_create);
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
|
||||
(void *) e->thread_start);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
|
||||
(void *) e->thread_restart);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
|
||||
(void *) e->thread_delete);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
|
||||
(void *) e->thread_switch);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
|
||||
(void *) e->thread_begin);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
|
||||
(void *) e->thread_exitted);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
|
||||
(void *) e->fatal);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_extension_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
ID NAME\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Dump out the canonical form
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_extension_dump(
|
||||
rtems_monitor_extension_t *monitor_extension,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_extension->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_extension->name);
|
||||
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += printf("create: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
|
||||
length += printf("; start: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
|
||||
length += printf("; restart: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += printf("delete: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
|
||||
length += printf("; switch: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
|
||||
length += printf("; begin: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += printf("exitted: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
|
||||
length += printf("; fatal: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
|
||||
length += printf("\n");
|
||||
length = 0;
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* RTEMS Monitor init task support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* As above, but just for init tasks
|
||||
*/
|
||||
void
|
||||
rtems_monitor_init_task_canonical(
|
||||
rtems_monitor_init_task_t *canonical_itask,
|
||||
void *itask_void
|
||||
)
|
||||
{
|
||||
rtems_initialization_tasks_table *rtems_itask = itask_void;
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
|
||||
(void *) rtems_itask->entry_point);
|
||||
|
||||
canonical_itask->argument = rtems_itask->argument;
|
||||
canonical_itask->stack_size = rtems_itask->stack_size;
|
||||
canonical_itask->priority = rtems_itask->initial_priority;
|
||||
canonical_itask->modes = rtems_itask->mode_set;
|
||||
canonical_itask->attributes = rtems_itask->attribute_set;
|
||||
}
|
||||
|
||||
void *
|
||||
rtems_monitor_init_task_next(
|
||||
void *object_info,
|
||||
rtems_monitor_init_task_t *canonical_init_task,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = _Configuration_Table;
|
||||
rtems_initialization_tasks_table *itask;
|
||||
rtems_unsigned32 n = rtems_get_index(*next_id);
|
||||
|
||||
if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
|
||||
goto failed;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
|
||||
|
||||
/*
|
||||
* dummy up a fake id and name for this item
|
||||
*/
|
||||
|
||||
canonical_init_task->id = n;
|
||||
canonical_init_task->name = itask->name;
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) itask;
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_init_task_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
# NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_init_task_dump(
|
||||
rtems_monitor_init_task_t *monitor_itask,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
int length = 0;
|
||||
|
||||
length += rtems_monitor_dump_decimal(monitor_itask->id);
|
||||
|
||||
length += rtems_monitor_pad(7, length);
|
||||
length += rtems_monitor_dump_name(monitor_itask->name);
|
||||
|
||||
length += rtems_monitor_pad(14, length);
|
||||
length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
|
||||
|
||||
length += rtems_monitor_pad(25, length);
|
||||
length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
|
||||
|
||||
length += rtems_monitor_pad(39, length);
|
||||
length += rtems_monitor_dump_priority(monitor_itask->priority);
|
||||
|
||||
length += rtems_monitor_pad(46, length);
|
||||
length += rtems_monitor_dump_modes(monitor_itask->modes);
|
||||
|
||||
length += rtems_monitor_pad(54, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_itask->attributes);
|
||||
|
||||
length += rtems_monitor_pad(66, length);
|
||||
length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* "next" routine for all objects that are RTEMS manager objects
|
||||
*/
|
||||
|
||||
void *
|
||||
rtems_monitor_manager_next(
|
||||
void *table_void,
|
||||
void *canonical,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
Objects_Information *table = table_void;
|
||||
rtems_monitor_generic_t *copy;
|
||||
Objects_Control *object = 0;
|
||||
Objects_Locations location;
|
||||
|
||||
/*
|
||||
* When we are called, it must be local
|
||||
*/
|
||||
|
||||
if ( ! _Objects_Is_local_id(*next_id))
|
||||
goto done;
|
||||
|
||||
object = _Objects_Get_next(table, *next_id, &location, next_id);
|
||||
|
||||
if (object)
|
||||
{
|
||||
copy = (rtems_monitor_generic_t *) canonical;
|
||||
copy->id = object->id;
|
||||
if(table->is_string)
|
||||
_Objects_Copy_name_raw(object->name, ©->name, sizeof(copy->name));
|
||||
else
|
||||
_Objects_Copy_name_raw(&object->name, ©->name, sizeof(copy->name));
|
||||
}
|
||||
|
||||
done:
|
||||
return object;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
* RTEMS MPCI Config display support
|
||||
*
|
||||
* TODO
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* strtoul() */
|
||||
|
||||
#define DATACOL 15
|
||||
|
||||
/*
|
||||
* Fill in entire monitor config table
|
||||
* for sending to a remote monitor or printing on the local system
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_mpci_canonical(
|
||||
rtems_monitor_mpci_t *canonical_mpci,
|
||||
void *config_void
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = _Configuration_Table;
|
||||
rtems_multiprocessing_table *m;
|
||||
rtems_mpci_table *mt;
|
||||
|
||||
m = c->User_multiprocessing_table;
|
||||
if (m == 0)
|
||||
return;
|
||||
mt = m->User_mpci_table;
|
||||
|
||||
canonical_mpci->node = m->node;
|
||||
canonical_mpci->maximum_nodes = m->maximum_nodes;
|
||||
canonical_mpci->maximum_global_objects = m->maximum_global_objects;
|
||||
canonical_mpci->maximum_proxies = m->maximum_proxies;
|
||||
|
||||
canonical_mpci->default_timeout = mt->default_timeout;
|
||||
canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
|
||||
(void *) mt->initialization);
|
||||
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
|
||||
(void *) mt->get_packet);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
|
||||
(void *) mt->return_packet);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
|
||||
(void *) mt->send_packet);
|
||||
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
|
||||
(void *) mt->receive_packet);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is easy, since there is only 1 (altho we could get them from
|
||||
* other nodes...)
|
||||
*/
|
||||
|
||||
void *
|
||||
rtems_monitor_mpci_next(
|
||||
void *object_info,
|
||||
rtems_monitor_mpci_t *canonical_mpci,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_configuration_table *c = _Configuration_Table;
|
||||
int n = rtems_get_index(*next_id);
|
||||
|
||||
if (n >= 1)
|
||||
goto failed;
|
||||
|
||||
if ( ! c->User_multiprocessing_table)
|
||||
goto failed;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) c;
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_mpci_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
max max max default max\n\
|
||||
node nodes globals proxies timeout pktsize\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_mpci_dump(
|
||||
rtems_monitor_mpci_t *monitor_mpci,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length += rtems_monitor_pad(2, length);
|
||||
length += printf(" %d", monitor_mpci->node);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += printf("%d", monitor_mpci->maximum_nodes);
|
||||
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
|
||||
|
||||
length += rtems_monitor_pad(28, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
|
||||
|
||||
length += rtems_monitor_pad(37, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
|
||||
|
||||
length += rtems_monitor_pad(46, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
|
||||
|
||||
printf("\n");
|
||||
length = 0;
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
|
||||
length += printf("init: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
|
||||
|
||||
printf("\n");
|
||||
length = 0;
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
|
||||
length += printf("get: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
|
||||
length += printf("; return: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
|
||||
|
||||
printf("\n");
|
||||
length = 0;
|
||||
length += rtems_monitor_pad(DATACOL, length);
|
||||
|
||||
length += printf("send: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
|
||||
length += printf("; receive: ");
|
||||
length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
|
||||
|
||||
printf("\n");
|
||||
length = 0;
|
||||
}
|
||||
@@ -1,383 +0,0 @@
|
||||
/*
|
||||
* RTEMS Monitor "object" support.
|
||||
*
|
||||
* Used to traverse object lists and print them out.
|
||||
* An object can be an RTEMS object (chain based stuff) or
|
||||
* a "misc" object such as a device driver.
|
||||
*
|
||||
* Each object has its own file in this directory (eg: extension.c)
|
||||
* That file provides routines to convert a "native" structure
|
||||
* to its canonical form, print a canonical structure, etc.
|
||||
*
|
||||
* TODO:
|
||||
* should allow for non-numeric id's???
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* strtoul() */
|
||||
#include <string.h> /* memcpy() */
|
||||
|
||||
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
/*
|
||||
* add:
|
||||
* next
|
||||
*/
|
||||
|
||||
rtems_monitor_object_info_t rtems_monitor_object_info[] =
|
||||
{
|
||||
{ RTEMS_MONITOR_OBJECT_CONFIG,
|
||||
(void *) 0,
|
||||
sizeof(rtems_monitor_config_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_config_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_config_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_config_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_config_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_MPCI,
|
||||
(void *) 0,
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
sizeof(rtems_monitor_mpci_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_mpci_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump,
|
||||
#else
|
||||
0,
|
||||
(rtems_monitor_object_next_fn) 0,
|
||||
(rtems_monitor_object_canonical_fn) 0,
|
||||
(rtems_monitor_object_dump_header_fn) 0,
|
||||
(rtems_monitor_object_dump_fn) 0,
|
||||
#endif
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_INIT_TASK,
|
||||
(void *) 0,
|
||||
sizeof(rtems_monitor_init_task_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_init_task_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_init_task_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_init_task_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_init_task_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_TASK,
|
||||
(void *) &_RTEMS_tasks_Information,
|
||||
sizeof(rtems_monitor_task_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_manager_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_task_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_task_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_task_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_QUEUE,
|
||||
(void *) &_Message_queue_Information,
|
||||
sizeof(rtems_monitor_queue_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_manager_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_queue_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_queue_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_queue_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_EXTENSION,
|
||||
(void *) &_Extension_Information,
|
||||
sizeof(rtems_monitor_extension_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_manager_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_extension_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_extension_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_extension_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_DRIVER,
|
||||
(void *) 0,
|
||||
sizeof(rtems_monitor_driver_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_driver_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_driver_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_driver_dump,
|
||||
},
|
||||
{ RTEMS_MONITOR_OBJECT_DNAME,
|
||||
/* XXX now that the driver name table is allocated from the */
|
||||
/* XXX Workspace, this does not work */
|
||||
(void *) 0,
|
||||
/* (void *) _IO_Driver_name_table, */
|
||||
sizeof(rtems_monitor_dname_t),
|
||||
(rtems_monitor_object_next_fn) rtems_monitor_dname_next,
|
||||
(rtems_monitor_object_canonical_fn) rtems_monitor_dname_canonical,
|
||||
(rtems_monitor_object_dump_header_fn) rtems_monitor_dname_dump_header,
|
||||
(rtems_monitor_object_dump_fn) rtems_monitor_dname_dump,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Allow id's to be specified without the node number or
|
||||
* type for convenience.
|
||||
*/
|
||||
|
||||
rtems_id
|
||||
rtems_monitor_id_fixup(
|
||||
rtems_id id,
|
||||
unsigned32 default_node,
|
||||
rtems_monitor_object_type_t type
|
||||
)
|
||||
{
|
||||
unsigned32 node;
|
||||
|
||||
node = rtems_get_node(id);
|
||||
if (node == 0)
|
||||
{
|
||||
if (rtems_get_class(id) != OBJECTS_NO_CLASS)
|
||||
type = rtems_get_class(id);
|
||||
|
||||
id = _Objects_Build_id(
|
||||
OBJECTS_CLASSIC_API, type, default_node, rtems_get_index(id));
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
rtems_monitor_object_info_t *
|
||||
rtems_monitor_object_lookup(
|
||||
rtems_monitor_object_type_t type
|
||||
)
|
||||
{
|
||||
rtems_monitor_object_info_t *p;
|
||||
for (p = &rtems_monitor_object_info[0];
|
||||
p < &rtems_monitor_object_info[NUMELEMS(rtems_monitor_object_info)];
|
||||
p++)
|
||||
{
|
||||
if (p->type == type)
|
||||
return p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
rtems_id
|
||||
rtems_monitor_object_canonical_next_remote(
|
||||
rtems_monitor_object_type_t type,
|
||||
rtems_id id,
|
||||
void *canonical
|
||||
)
|
||||
{
|
||||
rtems_id next_id;
|
||||
rtems_status_code status;
|
||||
rtems_monitor_server_request_t request;
|
||||
rtems_monitor_server_response_t response;
|
||||
|
||||
/*
|
||||
* Send request
|
||||
*/
|
||||
|
||||
request.command = RTEMS_MONITOR_SERVER_CANONICAL;
|
||||
request.argument0 = (unsigned32) type;
|
||||
request.argument1 = (unsigned32) id;
|
||||
|
||||
status = rtems_monitor_server_request(rtems_get_node(id), &request, &response);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
goto failed;
|
||||
|
||||
/*
|
||||
* process response
|
||||
*/
|
||||
|
||||
next_id = (rtems_id) response.result0;
|
||||
if (next_id != RTEMS_OBJECT_ID_FINAL)
|
||||
(void) memcpy(canonical, &response.payload, response.result1);
|
||||
|
||||
return next_id;
|
||||
|
||||
failed:
|
||||
return RTEMS_OBJECT_ID_FINAL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
rtems_id
|
||||
rtems_monitor_object_canonical_next(
|
||||
rtems_monitor_object_info_t *info,
|
||||
rtems_id id,
|
||||
void *canonical
|
||||
)
|
||||
{
|
||||
rtems_id next_id;
|
||||
void *raw_item;
|
||||
|
||||
if ( ! _Objects_Is_local_id(id))
|
||||
next_id = rtems_monitor_object_canonical_next_remote(info->type,
|
||||
id,
|
||||
canonical);
|
||||
else
|
||||
{
|
||||
next_id = id;
|
||||
|
||||
raw_item = (void *) info->next(info->object_information,
|
||||
canonical,
|
||||
&next_id);
|
||||
|
||||
if (raw_item)
|
||||
{
|
||||
info->canonical(canonical, raw_item);
|
||||
_Thread_Enable_dispatch();
|
||||
}
|
||||
}
|
||||
return next_id;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this is routine server invokes locally to get the type
|
||||
*/
|
||||
|
||||
rtems_id
|
||||
rtems_monitor_object_canonical_get(
|
||||
rtems_monitor_object_type_t type,
|
||||
rtems_id id,
|
||||
void *canonical,
|
||||
unsigned32 *size_p
|
||||
)
|
||||
{
|
||||
rtems_monitor_object_info_t *info;
|
||||
rtems_id next_id;
|
||||
|
||||
*size_p = 0;
|
||||
|
||||
info = rtems_monitor_object_lookup(type);
|
||||
|
||||
if (info == 0)
|
||||
return RTEMS_OBJECT_ID_FINAL;
|
||||
|
||||
next_id = rtems_monitor_object_canonical_next(info, id, canonical);
|
||||
*size_p = info->size;
|
||||
|
||||
return next_id;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_object_dump_1(
|
||||
rtems_monitor_object_info_t *info,
|
||||
rtems_id id,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
rtems_id next_id;
|
||||
rtems_monitor_union_t canonical;
|
||||
|
||||
if ((next_id = rtems_monitor_object_canonical_next(
|
||||
info,
|
||||
id,
|
||||
&canonical)) != RTEMS_OBJECT_ID_FINAL)
|
||||
{
|
||||
/*
|
||||
* If the one we actually got is the one we wanted, then
|
||||
* print it out.
|
||||
* For ones that have an id field, this works fine,
|
||||
* for all others, always dump it out.
|
||||
*
|
||||
* HACK: the way we determine whether there is an id is a hack.
|
||||
*
|
||||
* by the way: the reason we try to not have an id, is that some
|
||||
* of the canonical structures are almost too big for shared
|
||||
* memory driver (eg: mpci)
|
||||
*/
|
||||
|
||||
if ((info->next != rtems_monitor_manager_next) ||
|
||||
(id == canonical.generic.id))
|
||||
info->dump(&canonical, verbose);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_object_dump_all(
|
||||
rtems_monitor_object_info_t *info,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
rtems_id next_id;
|
||||
rtems_monitor_union_t canonical;
|
||||
|
||||
next_id = RTEMS_OBJECT_ID_INITIAL(OBJECTS_CLASSIC_API, info->type, rtems_monitor_default_node);
|
||||
|
||||
while ((next_id = rtems_monitor_object_canonical_next(
|
||||
info,
|
||||
next_id,
|
||||
&canonical)) != RTEMS_OBJECT_ID_FINAL)
|
||||
{
|
||||
info->dump(&canonical, verbose);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_object_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
int arg;
|
||||
rtems_monitor_object_info_t *info = 0;
|
||||
rtems_monitor_object_type_t type = (rtems_monitor_object_type_t) command_arg;
|
||||
|
||||
/* what is the default type? */
|
||||
type = (rtems_monitor_object_type_t) command_arg;
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
if (type == RTEMS_MONITOR_OBJECT_INVALID)
|
||||
{
|
||||
printf("A type must be specified to \"dump all\"\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
info = rtems_monitor_object_lookup(type);
|
||||
if (info == 0)
|
||||
goto not_found;
|
||||
|
||||
if (info->dump_header)
|
||||
info->dump_header(verbose);
|
||||
rtems_monitor_object_dump_all(info, verbose);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned32 default_node = rtems_monitor_default_node;
|
||||
rtems_monitor_object_type_t last_type = RTEMS_MONITOR_OBJECT_INVALID;
|
||||
rtems_id id;
|
||||
|
||||
for (arg=1; argv[arg]; arg++)
|
||||
{
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 16);
|
||||
id = rtems_monitor_id_fixup(id, default_node, type);
|
||||
type = (rtems_monitor_object_type_t) rtems_get_class(id);
|
||||
|
||||
/*
|
||||
* Allow the item type to change in the middle
|
||||
* of the command. If the type changes, then
|
||||
* just dump out a new header and keep on going.
|
||||
*/
|
||||
if (type != last_type)
|
||||
{
|
||||
info = rtems_monitor_object_lookup(type);
|
||||
if (info == 0)
|
||||
goto not_found;
|
||||
|
||||
if (info->dump_header)
|
||||
info->dump_header(verbose);
|
||||
}
|
||||
|
||||
if (info == 0)
|
||||
{
|
||||
not_found: printf("Invalid or unsupported type %d\n", type);
|
||||
goto done;
|
||||
}
|
||||
|
||||
rtems_monitor_object_dump_1(info, id, verbose);
|
||||
|
||||
default_node = rtems_get_node(id);
|
||||
|
||||
last_type = type;
|
||||
}
|
||||
}
|
||||
done:
|
||||
return;
|
||||
}
|
||||
@@ -1,264 +0,0 @@
|
||||
/*
|
||||
* Print misc stuff for the monitor dump routines
|
||||
* Each routine returns the number of characters it output.
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <rtems/assoc.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
void
|
||||
rtems_monitor_separator(void)
|
||||
{
|
||||
printf("------------------------------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_pad(
|
||||
unsigned32 destination_column,
|
||||
unsigned32 current_column
|
||||
)
|
||||
{
|
||||
int pad_length;
|
||||
|
||||
if (destination_column <= current_column)
|
||||
pad_length = 1;
|
||||
else
|
||||
pad_length = destination_column - current_column;
|
||||
|
||||
return printf("%*s", pad_length, "");
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_char(rtems_unsigned8 ch)
|
||||
{
|
||||
if (isprint(ch))
|
||||
return printf("%c", ch);
|
||||
else
|
||||
return printf("%02x", ch);
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_decimal(unsigned32 num)
|
||||
{
|
||||
return printf("%4d", num);
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_hex(unsigned32 num)
|
||||
{
|
||||
return printf("0x%x", num);
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_assoc_bitfield(
|
||||
rtems_assoc_t *ap,
|
||||
char *separator,
|
||||
unsigned32 value
|
||||
)
|
||||
{
|
||||
unsigned32 b;
|
||||
unsigned32 length = 0;
|
||||
const char *name;
|
||||
|
||||
for (b = 1; b; b <<= 1)
|
||||
if (b & value)
|
||||
{
|
||||
if (length)
|
||||
length += printf("%s", separator);
|
||||
|
||||
name = rtems_assoc_name_by_local(ap, b);
|
||||
|
||||
if (name)
|
||||
length += printf("%s", name);
|
||||
else
|
||||
length += printf("0x%x", b);
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_id(rtems_id id)
|
||||
{
|
||||
return printf("%08x", id);
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_name(rtems_name name)
|
||||
{
|
||||
unsigned32 i;
|
||||
unsigned32 length = 0;
|
||||
union {
|
||||
unsigned32 ui;
|
||||
char c[4];
|
||||
} u;
|
||||
|
||||
u.ui = (rtems_unsigned32) name;
|
||||
|
||||
#if (CPU_BIG_ENDIAN == TRUE)
|
||||
for (i=0; i<sizeof(u.c); i++)
|
||||
length += rtems_monitor_dump_char(u.c[i]);
|
||||
#else
|
||||
for (i=0; i<sizeof(u.c); i++)
|
||||
length += rtems_monitor_dump_char(u.c[sizeof(u.c)-1-i]);
|
||||
#endif
|
||||
return length;
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_priority(rtems_task_priority priority)
|
||||
{
|
||||
return printf("%3d", priority);
|
||||
}
|
||||
|
||||
|
||||
rtems_assoc_t rtems_monitor_state_assoc[] = {
|
||||
{ "DORM", STATES_DORMANT },
|
||||
{ "SUSP", STATES_SUSPENDED },
|
||||
{ "TRANS", STATES_TRANSIENT },
|
||||
{ "DELAY", STATES_DELAYING },
|
||||
{ "Wbuf", STATES_WAITING_FOR_BUFFER },
|
||||
{ "Wseg", STATES_WAITING_FOR_SEGMENT },
|
||||
{ "Wmsg" , STATES_WAITING_FOR_MESSAGE },
|
||||
{ "Wevnt", STATES_WAITING_FOR_EVENT },
|
||||
{ "Wsem", STATES_WAITING_FOR_SEMAPHORE },
|
||||
{ "Wtime", STATES_WAITING_FOR_TIME },
|
||||
{ "Wrpc", STATES_WAITING_FOR_RPC_REPLY },
|
||||
{ "Wmutex", STATES_WAITING_FOR_MUTEX },
|
||||
{ "Wcvar", STATES_WAITING_FOR_CONDITION_VARIABLE },
|
||||
{ "Wjatx", STATES_WAITING_FOR_JOIN_AT_EXIT },
|
||||
{ "Wsig", STATES_WAITING_FOR_SIGNAL },
|
||||
{ "WRATE", STATES_WAITING_FOR_PERIOD },
|
||||
{ "Wisig", STATES_INTERRUPTIBLE_BY_SIGNAL },
|
||||
{ 0, 0, 0 },
|
||||
};
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_state(States_Control state)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
if (state == STATES_READY) /* assoc doesn't deal with this as it is 0 */
|
||||
length += printf("READY");
|
||||
|
||||
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
|
||||
":",
|
||||
state);
|
||||
return length;
|
||||
}
|
||||
|
||||
rtems_assoc_t rtems_monitor_attribute_assoc[] = {
|
||||
{ "FL", RTEMS_FLOATING_POINT },
|
||||
{ "GL", RTEMS_GLOBAL },
|
||||
{ "PR", RTEMS_PRIORITY },
|
||||
{ "BI", RTEMS_BINARY_SEMAPHORE },
|
||||
{ "IN", RTEMS_INHERIT_PRIORITY },
|
||||
{ 0, 0, 0 },
|
||||
};
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_attributes(rtems_attribute attributes)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
if (attributes == RTEMS_DEFAULT_ATTRIBUTES) /* value is 0 */
|
||||
length += printf("DEFAULT");
|
||||
|
||||
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
|
||||
":",
|
||||
attributes);
|
||||
return length;
|
||||
}
|
||||
|
||||
rtems_assoc_t rtems_monitor_modes_assoc[] = {
|
||||
{ "nP", RTEMS_NO_PREEMPT },
|
||||
{ "T", RTEMS_TIMESLICE },
|
||||
{ "nA", RTEMS_NO_ASR },
|
||||
{ 0, 0, 0 },
|
||||
};
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_modes(rtems_mode modes)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
if (modes == RTEMS_DEFAULT_MODES) /* value is 0 */
|
||||
length += printf("P:T:nA");
|
||||
|
||||
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
|
||||
":",
|
||||
modes);
|
||||
return length;
|
||||
}
|
||||
|
||||
rtems_assoc_t rtems_monitor_events_assoc[] = {
|
||||
{ "0", RTEMS_EVENT_0 },
|
||||
{ "1", RTEMS_EVENT_1 },
|
||||
{ "2", RTEMS_EVENT_2 },
|
||||
{ "3", RTEMS_EVENT_3 },
|
||||
{ "4", RTEMS_EVENT_4 },
|
||||
{ "5", RTEMS_EVENT_5 },
|
||||
{ "6", RTEMS_EVENT_6 },
|
||||
{ "7", RTEMS_EVENT_7 },
|
||||
{ "8", RTEMS_EVENT_8 },
|
||||
{ "9", RTEMS_EVENT_9 },
|
||||
{ "10", RTEMS_EVENT_10 },
|
||||
{ "11", RTEMS_EVENT_11 },
|
||||
{ "12", RTEMS_EVENT_12 },
|
||||
{ "13", RTEMS_EVENT_13 },
|
||||
{ "14", RTEMS_EVENT_14 },
|
||||
{ "15", RTEMS_EVENT_15 },
|
||||
{ "16", RTEMS_EVENT_16 },
|
||||
{ "17", RTEMS_EVENT_17 },
|
||||
{ "18", RTEMS_EVENT_18 },
|
||||
{ "19", RTEMS_EVENT_19 },
|
||||
{ "20", RTEMS_EVENT_20 },
|
||||
{ "21", RTEMS_EVENT_21 },
|
||||
{ "22", RTEMS_EVENT_22 },
|
||||
{ "23", RTEMS_EVENT_23 },
|
||||
{ "24", RTEMS_EVENT_24 },
|
||||
{ "25", RTEMS_EVENT_25 },
|
||||
{ "26", RTEMS_EVENT_26 },
|
||||
{ "27", RTEMS_EVENT_27 },
|
||||
{ "28", RTEMS_EVENT_28 },
|
||||
{ "29", RTEMS_EVENT_29 },
|
||||
{ "30", RTEMS_EVENT_30 },
|
||||
{ "31", RTEMS_EVENT_31 },
|
||||
{ 0, 0, 0 },
|
||||
};
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_events(rtems_event_set events)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
|
||||
length += printf("NONE");
|
||||
|
||||
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
|
||||
":",
|
||||
events);
|
||||
return length;
|
||||
}
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_dump_notepad(unsigned32 *notepad)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
int i;
|
||||
|
||||
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
|
||||
if (notepad[i])
|
||||
length += printf("%d: 0x%x ", i, notepad[i]);
|
||||
|
||||
return length;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
rtems_monitor_queue_canonical(
|
||||
rtems_monitor_queue_t *canonical_queue,
|
||||
void *queue_void
|
||||
)
|
||||
{
|
||||
Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void;
|
||||
|
||||
canonical_queue->attributes = rtems_queue->attribute_set;
|
||||
canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
|
||||
canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
|
||||
canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_queue_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Dump out the "next" queue indicated by 'id'.
|
||||
* Returns next one to check.
|
||||
* Returns RTEMS_OBJECT_ID_FINAL when all done
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_queue_dump(
|
||||
rtems_monitor_queue_t *monitor_queue,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_queue->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_queue->name);
|
||||
length += rtems_monitor_pad(19, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_queue->attributes);
|
||||
length += rtems_monitor_pad(31, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages);
|
||||
length += rtems_monitor_pad(39, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages);
|
||||
length += rtems_monitor_pad(48, length);
|
||||
length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1,303 +0,0 @@
|
||||
/*
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* running on other nodes)
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
/*
|
||||
* Various id's for the server
|
||||
*/
|
||||
|
||||
rtems_id rtems_monitor_server_task_id;
|
||||
rtems_id rtems_monitor_server_request_queue_id; /* our server */
|
||||
rtems_id *rtems_monitor_server_request_queue_ids; /* all servers */
|
||||
rtems_id rtems_monitor_server_response_queue_id; /* our server */
|
||||
|
||||
|
||||
/*
|
||||
* Send a request to a server task
|
||||
*/
|
||||
|
||||
rtems_status_code
|
||||
rtems_monitor_server_request(
|
||||
unsigned32 server_node,
|
||||
rtems_monitor_server_request_t *request,
|
||||
rtems_monitor_server_response_t *response
|
||||
)
|
||||
{
|
||||
rtems_id server_id;
|
||||
rtems_status_code status;
|
||||
unsigned32 size;
|
||||
|
||||
/*
|
||||
* What is id of monitor on target node?
|
||||
* Look it up if we don't know it yet.
|
||||
*/
|
||||
|
||||
server_id = rtems_monitor_server_request_queue_ids[server_node];
|
||||
if (server_id == 0)
|
||||
{
|
||||
status = rtems_message_queue_ident(RTEMS_MONITOR_QUEUE_NAME,
|
||||
server_node,
|
||||
&server_id);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "ident of remote server failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
rtems_monitor_server_request_queue_ids[server_node] = server_id;
|
||||
}
|
||||
|
||||
request->return_id = rtems_monitor_server_response_queue_id;
|
||||
|
||||
status = rtems_message_queue_send(server_id, request, sizeof(*request));
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "monitor server request send failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Await response, if requested
|
||||
*/
|
||||
|
||||
if (response)
|
||||
{
|
||||
status = rtems_message_queue_receive(rtems_monitor_server_response_queue_id,
|
||||
response,
|
||||
&size,
|
||||
RTEMS_WAIT,
|
||||
100);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "server did not respond");
|
||||
|
||||
/* maybe server task was restarted; look it up again next time */
|
||||
rtems_monitor_server_request_queue_ids[server_node] = 0;
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (response->command != RTEMS_MONITOR_SERVER_RESPONSE)
|
||||
{
|
||||
status = RTEMS_INCORRECT_STATE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* monitor server task
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_server_task(
|
||||
rtems_task_argument monitor_flags
|
||||
)
|
||||
{
|
||||
rtems_monitor_server_request_t request;
|
||||
rtems_monitor_server_response_t response;
|
||||
rtems_status_code status;
|
||||
unsigned32 size;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
status = rtems_message_queue_receive(
|
||||
rtems_monitor_server_request_queue_id,
|
||||
&request,
|
||||
&size,
|
||||
RTEMS_WAIT,
|
||||
(rtems_interval) 0);
|
||||
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "monitor server msg queue receive error");
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (size != sizeof(request))
|
||||
{
|
||||
rtems_error(0, "monitor server bad size on receive");
|
||||
goto failed;
|
||||
}
|
||||
|
||||
switch (request.command)
|
||||
{
|
||||
case RTEMS_MONITOR_SERVER_CANONICAL:
|
||||
{
|
||||
rtems_monitor_object_type_t object_type;
|
||||
rtems_id id;
|
||||
rtems_id next_id;
|
||||
|
||||
object_type = (rtems_monitor_object_type_t) request.argument0;
|
||||
id = (rtems_id) request.argument1;
|
||||
next_id = rtems_monitor_object_canonical_get(object_type,
|
||||
id,
|
||||
&response.payload,
|
||||
&size);
|
||||
|
||||
response.command = RTEMS_MONITOR_SERVER_RESPONSE;
|
||||
response.result0 = next_id;
|
||||
response.result1 = size;
|
||||
|
||||
#define SERVER_OVERHEAD (RTEMS_offsetof(rtems_monitor_server_response_t, \
|
||||
payload))
|
||||
|
||||
status = rtems_message_queue_send(request.return_id,
|
||||
&response,
|
||||
size + SERVER_OVERHEAD);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "response send failed");
|
||||
goto failed;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
rtems_error(0, "invalid command to monitor server: %d", request.command);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
failed:
|
||||
rtems_task_delete(RTEMS_SELF);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Kill off any old server
|
||||
* Not sure if this is useful, but it doesn't help
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_server_kill(void)
|
||||
{
|
||||
if (rtems_monitor_server_task_id)
|
||||
rtems_task_delete(rtems_monitor_server_task_id);
|
||||
rtems_monitor_server_task_id = 0;
|
||||
|
||||
if (rtems_monitor_server_request_queue_id)
|
||||
rtems_message_queue_delete(rtems_monitor_server_request_queue_id);
|
||||
rtems_monitor_server_request_queue_ids = 0;
|
||||
|
||||
if (rtems_monitor_server_response_queue_id)
|
||||
rtems_message_queue_delete(rtems_monitor_server_response_queue_id);
|
||||
rtems_monitor_server_response_queue_id = 0;
|
||||
|
||||
if (rtems_monitor_server_request_queue_ids)
|
||||
free(rtems_monitor_server_request_queue_ids);
|
||||
rtems_monitor_server_request_queue_ids = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_server_init(
|
||||
unsigned32 monitor_flags
|
||||
)
|
||||
{
|
||||
rtems_status_code status;
|
||||
|
||||
if (_System_state_Is_multiprocessing &&
|
||||
(_Configuration_MP_table->maximum_nodes > 1))
|
||||
{
|
||||
unsigned32 maximum_nodes = _Configuration_MP_table->maximum_nodes;
|
||||
|
||||
/*
|
||||
* create the msg que our server will listen
|
||||
* Since we only get msgs from other RTEMS monitors, we just
|
||||
* need reserve space for 1 msg from each node.
|
||||
*/
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
RTEMS_MONITOR_QUEUE_NAME,
|
||||
maximum_nodes,
|
||||
sizeof(rtems_monitor_server_request_t),
|
||||
RTEMS_GLOBAL,
|
||||
&rtems_monitor_server_request_queue_id);
|
||||
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "could not create monitor server message queue");
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* create the msg que our responses will come on
|
||||
* Since monitor just does one thing at a time, we only need 1 item
|
||||
* message queue.
|
||||
*/
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
RTEMS_MONITOR_RESPONSE_QUEUE_NAME,
|
||||
1, /* depth */
|
||||
sizeof(rtems_monitor_server_response_t),
|
||||
RTEMS_GLOBAL,
|
||||
&rtems_monitor_server_response_queue_id);
|
||||
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "could not create monitor response message queue");
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* need an id for queue of each other server we might talk to */
|
||||
/* indexed by node, so add 1 to maximum_nodes */
|
||||
rtems_monitor_server_request_queue_ids =
|
||||
(rtems_id *) malloc((maximum_nodes + 1) * sizeof(rtems_id));
|
||||
(void) memset(rtems_monitor_server_request_queue_ids,
|
||||
0,
|
||||
(maximum_nodes + 1) * sizeof(rtems_id));
|
||||
|
||||
rtems_monitor_server_request_queue_ids[rtems_monitor_node] =
|
||||
rtems_monitor_server_request_queue_id;
|
||||
|
||||
/*
|
||||
* create the server task
|
||||
*/
|
||||
status = rtems_task_create(RTEMS_MONITOR_SERVER_NAME,
|
||||
1,
|
||||
0 /* default stack */,
|
||||
RTEMS_INTERRUPT_LEVEL(0),
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&rtems_monitor_server_task_id);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "could not create monitor server task");
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start the server task
|
||||
*/
|
||||
status = rtems_task_start(rtems_monitor_server_task_id,
|
||||
rtems_monitor_server_task,
|
||||
monitor_flags);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
rtems_error(status, "could not start monitor server");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
return;
|
||||
}
|
||||
@@ -1,482 +0,0 @@
|
||||
/*
|
||||
* File: symbols.c
|
||||
*
|
||||
* Description:
|
||||
* Symbol table manager for the RTEMS monitor.
|
||||
* These routines may be used by other system resources also.
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
#include <rtems.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <rtems/monitor.h>
|
||||
#include <rtems/symbols.h>
|
||||
|
||||
|
||||
rtems_symbol_table_t *
|
||||
rtems_symbol_table_create()
|
||||
{
|
||||
rtems_symbol_table_t *table;
|
||||
|
||||
table = (rtems_symbol_table_t *) malloc(sizeof(rtems_symbol_table_t));
|
||||
memset((void *) table, 0, sizeof(*table));
|
||||
|
||||
table->growth_factor = 30; /* 30 percent */
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_symbol_table_destroy(rtems_symbol_table_t *table)
|
||||
{
|
||||
rtems_symbol_string_block_t *p, *pnext;
|
||||
|
||||
if (table)
|
||||
{
|
||||
if (table->addresses)
|
||||
(void) free(table->addresses);
|
||||
table->addresses = 0;
|
||||
p = table->string_buffer_head;
|
||||
while (p)
|
||||
{
|
||||
pnext = p->next;
|
||||
free(p);
|
||||
p = pnext;
|
||||
}
|
||||
table->string_buffer_head = 0;
|
||||
table->string_buffer_current = 0;
|
||||
|
||||
free(table);
|
||||
}
|
||||
}
|
||||
|
||||
rtems_symbol_t *
|
||||
rtems_symbol_create(
|
||||
rtems_symbol_table_t *table,
|
||||
char *name,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
int symbol_length;
|
||||
size_t newsize;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
symbol_length = strlen(name) + 1; /* include '\000' in length */
|
||||
|
||||
/* need to grow the table? */
|
||||
if (table->next >= table->size)
|
||||
{
|
||||
if (table->size == 0)
|
||||
newsize = 100;
|
||||
else
|
||||
newsize = table->size + (table->size / (100 / table->growth_factor));
|
||||
|
||||
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->addresses == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
table->size = newsize;
|
||||
}
|
||||
|
||||
sp = &table->addresses[table->next];
|
||||
sp->value = value;
|
||||
|
||||
/* Have to add it to string pool */
|
||||
/* need to grow pool? */
|
||||
|
||||
if ((table->string_buffer_head == 0) ||
|
||||
(table->strings_next + symbol_length) >= SYMBOL_STRING_BLOCK_SIZE)
|
||||
{
|
||||
rtems_symbol_string_block_t *p;
|
||||
|
||||
p = (rtems_symbol_string_block_t *) malloc(sizeof(rtems_symbol_string_block_t));
|
||||
if (p == 0)
|
||||
goto failed;
|
||||
p->next = 0;
|
||||
if (table->string_buffer_head == 0)
|
||||
table->string_buffer_head = p;
|
||||
else
|
||||
table->string_buffer_current->next = p;
|
||||
table->string_buffer_current = p;
|
||||
|
||||
table->strings_next = 0;
|
||||
}
|
||||
|
||||
sp->name = table->string_buffer_current->buffer + table->strings_next;
|
||||
(void) strcpy(sp->name, name);
|
||||
|
||||
table->strings_next += symbol_length;
|
||||
table->sorted = 0;
|
||||
table->next++;
|
||||
|
||||
return sp;
|
||||
|
||||
/* XXX Not sure what to do here. We've possibly destroyed the initial
|
||||
symbol table due to realloc failure */
|
||||
failed:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Qsort entry point for compare by address
|
||||
*/
|
||||
|
||||
static int
|
||||
rtems_symbol_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
rtems_symbol_t *s1, *s2;
|
||||
s1 = (rtems_symbol_t *) e1;
|
||||
s2 = (rtems_symbol_t *) e2;
|
||||
|
||||
if (s1->value < s2->value)
|
||||
return -1;
|
||||
if (s1->value > s2->value)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sort the symbol table using qsort
|
||||
*/
|
||||
|
||||
static void
|
||||
rtems_symbol_sort(rtems_symbol_table_t *table)
|
||||
{
|
||||
qsort((void *) table->addresses, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_compare);
|
||||
table->sorted = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by address
|
||||
* This code based on CYGNUS newlib bsearch, but changed
|
||||
* to allow for finding closest symbol <= key
|
||||
*/
|
||||
|
||||
rtems_symbol_t *
|
||||
rtems_symbol_value_lookup(
|
||||
rtems_symbol_table_t *table,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
rtems_symbol_t *sp;
|
||||
rtems_symbol_t *base;
|
||||
rtems_symbol_t *best = 0;
|
||||
rtems_unsigned32 distance;
|
||||
rtems_unsigned32 best_distance = ~0;
|
||||
rtems_unsigned32 elements;
|
||||
|
||||
if (table == 0)
|
||||
table = rtems_monitor_symbols;
|
||||
|
||||
if ((table == 0) || (table->size == 0))
|
||||
return 0;
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
base = table->addresses;
|
||||
elements = table->next;
|
||||
|
||||
while (elements)
|
||||
{
|
||||
sp = base + (elements / 2);
|
||||
if (value < sp->value)
|
||||
elements /= 2;
|
||||
else if (value > sp->value)
|
||||
{
|
||||
distance = value - sp->value;
|
||||
if (distance < best_distance)
|
||||
{
|
||||
best_distance = distance;
|
||||
best = sp;
|
||||
}
|
||||
base = sp + 1;
|
||||
elements = (elements / 2) - (elements % 2 ? 0 : 1);
|
||||
}
|
||||
else
|
||||
return sp;
|
||||
}
|
||||
|
||||
if (value == base->value)
|
||||
return base;
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the symbol table for the exact matching address.
|
||||
* If the symbol table has already been sorted, then
|
||||
* call the regular symbol value lookup, however, it it
|
||||
* has not yet been sorted, search it sequentially.
|
||||
* This routine is primarily used for low level symbol
|
||||
* lookups (eg. from exception handler and interrupt routines)
|
||||
* where the penality of sorted is not wanted and where
|
||||
* an exact match is needed such that symbol table order
|
||||
* is not important.
|
||||
*/
|
||||
const rtems_symbol_t *
|
||||
rtems_symbol_value_lookup_exact(
|
||||
rtems_symbol_table_t *table,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (table->sorted)
|
||||
{
|
||||
sp = rtems_symbol_value_lookup(table, value);
|
||||
if ( rtems_symbol_value(sp) == value )
|
||||
return sp;
|
||||
else
|
||||
return NULL; /* not an exact match */
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( sp->value == value )
|
||||
return sp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by string name (case independent)
|
||||
*/
|
||||
|
||||
rtems_symbol_t *
|
||||
rtems_symbol_name_lookup(
|
||||
rtems_symbol_table_t *table,
|
||||
char *name
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( strcasecmp(sp->name, name) == 0 )
|
||||
return sp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
rtems_monitor_symbol_next(
|
||||
void *object_info,
|
||||
rtems_monitor_symbol_t *canonical,
|
||||
rtems_id *next_id
|
||||
)
|
||||
{
|
||||
rtems_symbol_table_t *table;
|
||||
rtems_unsigned32 n = rtems_get_index(*next_id);
|
||||
|
||||
table = *(rtems_symbol_table_t **) object_info;
|
||||
if (table == 0)
|
||||
goto failed;
|
||||
|
||||
if (n >= table->next)
|
||||
goto failed;
|
||||
|
||||
/* NOTE: symbols do not have id and name fields */
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) (table->addresses + n);
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_symbol_canonical(
|
||||
rtems_monitor_symbol_t *canonical_symbol,
|
||||
rtems_symbol_t *sp
|
||||
)
|
||||
{
|
||||
canonical_symbol->value = sp->value;
|
||||
canonical_symbol->offset = 0;
|
||||
strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_symbol_canonical_by_name(
|
||||
rtems_monitor_symbol_t *canonical_symbol,
|
||||
char *name
|
||||
)
|
||||
{
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
sp = rtems_symbol_name_lookup(0, name);
|
||||
|
||||
canonical_symbol->value = sp ? sp->value : 0;
|
||||
|
||||
strncpy(canonical_symbol->name, name, sizeof(canonical_symbol->name));
|
||||
canonical_symbol->offset = 0;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_symbol_canonical_by_value(
|
||||
rtems_monitor_symbol_t *canonical_symbol,
|
||||
void *value_void_p
|
||||
)
|
||||
{
|
||||
unsigned32 value = (unsigned32) value_void_p;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
sp = rtems_symbol_value_lookup(0, value);
|
||||
if (sp)
|
||||
{
|
||||
canonical_symbol->value = sp->value;
|
||||
canonical_symbol->offset = value - sp->value;
|
||||
strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
|
||||
}
|
||||
else
|
||||
{
|
||||
canonical_symbol->value = value;
|
||||
canonical_symbol->offset = 0;
|
||||
canonical_symbol->name[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned32
|
||||
rtems_monitor_symbol_dump(
|
||||
rtems_monitor_symbol_t *canonical_symbol,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
unsigned32 length = 0;
|
||||
|
||||
/*
|
||||
* print the name if it exists AND if value is non-zero
|
||||
* Ie: don't print some garbage symbol for address 0
|
||||
*/
|
||||
|
||||
if (canonical_symbol->name[0] && (canonical_symbol->value != 0))
|
||||
{
|
||||
if (canonical_symbol->offset == 0)
|
||||
length += printf("%.*s",
|
||||
(int) sizeof(canonical_symbol->name),
|
||||
canonical_symbol->name);
|
||||
else
|
||||
length += printf("<%.*s+0x%x>",
|
||||
(int) sizeof(canonical_symbol->name),
|
||||
canonical_symbol->name,
|
||||
canonical_symbol->offset);
|
||||
if (verbose)
|
||||
length += printf(" [0x%x]", canonical_symbol->value);
|
||||
}
|
||||
else
|
||||
length += printf("[0x%x]", canonical_symbol->value);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_symbol_dump_all(
|
||||
rtems_symbol_table_t *table,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
rtems_monitor_symbol_t canonical_symbol;
|
||||
|
||||
rtems_monitor_symbol_canonical(&canonical_symbol, sp);
|
||||
rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'symbol' command
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_symbol_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
int arg;
|
||||
rtems_symbol_table_t *table;
|
||||
|
||||
table = *(rtems_symbol_table_t **) command_arg;
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use object command to dump out whole symbol table
|
||||
*/
|
||||
if (argc == 1)
|
||||
rtems_monitor_symbol_dump_all(table, verbose);
|
||||
else
|
||||
{
|
||||
rtems_monitor_symbol_t canonical_symbol;
|
||||
|
||||
for (arg=1; argv[arg]; arg++)
|
||||
{
|
||||
rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
|
||||
rtems_monitor_symbol_dump(&canonical_symbol, verbose);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* RTEMS Monitor task support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/monitor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h> /* memcpy() */
|
||||
|
||||
void
|
||||
rtems_monitor_task_canonical(
|
||||
rtems_monitor_task_t *canonical_task,
|
||||
void *thread_void
|
||||
)
|
||||
{
|
||||
Thread_Control *rtems_thread = (Thread_Control *) thread_void;
|
||||
RTEMS_API_Control *api;
|
||||
|
||||
api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
|
||||
|
||||
canonical_task->entry = rtems_thread->Start.entry_point;
|
||||
canonical_task->argument = rtems_thread->Start.numeric_argument;
|
||||
canonical_task->stack = rtems_thread->Start.Initial_stack.area;
|
||||
canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
|
||||
canonical_task->priority = rtems_thread->current_priority;
|
||||
canonical_task->state = rtems_thread->current_state;
|
||||
canonical_task->wait_id = rtems_thread->Wait.id;
|
||||
canonical_task->events = api->pending_events;
|
||||
|
||||
/* XXX modes and attributes only exist in the RTEMS API .. */
|
||||
/* XXX not directly in the core thread.. they will have to be derived */
|
||||
/* XXX if they are important enough to include anymore. */
|
||||
canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
|
||||
canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
|
||||
(void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
|
||||
/* XXX more to fix */
|
||||
/*
|
||||
(void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_monitor_task_dump_header(
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
printf("\
|
||||
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
|
||||
rtems_monitor_separator();
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
void
|
||||
rtems_monitor_task_dump(
|
||||
rtems_monitor_task_t *monitor_task,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
int length = 0;
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_task->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_task->name);
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_priority(monitor_task->priority);
|
||||
length += rtems_monitor_pad(24, length);
|
||||
length += rtems_monitor_dump_state(monitor_task->state);
|
||||
length += rtems_monitor_pad(31, length);
|
||||
length += rtems_monitor_dump_modes(monitor_task->modes);
|
||||
length += rtems_monitor_pad(39, length);
|
||||
length += rtems_monitor_dump_events(monitor_task->events);
|
||||
if (monitor_task->wait_id)
|
||||
{
|
||||
length += rtems_monitor_pad(47, length);
|
||||
length += rtems_monitor_dump_id(monitor_task->wait_id);
|
||||
length += rtems_monitor_pad(57, length);
|
||||
length += rtems_monitor_dump_hex(monitor_task->wait_args);
|
||||
}
|
||||
|
||||
length += rtems_monitor_pad(65, length);
|
||||
length += rtems_monitor_dump_notepad(monitor_task->notepad);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@@ -1,458 +0,0 @@
|
||||
/*
|
||||
* File: monitor.h
|
||||
*
|
||||
* Description:
|
||||
* The RTEMS monitor task include file.
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __MONITOR_H
|
||||
#define __MONITOR_H
|
||||
|
||||
#include <rtems/symbols.h>
|
||||
#include <rtems/error.h> /* rtems_error() */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Monitor types are derived from rtems object classes
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
RTEMS_MONITOR_OBJECT_INVALID = OBJECTS_NO_CLASS,
|
||||
RTEMS_MONITOR_OBJECT_TASK = OBJECTS_RTEMS_TASKS,
|
||||
RTEMS_MONITOR_OBJECT_EXTENSION = OBJECTS_RTEMS_EXTENSIONS,
|
||||
RTEMS_MONITOR_OBJECT_QUEUE = OBJECTS_RTEMS_MESSAGE_QUEUES,
|
||||
RTEMS_MONITOR_OBJECT_SEMAPHORE = OBJECTS_RTEMS_SEMAPHORES,
|
||||
RTEMS_MONITOR_OBJECT_PARTITION = OBJECTS_RTEMS_PARTITIONS,
|
||||
RTEMS_MONITOR_OBJECT_REGION = OBJECTS_RTEMS_REGIONS,
|
||||
RTEMS_MONITOR_OBJECT_PORT = OBJECTS_RTEMS_PORTS,
|
||||
|
||||
/* following monitor objects are not known to RTEMS, but
|
||||
* we like to have "types" for them anyway */
|
||||
|
||||
RTEMS_MONITOR_OBJECT_DRIVER = OBJECTS_RTEMS_CLASSES_LAST+1,
|
||||
RTEMS_MONITOR_OBJECT_DNAME,
|
||||
RTEMS_MONITOR_OBJECT_CONFIG,
|
||||
RTEMS_MONITOR_OBJECT_INIT_TASK,
|
||||
RTEMS_MONITOR_OBJECT_MPCI,
|
||||
RTEMS_MONITOR_OBJECT_SYMBOL
|
||||
} rtems_monitor_object_type_t;
|
||||
|
||||
/*
|
||||
* rtems_monitor_init() flags
|
||||
*/
|
||||
|
||||
#define RTEMS_MONITOR_SUSPEND 0x0001 /* suspend monitor on startup */
|
||||
#define RTEMS_MONITOR_GLOBAL 0x0002 /* monitor should be global */
|
||||
|
||||
|
||||
/*
|
||||
* Public interfaces for RTEMS data structures monitor is aware of.
|
||||
* These are only used by the monitor.
|
||||
*
|
||||
* NOTE:
|
||||
* All the canonical objects that correspond to RTEMS managed "objects"
|
||||
* must have an identical first portion with 'id' and 'name' fields.
|
||||
*
|
||||
* Others do not have that restriction, even tho we would like them to.
|
||||
* This is because some of the canonical structures are almost too big
|
||||
* for shared memory driver (eg: mpci) and we are nickel and diming it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Type of a pointer that may be a symbol
|
||||
*/
|
||||
|
||||
#define MONITOR_SYMBOL_LEN 20
|
||||
typedef struct {
|
||||
char name[MONITOR_SYMBOL_LEN];
|
||||
unsigned32 value;
|
||||
unsigned32 offset;
|
||||
} rtems_monitor_symbol_t;
|
||||
|
||||
typedef struct {
|
||||
rtems_id id;
|
||||
rtems_name name;
|
||||
/* end of common portion */
|
||||
} rtems_monitor_generic_t;
|
||||
|
||||
/*
|
||||
* Task
|
||||
*/
|
||||
typedef struct {
|
||||
rtems_id id;
|
||||
rtems_name name;
|
||||
/* end of common portion */
|
||||
Thread_Entry entry;
|
||||
unsigned32 argument;
|
||||
void *stack;
|
||||
unsigned32 stack_size;
|
||||
rtems_task_priority priority;
|
||||
States_Control state;
|
||||
rtems_event_set events;
|
||||
rtems_mode modes;
|
||||
rtems_attribute attributes;
|
||||
unsigned32 notepad[RTEMS_NUMBER_NOTEPADS];
|
||||
rtems_id wait_id;
|
||||
unsigned32 wait_args;
|
||||
} rtems_monitor_task_t;
|
||||
|
||||
/*
|
||||
* Init task
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
rtems_id id; /* not really an id */
|
||||
rtems_name name;
|
||||
/* end of common portion */
|
||||
rtems_monitor_symbol_t entry;
|
||||
unsigned32 argument;
|
||||
unsigned32 stack_size;
|
||||
rtems_task_priority priority;
|
||||
rtems_mode modes;
|
||||
rtems_attribute attributes;
|
||||
} rtems_monitor_init_task_t;
|
||||
|
||||
|
||||
/*
|
||||
* Message queue
|
||||
*/
|
||||
typedef struct {
|
||||
rtems_id id;
|
||||
rtems_name name;
|
||||
/* end of common portion */
|
||||
rtems_attribute attributes;
|
||||
unsigned32 number_of_pending_messages;
|
||||
unsigned32 maximum_pending_messages;
|
||||
unsigned32 maximum_message_size;
|
||||
} rtems_monitor_queue_t;
|
||||
|
||||
/*
|
||||
* Extension
|
||||
*/
|
||||
typedef struct {
|
||||
rtems_id id;
|
||||
rtems_name name;
|
||||
/* end of common portion */
|
||||
rtems_monitor_symbol_t e_create;
|
||||
rtems_monitor_symbol_t e_start;
|
||||
rtems_monitor_symbol_t e_restart;
|
||||
rtems_monitor_symbol_t e_delete;
|
||||
rtems_monitor_symbol_t e_tswitch;
|
||||
rtems_monitor_symbol_t e_begin;
|
||||
rtems_monitor_symbol_t e_exitted;
|
||||
rtems_monitor_symbol_t e_fatal;
|
||||
} rtems_monitor_extension_t;
|
||||
|
||||
/*
|
||||
* Device driver
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
rtems_id id; /* not really an id (should be tho) */
|
||||
rtems_name name; /* ditto */
|
||||
/* end of common portion */
|
||||
rtems_monitor_symbol_t initialization; /* initialization procedure */
|
||||
rtems_monitor_symbol_t open; /* open request procedure */
|
||||
rtems_monitor_symbol_t close; /* close request procedure */
|
||||
rtems_monitor_symbol_t read; /* read request procedure */
|
||||
rtems_monitor_symbol_t write; /* write request procedure */
|
||||
rtems_monitor_symbol_t control; /* special functions procedure */
|
||||
} rtems_monitor_driver_t;
|
||||
|
||||
typedef struct {
|
||||
rtems_id id; /* not used for drivers (yet) */
|
||||
rtems_name name; /* not used for drivers (yet) */
|
||||
/* end of common portion */
|
||||
unsigned32 major;
|
||||
unsigned32 minor;
|
||||
char name_string[64];
|
||||
} rtems_monitor_dname_t;
|
||||
|
||||
/*
|
||||
* System config
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
void *work_space_start;
|
||||
unsigned32 work_space_size;
|
||||
unsigned32 maximum_tasks;
|
||||
unsigned32 maximum_timers;
|
||||
unsigned32 maximum_semaphores;
|
||||
unsigned32 maximum_message_queues;
|
||||
unsigned32 maximum_partitions;
|
||||
unsigned32 maximum_regions;
|
||||
unsigned32 maximum_ports;
|
||||
unsigned32 maximum_periods;
|
||||
unsigned32 maximum_extensions;
|
||||
unsigned32 microseconds_per_tick;
|
||||
unsigned32 ticks_per_timeslice;
|
||||
unsigned32 number_of_initialization_tasks;
|
||||
} rtems_monitor_config_t;
|
||||
|
||||
/*
|
||||
* MPCI config
|
||||
*/
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
typedef struct {
|
||||
unsigned32 node; /* local node number */
|
||||
unsigned32 maximum_nodes; /* maximum # nodes in system */
|
||||
unsigned32 maximum_global_objects; /* maximum # global objects */
|
||||
unsigned32 maximum_proxies; /* maximum # proxies */
|
||||
|
||||
unsigned32 default_timeout; /* in ticks */
|
||||
unsigned32 maximum_packet_size;
|
||||
rtems_monitor_symbol_t initialization;
|
||||
rtems_monitor_symbol_t get_packet;
|
||||
rtems_monitor_symbol_t return_packet;
|
||||
rtems_monitor_symbol_t send_packet;
|
||||
rtems_monitor_symbol_t receive_packet;
|
||||
} rtems_monitor_mpci_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The generic canonical information union
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
rtems_monitor_generic_t generic;
|
||||
rtems_monitor_task_t task;
|
||||
rtems_monitor_queue_t queue;
|
||||
rtems_monitor_extension_t extension;
|
||||
rtems_monitor_driver_t driver;
|
||||
rtems_monitor_dname_t dname;
|
||||
rtems_monitor_config_t config;
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
rtems_monitor_mpci_t mpci;
|
||||
#endif
|
||||
rtems_monitor_init_task_t itask;
|
||||
} rtems_monitor_union_t;
|
||||
|
||||
/*
|
||||
* Support for talking to other monitors
|
||||
*/
|
||||
|
||||
/*
|
||||
* Names of other monitors
|
||||
*/
|
||||
|
||||
#define RTEMS_MONITOR_NAME (rtems_build_name('R', 'M', 'O', 'N'))
|
||||
#define RTEMS_MONITOR_SERVER_NAME (rtems_build_name('R', 'M', 'S', 'V'))
|
||||
#define RTEMS_MONITOR_QUEUE_NAME (rtems_build_name('R', 'M', 'S', 'Q'))
|
||||
#define RTEMS_MONITOR_RESPONSE_QUEUE_NAME (rtems_build_name('R', 'M', 'R', 'Q'))
|
||||
|
||||
#define RTEMS_MONITOR_SERVER_RESPONSE 0x0001
|
||||
#define RTEMS_MONITOR_SERVER_CANONICAL 0x0002
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned32 command;
|
||||
rtems_id return_id;
|
||||
unsigned32 argument0;
|
||||
unsigned32 argument1;
|
||||
unsigned32 argument2;
|
||||
unsigned32 argument3;
|
||||
unsigned32 argument4;
|
||||
unsigned32 argument5;
|
||||
} rtems_monitor_server_request_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned32 command;
|
||||
unsigned32 result0;
|
||||
unsigned32 result1;
|
||||
rtems_monitor_union_t payload;
|
||||
} rtems_monitor_server_response_t;
|
||||
|
||||
extern rtems_id rtems_monitor_task_id;
|
||||
|
||||
extern unsigned32 rtems_monitor_node; /* our node number */
|
||||
extern unsigned32 rtems_monitor_default_node; /* current default for commands */
|
||||
|
||||
/*
|
||||
* Monitor command function and table entry
|
||||
*/
|
||||
|
||||
typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t;
|
||||
|
||||
typedef void ( *rtems_monitor_command_function_t )(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
);
|
||||
|
||||
#if defined(__mips64)
|
||||
typedef unsigned64 rtems_monitor_command_arg_t;
|
||||
#else
|
||||
typedef unsigned32 rtems_monitor_command_arg_t;
|
||||
#endif
|
||||
|
||||
struct rtems_monitor_command_entry_s {
|
||||
char *command; /* command name */
|
||||
char *usage; /* usage string for the command */
|
||||
unsigned32 arguments_required; /* # of required args */
|
||||
rtems_monitor_command_function_t command_function;
|
||||
/* Some argument for the command */
|
||||
rtems_monitor_command_arg_t command_arg;
|
||||
struct rtems_monitor_command_entry_s *next;
|
||||
};
|
||||
|
||||
typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *);
|
||||
typedef void (*rtems_monitor_object_canonical_fn)(void *, void *);
|
||||
typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
|
||||
typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
|
||||
|
||||
typedef struct {
|
||||
rtems_monitor_object_type_t type;
|
||||
void *object_information;
|
||||
int size; /* of canonical object */
|
||||
rtems_monitor_object_next_fn next;
|
||||
rtems_monitor_object_canonical_fn canonical;
|
||||
rtems_monitor_object_dump_header_fn dump_header;
|
||||
rtems_monitor_object_dump_fn dump;
|
||||
} rtems_monitor_object_info_t;
|
||||
|
||||
|
||||
/* monitor.c */
|
||||
void rtems_monitor_kill(void);
|
||||
void rtems_monitor_init(unsigned32);
|
||||
void rtems_monitor_wakeup(void);
|
||||
void rtems_monitor_pause_cmd(int, char **, unsigned32, boolean);
|
||||
void rtems_monitor_fatal_cmd(int, char **, unsigned32, boolean);
|
||||
void rtems_monitor_continue_cmd(int, char **, unsigned32, boolean);
|
||||
void rtems_monitor_debugger_cmd(int, char **, unsigned32, boolean);
|
||||
void rtems_monitor_node_cmd(int, char **, unsigned32, boolean);
|
||||
void rtems_monitor_symbols_loadup(void);
|
||||
int rtems_monitor_insert_cmd(rtems_monitor_command_entry_t *);
|
||||
int rtems_monitor_erase_cmd(rtems_monitor_command_entry_t *);
|
||||
|
||||
void rtems_monitor_task(rtems_task_argument);
|
||||
|
||||
/* server.c */
|
||||
void rtems_monitor_server_kill(void);
|
||||
rtems_status_code rtems_monitor_server_request(unsigned32, rtems_monitor_server_request_t *, rtems_monitor_server_response_t *);
|
||||
void rtems_monitor_server_task(rtems_task_argument);
|
||||
void rtems_monitor_server_init(unsigned32);
|
||||
|
||||
/* command.c */
|
||||
int rtems_monitor_make_argv(char *, int *, char **);
|
||||
int rtems_monitor_command_read(char *, int *, char **);
|
||||
rtems_monitor_command_entry_t *rtems_monitor_command_lookup(
|
||||
rtems_monitor_command_entry_t * table, int argc, char **argv);
|
||||
void rtems_monitor_command_usage(rtems_monitor_command_entry_t *, char *);
|
||||
void rtems_monitor_help_cmd(int, char **, unsigned32, boolean);
|
||||
|
||||
/* prmisc.c */
|
||||
void rtems_monitor_separator(void);
|
||||
unsigned32 rtems_monitor_pad(unsigned32 dest_col, unsigned32 curr_col);
|
||||
unsigned32 rtems_monitor_dump_char(unsigned8 ch);
|
||||
unsigned32 rtems_monitor_dump_decimal(unsigned32 num);
|
||||
unsigned32 rtems_monitor_dump_hex(unsigned32 num);
|
||||
unsigned32 rtems_monitor_dump_id(rtems_id id);
|
||||
unsigned32 rtems_monitor_dump_name(rtems_name name);
|
||||
unsigned32 rtems_monitor_dump_priority(rtems_task_priority priority);
|
||||
unsigned32 rtems_monitor_dump_state(States_Control state);
|
||||
unsigned32 rtems_monitor_dump_modes(rtems_mode modes);
|
||||
unsigned32 rtems_monitor_dump_attributes(rtems_attribute attributes);
|
||||
unsigned32 rtems_monitor_dump_events(rtems_event_set events);
|
||||
unsigned32 rtems_monitor_dump_notepad(unsigned32 *notepad);
|
||||
|
||||
/* object.c */
|
||||
rtems_id rtems_monitor_id_fixup(rtems_id, unsigned32, rtems_monitor_object_type_t);
|
||||
rtems_id rtems_monitor_object_canonical_get(rtems_monitor_object_type_t, rtems_id, void *, unsigned32 *size_p);
|
||||
rtems_id rtems_monitor_object_canonical_next(rtems_monitor_object_info_t *, rtems_id, void *);
|
||||
void *rtems_monitor_object_next(void *, void *, rtems_id, rtems_id *);
|
||||
rtems_id rtems_monitor_object_canonical(rtems_id, void *);
|
||||
void rtems_monitor_object_cmd(int, char **, unsigned32, boolean);
|
||||
|
||||
/* manager.c */
|
||||
void *rtems_monitor_manager_next(void *, void *, rtems_id *);
|
||||
|
||||
/* config.c */
|
||||
void rtems_monitor_config_canonical(rtems_monitor_config_t *, void *);
|
||||
void *rtems_monitor_config_next(void *, rtems_monitor_config_t *, rtems_id *);
|
||||
void rtems_monitor_config_dump_header(boolean);
|
||||
void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose);
|
||||
|
||||
/* mpci.c */
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *);
|
||||
void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *);
|
||||
void rtems_monitor_mpci_dump_header(boolean);
|
||||
void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose);
|
||||
#endif
|
||||
|
||||
/* itask.c */
|
||||
void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *);
|
||||
void *rtems_monitor_init_task_next(void *, rtems_monitor_init_task_t *, rtems_id *);
|
||||
void rtems_monitor_init_task_dump_header(boolean);
|
||||
void rtems_monitor_init_task_dump(rtems_monitor_init_task_t *, boolean verbose);
|
||||
|
||||
/* extension.c */
|
||||
void rtems_monitor_extension_canonical(rtems_monitor_extension_t *, void *);
|
||||
void rtems_monitor_extension_dump_header(boolean verbose);
|
||||
void rtems_monitor_extension_dump(rtems_monitor_extension_t *, boolean);
|
||||
|
||||
/* task.c */
|
||||
void rtems_monitor_task_canonical(rtems_monitor_task_t *, void *);
|
||||
void rtems_monitor_task_dump_header(boolean verbose);
|
||||
void rtems_monitor_task_dump(rtems_monitor_task_t *, boolean);
|
||||
|
||||
/* queue.c */
|
||||
void rtems_monitor_queue_canonical(rtems_monitor_queue_t *, void *);
|
||||
void rtems_monitor_queue_dump_header(boolean verbose);
|
||||
void rtems_monitor_queue_dump(rtems_monitor_queue_t *, boolean);
|
||||
|
||||
/* driver.c */
|
||||
void *rtems_monitor_driver_next(void *, rtems_monitor_driver_t *, rtems_id *);
|
||||
void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);
|
||||
void rtems_monitor_driver_dump_header(boolean);
|
||||
void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean);
|
||||
|
||||
/* dname.c */
|
||||
void *rtems_monitor_dname_next(void *, rtems_monitor_dname_t *, rtems_id *);
|
||||
void rtems_monitor_dname_canonical(rtems_monitor_dname_t *, void *);
|
||||
void rtems_monitor_dname_dump_header(boolean);
|
||||
void rtems_monitor_dname_dump(rtems_monitor_dname_t *, boolean);
|
||||
|
||||
/* symbols.c */
|
||||
rtems_symbol_table_t *rtems_symbol_table_create();
|
||||
void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
|
||||
|
||||
rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
|
||||
const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
|
||||
void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
|
||||
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
|
||||
void rtems_monitor_symbol_canonical_by_name(rtems_monitor_symbol_t *, char *);
|
||||
void rtems_monitor_symbol_canonical_by_value(rtems_monitor_symbol_t *, void *);
|
||||
unsigned32 rtems_monitor_symbol_dump(rtems_monitor_symbol_t *, boolean);
|
||||
void rtems_monitor_symbol_cmd(int, char **, unsigned32, boolean);
|
||||
|
||||
|
||||
extern rtems_symbol_table_t *rtems_monitor_symbols;
|
||||
|
||||
#ifndef MONITOR_PROMPT
|
||||
#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
|
||||
#endif
|
||||
|
||||
#define MONITOR_WAKEUP_EVENT RTEMS_EVENT_0
|
||||
|
||||
|
||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
||||
#define STRNEQ(a,b,n) (strncmp(a,b,n) == 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! __MONITOR_H */
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* RTEMS monitor symbol table functions
|
||||
*
|
||||
* Description:
|
||||
* Entry points for symbol table routines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_SYMBOLS_H
|
||||
#define _INCLUDE_SYMBOLS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
rtems_unsigned32 value;
|
||||
char *name;
|
||||
} rtems_symbol_t;
|
||||
|
||||
#define SYMBOL_STRING_BLOCK_SIZE 4080
|
||||
typedef struct rtems_symbol_string_block_s {
|
||||
struct rtems_symbol_string_block_s *next;
|
||||
char buffer[SYMBOL_STRING_BLOCK_SIZE];
|
||||
} rtems_symbol_string_block_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
rtems_unsigned32 sorted; /* are symbols sorted right now? */
|
||||
rtems_unsigned32 growth_factor; /* % to grow by when needed */
|
||||
rtems_unsigned32 next; /* next symbol slot to use when adding */
|
||||
rtems_unsigned32 size; /* max # of symbols */
|
||||
|
||||
/*
|
||||
* Symbol list -- sorted by address (when we do a lookup)
|
||||
*/
|
||||
|
||||
rtems_symbol_t *addresses; /* symbol array by address */
|
||||
|
||||
/*
|
||||
* String pool, unsorted, a list of blocks of string data
|
||||
*/
|
||||
|
||||
rtems_symbol_string_block_t *string_buffer_head;
|
||||
rtems_symbol_string_block_t *string_buffer_current;
|
||||
rtems_unsigned32 strings_next; /* next byte to use in this block */
|
||||
|
||||
} rtems_symbol_table_t;
|
||||
|
||||
#define rtems_symbol_name(sp) ((sp)->name)
|
||||
#define rtems_symbol_value(sp) ((sp)->value)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! _INCLUDE_SYMBOLS_H */
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,43 +0,0 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
|
||||
include_rtemsdir = $(includedir)/rtems
|
||||
|
||||
LIBNAME = libmw-fb-tmp
|
||||
LIB = ${ARCH}/${LIBNAME}.a
|
||||
|
||||
C_FILES = mw_fb.c mw_uid.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
|
||||
|
||||
include_rtems_HEADERS = mw_fb.h mw_uid.h
|
||||
|
||||
SRCS = $(C_FILES)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/compile.am
|
||||
include $(top_srcdir)/../../../automake/lib.am
|
||||
|
||||
$(PROJECT_INCLUDE)/rtems:
|
||||
@$(mkinstalldirs) $@
|
||||
$(PROJECT_INCLUDE)/rtems/%.h: %.h
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
${LIB}: ${OBJS}
|
||||
$(make-library)
|
||||
|
||||
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
|
||||
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
|
||||
|
||||
all-local: ${ARCH} $(PREINSTALL_FILES) $(LIB) $(TMPINSTALL_FILES)
|
||||
|
||||
.PRECIOUS: $(LIB)
|
||||
|
||||
EXTRA_DIST = $(C_FILES)
|
||||
|
||||
include $(top_srcdir)/../../../automake/local.am
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user