"The dump will contain one paragraph for each module. The first line gives module\n"
"information, additional lines list all connectors and their peers (if connected).\n"
"\n"
- "This information can be processed by 'PPI/drawmodules.py' and 'dot' (from the\n"
+ "This information can be processed by 'tools/drawmodules.py' and 'dot' (from the\n"
"graphviz package) to generate a graphic representation of the module structure:\n"
"\n"
" $ echo /sys/ppi/dump | nc -q1 <host> <port> \\\n"
- " | python PPI/drawmodules.py | dot -Tpng /dev/fd/0 >modules.png\n")
+ " | python tools/drawmodules.py | dot -Tpng /dev/fd/0 >modules.png\n")
);
}
prefix_ void senf::ppi::ModuleManager::dumpModules(std::ostream & os)
+ const
{
for (ModuleRegistry::const_iterator i (moduleRegistry_.begin()), i_end (moduleRegistry_.end());
i != i_end; ++i) {
for (module::Module::ConnectorRegistry::iterator j ((*i)->connectorRegistry_.begin()),
j_end ((*i)->connectorRegistry_.end()); j != j_end; ++j) {
os << " " << *j << " " << prettyName(typeid(**j));
- if ((**j).connected())
+ if ((**j).connected()) {
os << " " << & (*j)->peer();
+ connector::PassiveConnector * pc (dynamic_cast<connector::PassiveConnector *>(*j));
+ if (pc && pc->throttled())
+ os << " throttled";
+ }
os << "\n";
}
os << "\n";
.add("route", fty::Command(&Target::consoleRoute, this)
.arg("index", "index at which to insert new rule")
.arg("parameters", "log parameters. The log parameters select the log stream, log area\n"
- " and log level. You may specify any combination of these parameterse\n"
+ " and log level. You may specify any combination of these parameters\n"
" in any order. Use the '/sys/log/stream' and '/sys/log/areas' commands\n"
" to list all valid streams and areas. Valid log levels are:\n"
" VERBOSE NOTICE MESSAGE IMPORTANT CRITICAL FATAL")
consoleDir_()
.add("message", fty::Command(&TargetRegistry::consoleWrite, this)
.arg("parameters", "log parameters. The log parameters select the log stream, log area\n"
- " and log level. You may specify any combination of these parameterse\n"
+ " and log level. You may specify any combination of these parameters\n"
" in any order. Use the '/sys/log/stream' and '/sys/log/areas' commands\n"
" to list all valid streams and areas. Valid log levels are:\n"
" VERBOSE NOTICE MESSAGE IMPORTANT CRITICAL FATAL",
else:
connectorid, type = line.split(' ',1);
connectorid = connectorid[1:]
-
- packet = type.rsplit('<',1)[1];
- packet = packet.rsplit('::',1)[-1];
- packet = packet.split('>',1)[0];
-
- elts = type.rsplit(' ',1);
+
+ packet = type.rsplit('<',1)[1]
+ packet = packet.rsplit('::',1)[-1]
+ packet = packet.split('>',1)[0]
+
+ throttled = False
+ elts = type.rsplit(' ', 1);
if elts[-1].startswith('0x'):
- type, peerid = elts
- peerid = peerid[1:]
+ type, peerid = elts[0], elts[1][1:]
else:
- peerid = None
+ if elts[-1] == ('throttled'):
+ throttled = True
+ elts = elts[0].rsplit(' ', 1)
+ type, peerid = elts[0], elts[1][1:]
+ else:
+ peerid = None
modules[moduleid][1].append((connectorid, type, peerid, packet))
- connectors[connectorid] = moduleid
+ connectors[connectorid] = (moduleid, throttled)
for moduleid, (module, cs) in modules.iteritems():
module = module.split('<',1)[0]
module = module.rsplit('::',1)[-1]
inputs = []
outputs = []
- for connectorid, type, peerid,packet in cs:
+ for connectorid, type, peerid, packet in cs:
if 'Input' in type: inputs.append("<%s>%s" % (connectorid,connectorid))
else: outputs.append("<%s>%s" % (connectorid,connectorid))
rows = []
if inputs: rows.append("{%s}" % "|".join(inputs))
- rows.append("%s (%s)" % (module, moduleid))
+ rows.append("%s" % (module))
if outputs: rows.append("{%s}" % "|".join(outputs))
sys.stdout.write('%s [label="{%s}" style="filled" fillcolor="/%s/%s" ]\n'
% (moduleid, "|".join(rows),COLOR_SCHEME, color ))
for connectorid, type, peerid, packet in cs:
opts = []
if "Passive" in type: opts.append("arrowtail=odot");
+ if "Output" in type and peerid is not None:
+ if "Active" in type and connectors[peerid][1]:
+ opts.append("arrowhead=tee")
+ opts.append('headlabel="!"')
+ if "Passive" in type and connectors[connectorid][1]:
+ opts.append("arrowtail=tee")
+ opts.append('taillabel="!"')
opts = ",".join(opts)
if opts: opts = " [%s]" % opts
if "Output" in type and peerid is not None:
- if "Packet" in packet and p is 1:
- sys.stdout.write('%s:%s -> %s:%s%s [label=" %s", fontsize=8, fontname="Helvetica"]\n'
- % (moduleid, connectorid, connectors[peerid], peerid, opts,packet))
- else:
- sys.stdout.write('%s:%s -> %s:%s%s\n'
- % (moduleid, connectorid, connectors[peerid], peerid, opts))
+ if "Packet" in packet and p is 1:
+ sys.stdout.write('%s:%s -> %s:%s%s [label=" %s", fontsize=8, fontname="Helvetica"]\n'
+ % (moduleid, connectorid, connectors[peerid][0], peerid, opts,packet))
+ else:
+ sys.stdout.write('%s:%s -> %s:%s%s\n'
+ % (moduleid, connectorid, connectors[peerid][0], peerid, opts))
elif peerid is None:
sys.stdout.write('anon%d [label="", shape=point, height=.05];\n' % anonid)
if "Output" in type: