Re: expand(1) manual documents non-existant "-a" option

2017-10-19 Thread Jason McIntyre
On Thu, Oct 19, 2017 at 09:20:25PM +0200, Andreas Kusalananda K?h?ri wrote:
> >Synopsis:expand(1) manual documents non-existant "-a" option
> >Category:documentation
> >Environment:
>   System  : OpenBSD 6.2
>   Details : OpenBSD 6.2 (GENERIC.MP) #0: Thu Oct 12 19:53:18 CEST 2017
>
> r...@syspatch-62-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>   Architecture: OpenBSD.amd64
>   Machine : amd64
> >Description:
> 
> The documentation of the expand(1) utility contains references to an
> option "-a":
> 
>  -aBy default, only leading blanks and tabs are reconverted to maximal
>strings of tabs.  If the -a option is given, tabs are inserted
>whenever they would compress the resultant file by replacing two or
>more characters.
> 
> However, this option is not implemented:
> 
>   while ((c = getopt (argc, argv, "t:")) != -1) {
>   switch (c) {
>   case 't':
>   getstops(optarg);
>   break;
>   case '?':
>   default:
>   usage();
>   /* NOTREACHED */
>   }
>   }
> 
> 
> >How-To-Repeat:
> 
> Type "man expand", read.
> 
> Then:
> 
>   $ expand -a somefile
>   expand: unknown option -- a
>   usage: expand [-t tablist] [file ...]
> 
> 
> >Fix:
> 
> The "-a" option is not part of the POSIX spec for this utility,
> and there's no dead code in expand.c that implments it.  I would
> therefore suggest just removing the mentioning of "-a" from expand.1.
> Alternatively, implement the option according to the manual.
> 

hi.

the manual page documents both expand and unexpand. guess which one
support -a ;)

jmc



expand(1) manual documents non-existant "-a" option

2017-10-19 Thread Andreas Kusalananda Kähäri
>Synopsis:  expand(1) manual documents non-existant "-a" option
>Category:  documentation
>Environment:
System  : OpenBSD 6.2
Details : OpenBSD 6.2 (GENERIC.MP) #0: Thu Oct 12 19:53:18 CEST 2017
 
r...@syspatch-62-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Architecture: OpenBSD.amd64
Machine : amd64
>Description:

The documentation of the expand(1) utility contains references to an
option "-a":

 -aBy default, only leading blanks and tabs are reconverted to maximal
   strings of tabs.  If the -a option is given, tabs are inserted
   whenever they would compress the resultant file by replacing two or
   more characters.

However, this option is not implemented:

while ((c = getopt (argc, argv, "t:")) != -1) {
switch (c) {
case 't':
getstops(optarg);
break;
case '?':
default:
usage();
/* NOTREACHED */
}
}


>How-To-Repeat:

Type "man expand", read.

Then:

$ expand -a somefile
expand: unknown option -- a
usage: expand [-t tablist] [file ...]


>Fix:

The "-a" option is not part of the POSIX spec for this utility,
and there's no dead code in expand.c that implments it.  I would
therefore suggest just removing the mentioning of "-a" from expand.1.
Alternatively, implement the option according to the manual.

dmesg:
OpenBSD 6.2 (GENERIC.MP) #0: Thu Oct 12 19:53:18 CEST 2017

r...@syspatch-62-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4278124544 (4079MB)
avail mem = 4141453312 (3949MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xe1000 (10 entries)
bios0: vendor innotek GmbH version "VirtualBox" date 12/01/2006
bios0: innotek GmbH VirtualBox
acpi0 at bios0: rev 2
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP APIC SSDT
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz, 2808.43 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,RDRAND,NXE,RDTSCP,LONG,LAHF,ABM,3DNOWP,ITSC,RDSEED,CLFLUSHOPT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: TSC frequency 2808425220 Hz
cpu0: smt 0, core 0, package 0
mtrr: CPU supports MTRRs but not enabled by BIOS
cpu0: apic clock running at 1000MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz, 2808.17 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,RDRAND,NXE,RDTSCP,LONG,LAHF,ABM,3DNOWP,ITSC,RDSEED,CLFLUSHOPT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
, remapped to apid 2
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
"PNP0F03" at acpi0 not configured
acpibat0 at acpi0: BAT0 model "1" serial 0 type VBOX oem "innotek"
acpiac0 at acpi0: AC unit online
acpivideo0 at acpi0: GFX0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82441FX" rev 0x02
pcib0 at pci0 dev 1 function 0 "Intel 82371SB ISA" rev 0x00
vga1 at pci0 dev 2 function 0 "InnoTek VirtualBox Graphics Adapter" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
em0 at pci0 dev 3 function 0 "Intel 82540EM" rev 0x02: apic 2 int 19, address 
08:00:27:1c:bb:55
"InnoTek VirtualBox Guest Service" rev 0x00 at pci0 dev 4 function 0 not 
configured
piixpm0 at pci0 dev 7 function 0 "Intel 82371AB Power" rev 0x08: apic 2 int 23
iic0 at piixpm0
mpi0 at pci0 dev 20 function 0 "Symbios Logic 53c1030" rev 0x00: apic 2 int 20
mpi0: VBox MPT Fusion, firmware 0.0.0.0
scsibus1 at mpi0: 16 targets, initiator 7
cd0 at scsibus1 targ 0 lun 0:  SCSI3 5/cdrom removable
sd0 at scsibus1 targ 1 lun 0:  SCSI3 0/direct fixed
sd0: 5120MB, 512 bytes/sector, 10485760 sectors
sd1 at scsibus1 targ 2 lun 0:  SCSI3 0/direct fixed
sd1: 51200MB, 512 bytes/sector, 104857600 sectors
sd2 at scsibus1 targ 3 lun 0:  SCSI3 0/direct fixed
sd2: 51200MB, 512 bytes/sector, 104857600 sectors
mpi0: target 0 Async at 0MHz width 8bit offset 0 QAS 0 DT 0 IU 0
mpi0: target 1 Async at 0MHz width 8bit offset 0 QAS 0 DT 0 IU 0
mpi0: target 2 Async at 0MHz width 8bit offset 0 QAS 0 DT 0 IU 0
mpi0: target 3 Async at 0MHz width 8bit offset 0 QAS 0 DT 0 IU 0
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0

Re: frozen clock on Intel NUC

2017-10-19 Thread Mike Belopuhov
On Thu, Oct 19, 2017 at 08:25 -0400, Joe Gidi wrote:
> >> On Tue, Oct 17, 2017 at 7:43 PM, Mike Belopuhov 
> >> wrote:
> >> >
> >> > Looks like your acpitimer takes a bit too much to obtain the value
> >> > and exceeds the threshold that we've imposed.  Adam, I'd like to
> >> > commit the diff below but unsure how many successes should we consider
> >> > before accepting the value.
> >>
> >> That is a very good question, i am am sorry i don't
> >> have any information on number of failed/successful attempts, so i can
> >> not
> >> offer any great insights.
> >>
> >
> > He had 0/3.  I've decided to go for 2 out of 3 as a success for now, but
> > increased the threshold to 50.  We'll see what drift values these systems
> > will be observing.
> >
> > Joe, could you please update tsc.c to rev1.3 and if tsc will be picked up
> > as a timecounter by the system (sysctl -n kern.timecounter.hardware) see
> > what clock drift your system is going to develop in about a day
> > (cat /var/db/ntpd.drift).
> 
> Clock drift is at -16.829. Other amd64 boxes here are at -10.408 and -0.812.
>

That's acceptable if it's not much worse than it was before...
Do you have the old number?  You can switch to acpitimer and
run it for a day with "kern.timecounter.hardware=acpitimer0".

> Thanks,
> 
> -- 
> 
> Joe Gidi
> j...@entropicblur.com
> 
> "You cannot buy skill." -- Ross Seyfried
> 



Re: frozen clock on Intel NUC

2017-10-19 Thread Joe Gidi
>> On Tue, Oct 17, 2017 at 7:43 PM, Mike Belopuhov 
>> wrote:
>> >
>> > Looks like your acpitimer takes a bit too much to obtain the value
>> > and exceeds the threshold that we've imposed.  Adam, I'd like to
>> > commit the diff below but unsure how many successes should we consider
>> > before accepting the value.
>>
>> That is a very good question, i am am sorry i don't
>> have any information on number of failed/successful attempts, so i can
>> not
>> offer any great insights.
>>
>
> He had 0/3.  I've decided to go for 2 out of 3 as a success for now, but
> increased the threshold to 50.  We'll see what drift values these systems
> will be observing.
>
> Joe, could you please update tsc.c to rev1.3 and if tsc will be picked up
> as a timecounter by the system (sysctl -n kern.timecounter.hardware) see
> what clock drift your system is going to develop in about a day
> (cat /var/db/ntpd.drift).

Clock drift is at -16.829. Other amd64 boxes here are at -10.408 and -0.812.

Thanks,

-- 

Joe Gidi
j...@entropicblur.com

"You cannot buy skill." -- Ross Seyfried