[please keep my mail address on CC]
Am 2018-08-06 16:53, schrieb Richard Cochran:
On Mon, Aug 06, 2018 at 09:27:18AM +0200, Stephan Gatzka wrote:
Hi!
> I came up with the following solutions to this problem:
> (1) Poll the state using the unix domain socket and PTP messages
> (2) Extend the event system of linuxptp (SUBSCRIBE_EVENTS_NP)
> (3) Provide hooks at some places inside linuxptp
>
(1) is not desirable because of polling. I would opt for (2). The main
reason is that we can reuse the existing event mechanism.
Yes, that is whole idea of having a push mechanism. So far, there
hasn't been any specific need to extend it.
Would an implemention (like execute some shell scripts on specific
events) inside linuxptp be accepted at all? I don't wanna spend time on
coding on things which are doomed.
Let's say we want a hook which is executed on a state machine change.
Something which is configured by:
[global]
runScriptOnStmChange /etc/linuxptp/script.sh
From an end-user perspective, this is something which can easily be
used, I guess. This could also be an external script/daemon, but then,
two daemons (ptp4l and "run-hook-daemon") have to be started. Also there
needs some kind of protocol between these two, we could reuse
SUBSCRIBE_EVENTS_NP, but have to add other events to it.
And despite what programmers are taught to believe, polling really
isn't always evil. You could make a perfectly adequate network
monitoring tool with this pattern:
while [ 1 ]; do
pmc -4 -b 2 -i eth0 "get foo" "get bar" | pretty_display
sleep 2
done
This is something which could be done right now without any changes. And
like you said, should be good enough for monitoring. But IMHO it falls
short for the Qbv use case. Eg. you could miss some events; like
transitions MASTER -> SLAVE -> MASTER within the poll interval.
After all, any time critical actions are taken by ptp4l directly.
At least in terms of PTP. But if you use Qbv which depends on PTP you'll
have your scheduler reloaded as fast as possible. Of course, this is not
time critical for accuracy reasons, but you still want to have decent
performance.
-michael
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel