T
EXAS
I
NSTRUMENTS
T
EXAS
I
NSTRUMENTS
Process Control Daemon
SOFTWARE HIGH-LEVEL DESIGN DOCUMENT
Document Revision: 0.3
Document Status: Preliminary
Last Updated On: June 1st, 2010
Last Updated By: Hai Shalom
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Contributors to this document:
Copyright © 2010 Texas Instruments Incorporated - http://www.ti.com/
Copyright © 2010 Hai Shalom – mailto:hai.shalom@gmail.com
T
EXAS
I
NSTRUMENTS
Process Control Daemon
Software High-Level Design Document
Revision 0.3
0.3
2
Revision History
Revision Author Date Comments
0.1 Hai Shalom 10-03-2010 Draft
0.2 Hai Shalom 23-05-2010 Updates after preliminary presentation
0.3 Hai Shalom 01-06-2010 Final version
T
EXAS
I
NSTRUMENTS
Process Control Daemon
Software High-Level Design Document
Revision 0.3
0.3
3
TABLE OF CONTENTS
TABLE OF CONTENTS........................................................................................................................................3
1. Introduction ..............................................................................................................................................5
2. Operating System ....................................................................................................................................5
3. Process Control Daemon requirements...................................................................................................5
4. Process Control Daemon context ............................................................................................................5
5. Process Control Daemon configuration...................................................................................................6
5.1. Rules configuration file.............................................................................................................................6
5.1.1. Inclusion of more rule files...................................................................................................................6
5.1.2. Rule Identification ................................................................................................................................6
5.1.2.1. Indexed Rule Identification ..................................................................................................................6
5.1.3. Start and End conditions .....................................................................................................................6
5.1.4. Scheduling ...........................................................................................................................................7
5.1.5. Timeouts ..............................................................................................................................................7
5.1.6. Failure (recovery) actions....................................................................................................................7
5.1.7. Daemon flag ........................................................................................................................................7
5.1.8. Active flag ............................................................................................................................................7
5.1.9. Syntax errors and run-time errors handling.........................................................................................7
5.1.10. Configuration file syntax ......................................................................................................................8
5.2. Configuration Implementation..................................................................................................................9
5.2.1. Data Storage........................................................................................................................................9
5.2.2. Parsing.................................................................................................................................................9
5.2.3. Offline Parsing .....................................................................................................................................9
5.2.3.1. Header file generation .........................................................................................................................9
5.2.3.2. Graph file generation ...........................................................................................................................9
6. Process Control Daemon Core..............................................................................................................10
6.1. Initialization ............................................................................................................................................10
6.1.1. Command line Parameters................................................................................................................10
6.1.1.1. File .....................................................................................................................................................10
6.1.1.2. Print....................................................................................................................................................10
6.1.1.3. Verbose .............................................................................................................................................10
6.1.1.4. Tick ....................................................................................................................................................10
6.1.1.5. Error log .............................................................................................................................................10
6.1.1.6. Debug ................................................................................................................................................10
6.1.2. Scheduling .........................................................................................................................................10
6.2. Parser module........................................................................................................................................11
6.3. Rules database module .........................................................................................................................11
6.3.1. Rule object.........................................................................................................................................11
6.3.2. Rule states.........................................................................................................................................11
6.3.3. Rules Database storage....................................................................................................................12
6.4. Timer service module.............................................................................................................................12
6.4.1. Timer service data structure..............................................................................................................13
6.5. Condition Check module........................................................................................................................14
6.6. Failure action module.............................................................................................................................14
6.7. Process module .....................................................................................................................................15
6.7.1. Process state.....................................................................................................................................15
6.7.2. Process exit state ..............................................................................................................................15
6.7.3. Process module data structure..........................................................................................................15
6.7.4. Process module start and stop iterations ..........................................................................................15
T
EXAS
I
NSTRUMENTS
Process Control Daemon
Software High-Level Design Document
Revision 0.3
0.3
4
6.7.5. Process Parameters ..........................................................................................................................16
6.7.5.1. Static Parameters ..............................................................................................................................16
6.7.5.2. Dynamic Parameters .........................................................................................................................16
6.7.5.3. Environment Variable Parameters.....................................................................................................16
6.8. Exception module...................................................................................................................................16
6.9. Error logger module ...............................................................................................................................16
6.10. PCD API module....................................................................................................................................16
7. PCD API.................................................................................................................................................17
8. System description.................................................................................................................................18
9. Use cases ..............................................................................................................................................19
9.1. Creating a process.................................................................................................................................19
9.2. Creating a Daemon process ..................................................................................................................19
9.3. Creating a process with a specified priority ...........................................................................................19
9.4. Creating dependency between processes ............................................................................................19
9.5. Creating a process in a runtime configurable fashion ...........................................................................19
9.6. Creating numerous processes of the same executable in a runtime configurable fashion...................19
9.7. Synchronizing processes.......................................................................................................................19
9.8. Monitoring Processes Resource creation and timeout..........................................................................20
9.9. Monitoring Processes and recover from failure.....................................................................................20
10. Unit tests ................................................................................................................................................21
10.1. Parser module test.................................................................................................................................21
10.2. Rules DB module test ............................................................................................................................21
10.3. Condition Check module test.................................................................................................................21
10.4. Failure action module test......................................................................................................................21
10.5. Timer module test ..................................................................................................................................21
10.6. Process module test ..............................................................................................................................21
10.7. API test...................................................................................................................................................21
T
EXAS
I
NSTRUMENTS
Process Control Daemon
Software High-Level Design Document
Revision 0.3
0.3
5
1. Introduction
The purpose of this document is to specify the software design of the Process Control Daemon,
according to the requirements document.
The purpose of the Process Control Daemon is to provide a management tool which controls the
system initialization process and monitors resources and processes.
1.1. Glossary
TBD To be defined
API Application Program Interface
OS Operating system
PCD Process Control Daemon
IPC Inter Process Communication
2. Operating System
The Process Control Daemon API and implementation are meant to run under Linux OS.
3. Process Control Daemon requirements
The Process Control Daemon requires the Linux API and IPC library.
4. Process Control Daemon context
The PCD runs on its own context as a user space application. PCD APIs are exported by a header file
and a shared library.
The Process Control Daemon must be initialized before any of its users.