- 08 Mar, 2013 2 commits
-
-
Alessandro Rubini authored
the portState field is probably a relic of ptpd, then the state machine was a single switch() statement. Many places were still setting it, but nobody was ever reading the field. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
There is no need for a "msg_tmp" in the pp-instance. All uses are really temporary to a function, so we can use local variables instead. (This is not the same as what was called tmp_header, which was referenced all over message processing, so it still exists, though renamed). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 07 Mar, 2013 38 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
A large number of functions here got hdr and ann, but struct pp_frgn_master includes such fields, and most callers passed hdr and ann from the same structure. So I chose to pass a foreign master instead of the two components, but I'm still unable to remove the two full structures inside until I clean up the msg.c mess. So, at the end, this is not really a step forward, but it helps such later step. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Since WR only needs one byte of information in the announce structure, we can make is generic by calling it differently. This changes only the name (and the size: it is now unsigned long), but has no effect on the marshalling/unmarshalling of such data. I'm touching this because I'm working on announce messages (as related to foreign masters). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I renamed port_identity to port_id so the compiler helped me. Then, since both fields are used at the same time, compare/copy them in a single shot. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The field was only to be set and reported, not really used. We definitely need a way to age potential masters, but counting announce messages without expiration is not the way. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Trivially, return what we have, becuase less than zero is less than zero. No, the wouldn't pass my exam. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When the "if" branch returns, we don't need an "else" branch. These students wouldn't pass my exam. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
You may be bored by these small changes, but I want to show that I didn't introduce errors. In any case, each such change is reducing both entropy in the source and binary size in the output. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This "type" was the only type represented as an array instead of being a structure. This leads to inconsistent use: if you memcpy the other ones you need "&", but not here. So this commit uses an encompassing structure, to have ClockIdentity behave like other composite fields. The commit has no effect at all on the generated binary files for wrpc but it unexpectedly reduces the size of the output on the PC. Anyways, the commit is trivial, and all changes can be easily verified to have no effect. While this increases entropy, the reasoning is that I want to assign structures instead of running zillions of memcpy functions, with the hairy PP_CLOCK_IDENTITY_LENGTH. So later commits, based on this one, reduce entropy. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is the result, on a master, with "-d 02": diag-time-2-eth0: posix_time_get: 1362675879.940187923 diag-time-1-eth0: timeout expired: PP_TO_ANN_INTERVAL diag-time-2-eth0: posix_time_get: 1362675880.081818439 diag-time-2-eth0: posix_time_get: 1362675880.233227916 diag-time-2-eth0: recv stamp: 1362675880.233227916 (user) diag-time-2-eth0: posix_time_get: 1362675880.233499803 diag-time-1-eth0: timeout expired: PP_TO_SYNC (time level 1 reports timeouts and set, level 2 reports get-time too). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Unfortunately, we need to pass ppi to the time operations, so we can have per-instance logging options. This is the second time I found the need for such extra argument: the first time I worked it around, now I surrender. Actually, I don't find it unlikely for a multi-instance process to spit a lot of diagnostics about timestamps. A developer may need to filter messages according to who is tiemstamping/timing out etc. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
One I forgot to remove when cleaning arch-spec, the oter I re-added by error quite some commits ago, after it was moved to lib-bare/bare-time.c Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This kills the global build-time macro pp_verbose_servo and uses flags instead. Again, until I review the servo, stuff is not always per-instance. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This kills the global build-time macro pp_verbose_dump to use flags instead. In msg.c this commit fakes the old pp_verbose_dump, which however is extracted from the global flags. So, setting "frames" level to 2 prints information on frames being received ("-d 002"). Until I get to integrate tools/ptpdump in the daemon itself, we have no instance-specific dump, nor symmetric dumping of input and output. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
An error of mine. Removed, but make pp_error add "ERROR: " in front of the format string it receives. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This converts fsm.c to use the new diagnostics. We keep printing the timestamp for fsm messages, which means diag.c::__pp_diag is somehow duplicated here (in what was called pp_timed_printf). This is the output with "-d 1" (or "-d "100") on a forced-slave ("-g"): diag level: 10000000 diag-fsm-1-eth0: 1362666577.043: ENTER initializing, packet len 0 diag-fsm-1-eth0: 1362666577.045: LEAVE initializing (next: 4 in 0 ms) diag-fsm-1-eth0: 1362666577.045: ENTER listening, packet len 0 diag-fsm-1-eth0: 1362666577.045: listening: reenter in 11999 ms diag-fsm-1-eth0: 1362666587.204: listening: reenter in 1840 ms diag-fsm-1-eth0: 1362666588.388: LEAVE listening (next: 9 in 0 ms) diag-fsm-1-eth0: 1362666588.388: ENTER slave, packet len 44 diag-fsm-1-eth0: 1362666588.389: slave: reenter in 889 ms diag-fsm-1-eth0: 1362666589.219: slave: reenter in 59 ms Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
By passing "-V -d 001" now I get level-1 diagnostics for frames (i.e. sending and receiving): Slave: diag-frames-1-eth0: RECV 44 bytes at 1362665418.025198568 (type 0) diag-frames-1-eth0: RECV 44 bytes at 1362665418.025970153 (type 8) diag-frames-1-eth0: SENT 44 bytes at 1362665416.806670510 (delay_req) diag-frames-1-eth0: RECV 54 bytes at 1362665416.808217467 (type 9) Master: diag-frames-1-eth0: SENT 64 bytes at 1362665415.430554014 (announce) diag-frames-1-eth0: SENT 44 bytes at 1362665416.612818573 (sync) diag-frames-1-eth0: SENT 44 bytes at 1362665416.613056524 (follow_up) diag-frames-1-eth0: RECV 44 bytes at 1362665416.807983194 (type 1) diag-frames-1-eth0: SENT 54 bytes at 1362665416.808206209 (delay_resp) (note: we don't tell names at receive time because the frame is still to be validated). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This only introduces the header files, the actual code is still missing, and is added by later commits. I still want this to be by itself because it explains the thing (please read the comments in diag-macros.h, that I won't copy in this commit message). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I need to refer to ppi->flags from inside diag-macros.h, so this splits out a new header, which is expected to only be included by ppsi.h (no change for our developers). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Actually, until this commit we could not use pp_printf inside ppsi.h, in inline functions or whatever. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This adds the interface name where the error happened (we'll need it for multi-link setups, that Aurelio is going to implement soon). Moreover, this kills the last pp_diag_error call Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This finally removes the diag directory by folding two one-line functions into diag.h. The dir is a relic of ptp-proposal that hosted pp_printf, but now we have it separate anyways. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-