Re: DTrace (or other monitor) access to LBA of a block device

2010-12-03 Thread Artem Belevich
On Thu, Dec 2, 2010 at 1:33 PM, Thomas Zander
 wrote:
> Hi,
>
> do we have any way to monitor which LBAs of which block device are
> read/written at a given time?
>
> I stumbled upon this,
> http://southbrain.com/south/2008/02/fun-with-dtrace-and-zfs-mirror.html
>
> which is pretty intriguing. Unfortunately on FreeBSD we do not have
> the DTrace io provider, so his dtrace script would not work.
> Do we have another option to monitor block device access in a similar fashion?

GEOM sounds like a good candidate for probing of that kind.

sudo dtrace -n 'fbt:kernel:g_io_deliver:entry { printf("%s %d %d
%d\n",stringof(args[0]->bio_from->geom->name), args[0]->bio_cmd,
args[0]->bio_offset, args[0]->bio_length); }'

Keep in mind that g_io_deliver will be called for each GEOM node from
top to bottom for each completed request. You may need to add some
filtering on device name to avoid redundant info.

--Artem
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: FreeBSD Security Advisory FreeBSD-SA-10:10.openssl

2010-12-03 Thread Paul Mather
On Dec 2, 2010, at 4:54 AM, Gareth de Vaux wrote:

> On Thu 2010-12-02 (00:05), jhell wrote:
>> Try that with a ( make includes ) in that same directory and if it works
>> then the advisory will have to be revised.
> 
> Ah awesome, that works thanx.
> 
> (I don't see why though, since it was only half complaining about
> a missing definition, even when I manually included dtls1.h. Also,
> I tried on a different system and the advisory instructions worked
> as is).

The advisory instructions worked as-is for me on a 7.3-RELEASE-p3 system but 
failed on my 8.1-STABLE systems.  However, a "make buildworld" followed by a 
"make install" in the appropriate directory work successfully on the 8.1-STABLE 
machines.

Cheers,

Paul.


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Some /etc files seem out of date in RELENG_8 compared to RELENG_8_1

2010-12-03 Thread Lowell Gilbert
Geoff Roberts  writes:

> I was just doing and update to 8-PRERELEASE from 8.1 by using the
> RELENG_8 tag in cvsup.
>
> When I used mergemaster to update /etc, there were a number of files
> being merged into /etc that are older revisions than those I had in
> 8.1.
>
> You can check this for example by comparing the revision numbers at
> the following URLS.
>
> Compare say syslog.conf (there are a whole list of other files that
> are out of date).
>
> In 8.1 it has a revision of 1.30.2.1.4.1 - 5 months old
>
> In 8.X it has a revision of 1.30.2.1 - 16 months old
>
> http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/?only_with_tag=RELENG_8_1
>
>
> http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/?only_with_tag=RELENG_8
>
> Shouldn't RELENG_8 have all the changes that went into RELENG_8_1 as
> FreeBSD moves to 8.2?

It does.  The files are identical, except for the version stamp.

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


smartmontools 5.40 & ahci.ko -- doesn't work

2010-12-03 Thread Lev Serebryakov
Hello, Stable.

  Latest  smartmontools  5.40  doesn't  work  with AHCI driver :( I've
  found  old  thread  about  5.38, but I have 5.40 and it doesn't work
  with any `-d' type...

  What do I do wrong?


# id
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
# uname -srp
FreeBSD 8.2-PRERELEASE amd64
# ls /var/db/pkg | grep smart
smartmontools-5.40
# ls /dev/ada[0-9]
/dev/ada0   /dev/ada1   /dev/ada2   /dev/ada3   /dev/ada4   
/dev/ada5
blob# smartctl -A /dev/ada0
smartctl 5.40 2010-10-16 r3189 [FreeBSD 8.2-PRERELEASE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

/dev/ada0: No such file or directory
Smartctl: please specify device type with the -d option.

Use smartctl -h to get a usage summary
# smartctl -A -d ata /dev/ada0
smartctl 5.40 2010-10-16 r3189 [FreeBSD 8.2-PRERELEASE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T 
permissive' options.
# smartctl -A -d scsi /dev/ada0
smartctl 5.40 2010-10-16 r3189 [FreeBSD 8.2-PRERELEASE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl open device: /dev/ada0 failed: No such file or directory
# smartctl -A -d atacam /dev/ada0
smartctl 5.40 2010-10-16 r3189 [FreeBSD 8.2-PRERELEASE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl open device: /dev/ada0 failed: No such file or directory
#

-- 
// Black Lion AKA Lev Serebryakov 

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


8.2-PRERELEASE panic in NETGRAPH (ng_pppoe)

2010-12-03 Thread Artem Kim
Hello.

I have problem in one of my pppoe routers:

smp Xeon X5472, network adapter 82575EB 
mpd5,
FreeBSD nas4 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Thu Dec  2 19:07:46 MSK 
2010 x...@nas4:/usr/obj/usr/src/sys/router  i386

extra kernel config:

options KVA_PAGES=512

sysctl:

kern.ipc.maxsockbuf=524288
kern.ipc.nmbclusters=65535

net.graph.recvspace=40960
net.graph.maxdgram=40960
net.graph.maxdata=1024

net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1

vm.kmem_size=1512M
vm.kmem_size_max=1512M

This panic the second similar incident in the last 7 hours.
some debug info:

Fatal trap 12: page fault while in kernel mode
cpuid = 3; apic id = 03
fault virtual address   = 0x44
fault code  = supervisor read, page not present
instruction pointer = 0x20:0x805dfb56
stack pointer   = 0x28:0xfbbab944
frame pointer   = 0x28:0xfbbab970
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 1944 (mpd5)
trap number = 12
panic: page fault
cpuid = 2
KDB: stack backtrace:
#0 0x805fce6d at kdb_backtrace+0x48
#1 0x805cdb9c at panic+0x108
#2 0x8079bbd2 at trap_fatal+0x24c
#3 0x8079bf8e at trap_pfault+0x270
#4 0x8079c3db at trap+0x371
#5 0x807842dc at calltrap+0x6
#6 0x8068c2ae at ng_uncallout+0x1b
#7 0x8069c454 at ng_pppoe_disconnect+0xf8
#8 0x8068d5cc at ng_destroy_hook+0xe0
#9 0x8068e5e9 at ng_apply_item+0x903
#10 0x8068cea7 at ng_snd_item+0x2e9
#11 0x806a04f8 at ngc_send+0x1d3
#12 0x8062e01a at sosend_generic+0x2aa
#13 0x80631df0 at kern_sendit+0xfc
#14 0x8063203f at sendit+0xcd
#15 0x80632122 at sendto+0x48
#16 0x80608641 at syscallenter+0x28d
#17 0x8079bfef at syscall+0x2e
Uptime: 7h53m5s
Physical memory: 2038 MB
Dumping 253 MB: 238 222 206 190 174 158 142 126 110 94 78 62 46 30 14

#0  doadump () at pcpu.h:231
231 __asm("movl %%fs:0,%0" : "=r" (td));
(kgdb) f 6
#6  0x807842dc in calltrap () at /usr/src/sys/i386/i386/exception.s:166
166 calltrap
Current language:  auto; currently asm
(kgdb) l
161 SET_KERNEL_SREGS
162 cld
163 FAKE_MCOUNT(TF_EIP(%esp))
164 calltrap:
165 pushl   %esp
166 calltrap
167 add $4, %esp
168
169 /*
170  * Return via doreti to handle ASTs.
(kgdb) up
#7  0x805dfb56 in _callout_stop_safe (c=0x8c29f008, safe=0) at 
/usr/src/sys/kern/kern_timeout.c:683
683 if (c->c_lock == &Giant.lock_object)
Current language:  auto; currently c
(kgdb) l
678 /*
679  * Some old subsystems don't hold Giant while running a 
callout_stop(),
680  * so just discard this check for the moment.
681  */
682 if (!safe && c->c_lock != NULL) {
683 if (c->c_lock == &Giant.lock_object)
684 use_lock = mtx_owned(&Giant);
685 else {
686 use_lock = 1;
687 class = LOCK_CLASS(c->c_lock);
(kgdb) p *c
$1 = {c_links = {sle = {sle_next = 0x9}, tqe = {tqe_next = 0x9, tqe_prev = 
0x40}}, c_time = 10, c_arg = 0x40, c_func = 0xc, c_lock = 0x40, c_flags = 13, 
c_cpu = 64}
(kgdb) up
#8  0x8068c2ae in ng_uncallout (c=0x8c29f008, node=0x874abb00) at 
/usr/src/sys/netgraph/ng_base.c:3732
3732rval = callout_stop(c);
(kgdb) l
3727int rval;
3728
3729KASSERT(c != NULL, ("ng_uncallout: NULL callout"));
3730KASSERT(node != NULL, ("ng_uncallout: NULL node"));
3731
3732rval = callout_stop(c);
3733item = c->c_arg;
3734/* Do an extra check */
3735if ((rval > 0) && (c->c_func == &ng_callout_trampoline) &&
3736(NGI_NODE(item) == node)) {
(kgdb) up  
#9  0x8069c454 in ng_pppoe_disconnect (hook=0x88bcb880) at 
/usr/src/sys/netgraph/ng_pppoe.c:1791
1791ng_uncallout(&sp->neg->handle, node);
(kgdb) l
1786/*
1787 * As long as we have somewhere to store the timeout 
handle,
1788 * we may have a timeout pending.. get rid of it.
1789 */
1790if (sp->neg) {
1791ng_uncallout(&sp->neg->handle, node);
1792if (sp->neg->m)
1793m_freem(sp->neg->m);
1794free(sp->neg, M_NETGRAPH_PPPOE);
1795}
(kgdb) p sp
$2 = 0x89391180
(kgdb) p *sp
$3 = {hook = 0x88bcb880, Session_ID = 0, state = PPPOE_SOFFER, creator = 47, 
pkt_hdr = {eh = {ether_dhost = "\000\000\000\000\000", ether_shost = 
"\000\000\000\000\000", 
  ether_type = 0}, ph = {ver = 0 '\0', type = 0 '\0', code = 0 '\0', sid = 
0, length = 0}}, neg = 0x8c29f000, sessions = {le_next = 0x0, le_prev = 0x0}}
(kgdb) p *sp

Re: smartmontools 5.40 & ahci.ko -- doesn't work

2010-12-03 Thread Florian Smeets
On 03.12.10 14:04, Lev Serebryakov wrote:
> Hello, Stable.
> 

Hi,

>   Latest  smartmontools  5.40  doesn't  work  with AHCI driver :( I've
>   found  old  thread  about  5.38, but I have 5.40 and it doesn't work
>   with any `-d' type...
> 
>   What do I do wrong?
> 
> 

I had the same problem the cause was that i did not have "device pass"
in my kernel, i had this in my messages:

messages.5.bz2:Oct 12 12:46:45 xxx kernel: xptioctl: pass driver is not
in the kernel
messages.5.bz2:Oct 12 12:46:45 xxx kernel: xptioctl: put "device pass"
in your kernel config file

-- 
Florian Smeets
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: smartmontools 5.40 & ahci.ko -- doesn't work

2010-12-03 Thread Andriy Gapon
on 03/12/2010 15:04 Lev Serebryakov said the following:
> Hello, Stable.
> 
>   Latest  smartmontools  5.40  doesn't  work  with AHCI driver :( I've
>   found  old  thread  about  5.38, but I have 5.40 and it doesn't work
>   with any `-d' type...
> 
>   What do I do wrong?
> 

I don't know. Try ktrace, etc.

$ smartctl -A /dev/ada0
smartctl 5.40 2010-10-16 r3189 [FreeBSD 8.2-PRERELEASE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME  FLAG VALUE WORST THRESH TYPE  UPDATED
WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate 0x000b   100   100   016Pre-fail  Always   -
 0
  2 Throughput_Performance  0x0005   132   132   054Pre-fail  Offline  -
 142
  3 Spin_Up_Time0x0007   141   141   024Pre-fail  Always   -
 273 (Average 271)
  4 Start_Stop_Count0x0012   100   100   000Old_age   Always   -
 103
  5 Reallocated_Sector_Ct   0x0033   100   100   005Pre-fail  Always   -
 0
  7 Seek_Error_Rate 0x000b   100   100   067Pre-fail  Always   -
 0
  8 Seek_Time_Performance   0x0005   131   131   020Pre-fail  Offline  -
 29
  9 Power_On_Hours  0x0012   098   098   000Old_age   Always   -
 18243
 10 Spin_Retry_Count0x0013   100   100   060Pre-fail  Always   -
 0
 12 Power_Cycle_Count   0x0032   100   100   000Old_age   Always   -
 65
192 Power-Off_Retract_Count 0x0032   100   100   000Old_age   Always   -
 244
193 Load_Cycle_Count0x0012   100   100   000Old_age   Always   -
 244
194 Temperature_Celsius 0x0002   162   162   000Old_age   Always   -
 37 (Min/Max 20/54)
196 Reallocated_Event_Count 0x0032   100   100   000Old_age   Always   -
 0
197 Current_Pending_Sector  0x0022   100   100   000Old_age   Always   -
 0
198 Offline_Uncorrectable   0x0008   100   100   000Old_age   Offline  -
 0
199 UDMA_CRC_Error_Count0x000a   200   200   000Old_age   Always   -
 0

-- 
Andriy Gapon
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Re: Fail to use Dtrace on FreeBSD 8.1-STABLE

2010-12-03 Thread Andriy Gapon
on 02/12/2010 00:30 Zhihao Yuan said the following:
> OK. Let's make this more clear: anyone has a working 8-2-PRERELEASE kernel 
> (amd64
> is preferred) with Dtrace supports, which can run the scripts/commands on the
> wiki? If so, please post your kernel configurations here, thanks.

Not sure about commands on the wiki, but DTrace works perfectly with my scripts.

$ uname -srm
FreeBSD 8.2-PRERELEASE amd64
It's actually built from r216118 sources.

$ dtrace -n 'fbt::sc_switch_scr:entry { printf("%p\n", args[0]); }'
works without any issues.

My kernel has the same DTrace related options as the wiki page:
options KDTRACE_HOOKS   # all architectures - enable general
DTrace hooks
options DDB_CTF # all architectures - kernel ELF linker
loads CTF data
options KDTRACE_FRAME   # amd64-only

Here's how I built and installed the kernel:
$ make buildkernel WITH_CTF=1
$ make installkernel

KERNCONF is set my kernel's name in /etc/make.conf.

Not sure what kind of an issue prevents you from using DTrace, double-check all
your steps.
-- 
Andriy Gapon
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Re: Fail to use Dtrace on FreeBSD 8.1-STABLE

2010-12-03 Thread Andriy Gapon
on 02/12/2010 04:24 Jeremy Chadwick said the following:
> On Wed, Dec 01, 2010 at 08:21:21PM -0600, Zhihao Yuan wrote:
>> ctfdump -S /boot/kernel/kernel works, my system has CTF configured. But I
>> don't have either
>> options KDB
>> or
>> options DDB
>> I guess these has nothing to do with Dtrace, at least KDB is just a totally
>> different module. Am I right?
> 
> Correct; KDB/DDB shouldn't have anything to do with this.

Yes.  But it might - by accident/bug.

-- 
Andriy Gapon
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: 8.2-PRERELEASE panic in NETGRAPH (ng_pppoe)

2010-12-03 Thread Artem Kim
I wrote ng_pppoe in the "subject" when in fact it's probably not true.

It seems that the  NETGRAPH's problem or something wrong on my system.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Re: Fail to use Dtrace on FreeBSD 8.1-STABLE

2010-12-03 Thread Zhihao Yuan
I added these options, KDB & DDB to my KERNCONF, but Dtrace still does not
work, and the commands your shown fail on my system, too.
Can you send a copy of your KERNCONF to us?

On Fri, Dec 3, 2010 at 8:25 AM, Andriy Gapon  wrote:

> on 02/12/2010 04:24 Jeremy Chadwick said the following:
> > On Wed, Dec 01, 2010 at 08:21:21PM -0600, Zhihao Yuan wrote:
> >> ctfdump -S /boot/kernel/kernel works, my system has CTF configured. But
> I
> >> don't have either
> >> options KDB
> >> or
> >> options DDB
> >> I guess these has nothing to do with Dtrace, at least KDB is just a
> totally
> >> different module. Am I right?
> >
> > Correct; KDB/DDB shouldn't have anything to do with this.
>
> Yes.  But it might - by accident/bug.
>
> --
> Andriy Gapon
>



-- 
Zhihao Yuan
The best way to predict the future is to invent it.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: /usr/src fails to compile on 7.x after csup to RELENG_8

2010-12-03 Thread J.R. Oldroyd
[Slightly modified subject from the original posting back in June.]

William D. Colburn (Schlake)  wrote:
> 
> I can make the kernel just fine, but if I try to make the world I get this:
> 
> cc -O2 -pipe  -I/usr/src/cddl/usr.bin/zinject/../../../sys/cddl/compat 
> opensolaris
> -I/usr/src/cddl/usr.bin/zinject/../../compat/opensolaris/include
> -I/usr/src/cddl/usr.bin/zinject/../../compat/opensolaris/lib/libumem
> -I/usr/src/cddl/usr.bin/zinject/../../contrib/opensolaris/lib/libzfs/common
> -I/usr/src/cddl/usr.bin/zinject/../../contrib/opensolaris/lib/libzpool/common
> -I/usr/src/cddl/usr.bin/zinject/../../contrib/opensolaris/lib/libnvpair
> -I/usr/src/cddl/usr.bin/zinject/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
> -I/usr/src/cddl/usr.bin/zinject/../../../sys/cddl/contrib/opensolaris/uts/common/sys
> -I/usr/src/cddl/usr.bin/zinject/../../../sys/cddl/contrib/opensolaris/uts/common
> -I/usr/src/cddl/usr.bin/zinject/../../contrib/opensolaris/head
> -I/usr/src/cddl/usr.bin/zinject/../../lib/libumem
> -DNEED_SOLARIS_BOOLEAN -std=gnu89 -fstack-protector
> -Wno-unknown-pragmas  -o zinject zinject.o translate.o -lavl -lgeom
> -lm -lnvpair -lumem -luutil -lzfs -lzpool
> /lib/libthr.so.3: undefined reference to `__pselect at FBSDprivate_1.0'
> *** Error code 1
> 
> I searched, but I couldn't find anything on this problem.
> 

I just ran into this problem, too.  It turns out that it was due to
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib being set which is causing
the loader to pick up the wrong library.

Clearing the problem and resuming the build ends up being simple:
# unset LD_LIBRARY_PATH
# make -DNO_CLEAN buildworld

(Csh users will need unsetenv).

-jr
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Re: Fail to use Dtrace on FreeBSD 8.1-STABLE

2010-12-03 Thread Andriy Gapon
on 03/12/2010 21:53 Zhihao Yuan said the following:
> I added these options, KDB & DDB to my KERNCONF, but Dtrace still does not 
> work,
> and the commands your shown fail on my system, too.
> Can you send a copy of your KERNCONF to us?

I can, but I don't think that I have any magic in it.
I suppose that you have some problem with either your local environment or
following the procedures.  Most of all, I still suspect that your world and your
kernel are out of sync.

-- 
Andriy Gapon
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Re: Fail to use Dtrace on FreeBSD 8.1-STABLE

2010-12-03 Thread Zhihao Yuan
My world and kernel are sync. Is it possible that the dtrace-enabled kernel
must be compiled with '-g'?

On Fri, Dec 3, 2010 at 5:29 PM, Andriy Gapon  wrote:

> on 03/12/2010 21:53 Zhihao Yuan said the following:
> > I added these options, KDB & DDB to my KERNCONF, but Dtrace still does
> not work,
> > and the commands your shown fail on my system, too.
> > Can you send a copy of your KERNCONF to us?
>
> I can, but I don't think that I have any magic in it.
> I suppose that you have some problem with either your local environment or
> following the procedures.  Most of all, I still suspect that your world and
> your
> kernel are out of sync.
>
> --
> Andriy Gapon
>



-- 
Zhihao Yuan
The best way to predict the future is to invent it.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"