Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Papyrus-RT/User/User Guide/Tips

PapyrusForRealTime-Logo-Icon.png




Tips & Tricks




Overview

This page contains usage tips and tricks for Papyrus for Real Time.

Modeling

Runtime

You may know that Papyrus-RT provides a logging mechanism, the "Log" service, that can be used within your model to output information from you model. By default, this information is sent to the standard error output, e.g., "stderr." So to see the output of the log, you can simply run your application from the command line and look at the output, e.g.,

./MyApp

You can also redirect the output to a file:

./MyApp >& myAppLog.log

You can also turn this on programmatically, in cases where you can not change the command line, e.g., for an application running on an embedded platform or if you want to selectively log parts of the execution.

This is done by using the "redirect" method (message) on the port:

log.redirect("mylog.log"); (where ""mylog.log" is the name of the file where the log will be written.)

Note.png
Note
This will redirect logging, but only for that specific log port. Other log ports will not be affected.


Command Line Flags

there are other flags that can be used form the command line to have access to runtime service library information. These are accessed through command line paramater to the executable generated by the tool from the generated code. Here is the general format for the command line, followed by the list of flags.

Usage

  ./TopMain [-h] [-u] [-l] [-c<controllers-file>] [-D0/1] [-C0/1] [-s] [-T<type>] [-t<type>] [-M] [-S0/1] [-N0/1] [-F0/1] [-L0/1] [-n0/1] [-r0/1] [-m0/1] 


Short Flag Long Flag Description
[-h] [--help] Print usage and exit
[-u] [--userargs] Marks the start of application options
[-l] or [--logmsg] Enable capsule logMsg output of injected signals
[-c <controllers-file>] [--controllers=<controllers-file>] Specify a capsule-to-controller map file

Debug Features

Short Flag Long Flag Description
[-D 0/1] [--debug=0/1] Overall debug log enable.
[-C 0/1] [--debugcolor=0/1] Disable/enable terminal text color escape sequences.
[-s] [--debugsummary] Output debug summary.
[-T <type>] [--debugtypeon=<type>] Enable debug types. See <type> below.
[-t <type>] [--debugtypeoff=<type>] Disable debug types. See <type> below.
[-M] [--debugmodel] Output instance UML-RT model after startup. (Usually also requires '-T model')

Enabling invidual log message components

Short Flag Long Flag Description
[-S 0/1] or [--debugtime=0/1] Disable/enable log time-stamp.
[-N 0/1] or [--debugname=0/1] Disable/enable log type name.
[-F 0/1] or [--debugfile=0/1] Disable/enable log file-name.
[-L 0/1] or [--debugline=0/1] Disable/enable log file line #.
[-n 0/1] or [--debugthread=0/1] Disable/enable log thread name (or id).
[-r 0/1] or [--debugmethod=0/1] Disable/enable log method name.
[-m 0/1] or [--debugmsg=0/1] Disable/enable log application message.

Types

<type> is a string that matches (case-insensitive) one of the following debug-types:

BIND BINDDEBUG BINDFAIL COMMAND
CONNECT CONTROLLER CONTROLLERMAP DESTROY
ERROR HASHMAP IMPORT INJECT
INSTANTIATE LOCK LOGMSG MAIN
MODEL MSG MSGALLOC PARAMETER
SAP SEND SERIALIZE SIGNAL
SIGNALDATA SIGNALREF SIGNALINIT SIGNALALLOC
SWERR TIMER TIMERALLOC

Copyright © Eclipse Foundation, Inc. All Rights Reserved.