Re: [Linuxptp-devel] [PATCH RFC 0/3] Optional prefix for ptp4l/phc2sys log messages

2016-11-02 Thread Richard Cochran
On Tue, Oct 18, 2016 at 10:36:54AM +0200, Miroslav Lichvar wrote:
> On Mon, Oct 17, 2016 at 08:46:22PM +, Keller, Jacob E wrote:
> > Is it possible to update configuration somehow to allow passing a
> > variable as "empty" which will assign it to empty string, and then
> > update your prefix code flow so that it correctly works and doesn't add
> > a " " when the string is actually empty? Not sure how easy it would be
> > to fix that or not.
> 
> I think that would be an easy fix.
> 
> Another possibility is to allow double-quotes around strings in the
> config. If the first and last character of the string was ", they
> would be removed. The default value for logging_prefix would simply be
> "". If someone is already using quoted strings in userDescription,
> productDescription or revisionData, they would have to have an extra
> pair of quotes around them.
> 
> What do you think?

I don't think it is worth the effort to support null strings in the
config file.  This opens up a whole can of worms of quoting and
escaping issues.

We already don't have every option as a default anyhow.  Let's keep it
simple for now, and say "omit option from config for null".

Thanks,
Richard

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH RFC 0/3] Optional prefix for ptp4l/phc2sys log messages

2016-10-18 Thread Miroslav Lichvar
On Mon, Oct 17, 2016 at 08:46:22PM +, Keller, Jacob E wrote:
> On Mon, 2016-10-17 at 16:33 +0200, Miroslav Lichvar wrote:
> > When there are multiple instances of ptp4l or phc2sys running on the
> > system, it's difficult to tell which message belongs to which
> > instance. The first patch adds new options to ptp4l and phc2sys which
> > can be used to specify a different prefix for each instance, so
> > different instances can use different prefixes. One issue is that
> > it's
> > not possible to set the prefix in ptp4l config to its default value
> > (empty string) and the setting can't be included in defaults.cfg.
> > 
> 
> Is it possible to update configuration somehow to allow passing a
> variable as "empty" which will assign it to empty string, and then
> update your prefix code flow so that it correctly works and doesn't add
> a " " when the string is actually empty? Not sure how easy it would be
> to fix that or not.

I think that would be an easy fix.

Another possibility is to allow double-quotes around strings in the
config. If the first and last character of the string was ", they
would be removed. The default value for logging_prefix would simply be
"". If someone is already using quoted strings in userDescription,
productDescription or revisionData, they would have to have an extra
pair of quotes around them.

What do you think?

-- 
Miroslav Lichvar

--
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


Re: [Linuxptp-devel] [PATCH RFC 0/3] Optional prefix for ptp4l/phc2sys log messages

2016-10-17 Thread Keller, Jacob E
On Mon, 2016-10-17 at 16:33 +0200, Miroslav Lichvar wrote:
> When there are multiple instances of ptp4l or phc2sys running on the
> system, it's difficult to tell which message belongs to which
> instance. The first patch adds new options to ptp4l and phc2sys which
> can be used to specify a different prefix for each instance, so
> different instances can use different prefixes. One issue is that
> it's
> not possible to set the prefix in ptp4l config to its default value
> (empty string) and the setting can't be included in defaults.cfg.
> 

Is it possible to update configuration somehow to allow passing a
variable as "empty" which will assign it to empty string, and then
update your prefix code flow so that it correctly works and doesn't add
a " " when the string is actually empty? Not sure how easy it would be
to fix that or not.

Thanks,
Jake

> The second patch adds support for this feature to timemaster.
> 
> The third patch is an unrelated improvement in timemaster to exit
> early with an error message when an interface doesn't support neither
> HW nor SW timestamping. (The patch applies only with the second
> patch,
> so it's included here.)
> 
> Miroslav Lichvar (3):
>   Add options to prefix ptp4l and phc2sys log messages.
>   timemaster: prefix ptp4l and phc2sys messages.
>   timemaster: check support for SW time stamping.
> 
>  config.c |  1 +
>  phc2sys.8|  4 
>  phc2sys.c|  9 +++--
>  print.c  | 18 ++
>  print.h  |  1 +
>  ptp4l.8  | 10 ++
>  ptp4l.c  |  9 -
>  timemaster.c | 34 ++
>  8 files changed, 71 insertions(+), 15 deletions(-)
> 
--
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


[Linuxptp-devel] [PATCH RFC 0/3] Optional prefix for ptp4l/phc2sys log messages

2016-10-17 Thread Miroslav Lichvar
When there are multiple instances of ptp4l or phc2sys running on the
system, it's difficult to tell which message belongs to which
instance. The first patch adds new options to ptp4l and phc2sys which
can be used to specify a different prefix for each instance, so
different instances can use different prefixes. One issue is that it's
not possible to set the prefix in ptp4l config to its default value
(empty string) and the setting can't be included in defaults.cfg.

The second patch adds support for this feature to timemaster.

The third patch is an unrelated improvement in timemaster to exit
early with an error message when an interface doesn't support neither
HW nor SW timestamping. (The patch applies only with the second patch,
so it's included here.)

Miroslav Lichvar (3):
  Add options to prefix ptp4l and phc2sys log messages.
  timemaster: prefix ptp4l and phc2sys messages.
  timemaster: check support for SW time stamping.

 config.c |  1 +
 phc2sys.8|  4 
 phc2sys.c|  9 +++--
 print.c  | 18 ++
 print.h  |  1 +
 ptp4l.8  | 10 ++
 ptp4l.c  |  9 -
 timemaster.c | 34 ++
 8 files changed, 71 insertions(+), 15 deletions(-)

-- 
2.9.3


--
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