Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Tue, Feb 09, 2010 at 05:52:35AM +, Marcel Moolenaar wrote: Author: marcel Date: Tue Feb 9 05:52:35 2010 New Revision: 203696 URL: http://svn.freebsd.org/changeset/base/203696 Log: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month ... +static int +ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) +{ + vm_map_t map; + vm_map_entry_t entry; + vm_object_t obj, tobj, lobj; + struct vnode *vp; + char *freepath, *fullpath; + u_int pathlen; + int error, vfslocked; + + map = p-p_vmspace-vm_map; I think this place lacks two safety measures: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. Vmspace may be shared between stopped debugee and other process using rfork(2), thus modified despite the fact that traced process is stopped. + entry = map-header.next; + if (pve-pve_cookie != NULL) { + while (entry != map-header entry != pve-pve_cookie) + entry = entry-next; Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_ENTRY) invocations ? I think the debugger should be informed about this situation, otherwise interface is too unreliable. pgp6qLTjqdlGM.pgp Description: PGP signature
svn commit: r203699 - in head/usr.bin/ee: . nls/pt_BR.ISO8859-1
Author: gabor Date: Tue Feb 9 10:47:44 2010 New Revision: 203699 URL: http://svn.freebsd.org/changeset/base/203699 Log: - pt_BR.ISO8859-1 catalog - Add link to pt_PT.ISO8859-1 Submitted by: sylvio Approved by: delphij (mentor) Added: head/usr.bin/ee/nls/pt_BR.ISO8859-1/ head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg (contents, props changed) Modified: head/usr.bin/ee/Makefile Modified: head/usr.bin/ee/Makefile == --- head/usr.bin/ee/MakefileTue Feb 9 07:35:12 2010(r203698) +++ head/usr.bin/ee/MakefileTue Feb 9 10:47:44 2010(r203699) @@ -14,7 +14,7 @@ LDADD=-lncurses WARNS?=2 NLS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \ - uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 + uk_UA.KOI8-U pt_BR.ISO8859-1 ru_RU.KOI8-R hu_HU.ISO8859-2 NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \ @@ -22,6 +22,7 @@ NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859- fr_FR.ISO8859-15 NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \ de_CH.ISO8859-15 de_DE.ISO8859-15 +NLSLINKS_pt_BR.ISO8859-1= pt_PT.ISO8859-1 NLSSRCFILES=ee.msg .for lang in ${NLS} Added: head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg Tue Feb 9 10:47:44 2010 (r203699) @@ -0,0 +1,186 @@ +$ This file contains the messages for ee (easy editor). See the file +$ ee.i18n.guide for more information +$ +$ For ee patchlevel 3 +$ +$ $Header: /home/hugh/sources/old_ae/RCS/ee.msg,v 1.8 1996/11/30 03:23:40 hugh Exp $ +$ $FreeBSD$ +$ +$ +$set 1 +$quote +1 modo menu +2 tabs para espa�os +3 busca com case sensitive +4 observar margens +5 formata��o de auto-par�grafo +6 caracteres de oito bits +7 informa��o da janela +8 margem direita +9 deixar o menu +10 salvar mudan�as +11 sem salvar +12 menu arquivo +13 ler um arquivo +14 escrever uma arquivo +15 salvar arquivo +16 editar conte�do de impress�o +17 menu localizar +18 localizar por ... +19 localizar +20 menu dicion�rio +21 usar 'spell' +22 usar 'ispell' +23 menu diversos +24 formata��o de par�grafo +25 comando shell +26 checar dicion�rio +27 menu principal +28 deixar editor +29 ajuda +30 opera��es com arquivos +31 redesenhar tela +32 configura��es +33 localizar +34 diversos +35 Teclas de controle: +36 ^a c�digo ascii ^i tab ^r direita +37 ^b bot�o de texto ^j nova linha ^t in�cio do texto +38 ^c comando ^k deletar caracter ^u para acima +39 ^d para baixo ^l esquerda ^v restaurar palavra +40 ^e localizar prompt ^m nova linha ^w deletar palavra +41 ^f restaurar caracter ^n pr�xima p�gina ^x localizar +42 ^g in�cio da linha ^o fim da linha ^y deletar linha +43 ^h backspace^p p�gina anterior ^z restaurar linha +44 ^[ (escape) menu +45 +46 Comandos: +47 help: obter esta informa��o file: imprimir nome do arquivo +48 read: ler um arquivochar: c�digo ascii de caracter +49 write : escrever a arquivocase: localizar com case sensitive +50 exit: salva e sair nocase : localizar sem case insensitive +51 quit: sair, sem salvar !cmd: executar \cmd\ no shell +52 line: visualizar linhas # 0-9 : ir para linha \#\ +53 expand : expandir tabs noexpand: n�o expande tabs +54 +55 ee [+#] [-i] [-e] [-h] [arquivos(s)] +56 +# :ir para linha# -i :sem informa��o da janela -e : n�o expandir tabs -h :sem destaque +57 ^[ (escape) menu ^e prompt localizar ^y deletar linha ^u para cima ^p p�gina anterior +58 ^a c�digo ascii ^x localizar ^z restaurar linha^d para baixo^n pr�xima p�gina +59 ^b bot�o de texto^g in�cio da linha ^w deletar palavra^l esquerda +60 ^t in�cio do texto ^o fim da linha ^v restaurar palavra ^r direita +61 ^c comando ^k deletar caracter ^f restaurar caracter
svn commit: r203700 - stable/8/sbin/dumpfs
Author: ru Date: Tue Feb 9 12:20:48 2010 New Revision: 203700 URL: http://svn.freebsd.org/changeset/base/203700 Log: MFC: r198231: Properly re-create -s size argument to newfs(8). Modified: stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c == --- stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 10:47:44 2010 (r203699) +++ stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 12:20:48 2010 (r203700) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf(-s %jd , (intmax_t)fs-fs_size); + printf(-s %jd , (intmax_t)fsbtodb(fs, fs-fs_size)); printf(%s , disk.d_name); printf(\n); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203701 - stable/8/lib/libc/stdlib
Author: emaste Date: Tue Feb 9 13:07:32 2010 New Revision: 203701 URL: http://svn.freebsd.org/changeset/base/203701 Log: MFC r203077: Add missing return, in a rare case where we can't allocate memory in deallocate. Submitted by: Ryan Stone (rysto32 at gmail dot com) Approved by: jasone Modified: stable/8/lib/libc/stdlib/malloc.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdlib/malloc.c == --- stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 12:20:48 2010 (r203700) +++ stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 13:07:32 2010 (r203701) @@ -3861,6 +3861,7 @@ arena_dalloc(arena_t *arena, arena_chunk arena_dalloc_small(arena, chunk, ptr, mapelm); malloc_spin_unlock(arena-lock); + return; } mag_rack = rack; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203703 - head/games/fortune/datfiles
Author: gnn Date: Tue Feb 9 14:51:39 2010 New Revision: 203703 URL: http://svn.freebsd.org/changeset/base/203703 Log: Add the definition of Mistakeholder Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes == --- head/games/fortune/datfiles/fortunesTue Feb 9 14:31:02 2010 (r203702) +++ head/games/fortune/datfiles/fortunesTue Feb 9 14:51:39 2010 (r203703) @@ -5,6 +5,12 @@ Miss, n.: % Mistakes are often the stepping stones to utter failure. % +Mistakeholder, n.: + A person who depends on accidental features or + implementation errors and so now has a vested + interest in keeping things from being fixed. + -- Chip Morningstar +% Mistrust first impulses; they are always right. % MIT: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203704 - stable/7/sys/kern
Author: attilio Date: Tue Feb 9 14:56:10 2010 New Revision: 203704 URL: http://svn.freebsd.org/changeset/base/203704 Log: MFC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Tested by:Giovanni Trematerra giovanni dot trematerra at gmail dot com Approved by: re (kib) Modified: stable/7/sys/kern/kern_mutex.c stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_mutex.c == --- stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:56:10 2010 (r203704) @@ -557,7 +557,6 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - spinlock_enter(); THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td-td_lock; td-td_lock = blocked_lock; @@ -572,7 +571,6 @@ thread_lock_unblock(struct thread *td, s mtx_assert(new, MA_OWNED); MPASS(td-td_lock == blocked_lock); atomic_store_rel_ptr((volatile void *)td-td_lock, (uintptr_t)new); - spinlock_exit(); } void Modified: stable/7/sys/kern/sched_4bsd.c == --- stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:56:10 2010 (r203704) @@ -824,9 +824,11 @@ sched_sleep(struct thread *td) void sched_switch(struct thread *td, struct thread *newtd, int flags) { + struct mtx *tmtx; struct td_sched *ts; struct proc *p; + tmtx = NULL; ts = td-td_sched; p = td-td_proc; @@ -835,17 +837,20 @@ sched_switch(struct thread *td, struct t /* * Switch to the sched lock to fix things up and pick * a new thread. +* Block the td_lock in order to avoid breaking the critical path. */ if (td-td_lock != sched_lock) { mtx_lock_spin(sched_lock); - thread_unlock(td); + tmtx = thread_lock_block(td); } if ((p-p_flag P_NOLOAD) == 0) sched_load_rem(); - if (newtd) + if (newtd) { + MPASS(newtd-td_lock == sched_lock); newtd-td_flags |= (td-td_flags TDF_NEEDRESCHED); + } td-td_lastcpu = td-td_oncpu; td-td_flags = ~TDF_NEEDRESCHED; @@ -888,8 +893,8 @@ sched_switch(struct thread *td, struct t sched_load_add(); } else { newtd = choosethread(); + MPASS(newtd-td_lock == sched_lock); } - MPASS(newtd-td_lock == sched_lock); if (td != newtd) { #ifdef HWPMC_HOOKS @@ -907,7 +912,7 @@ sched_switch(struct thread *td, struct t (*dtrace_vtime_switch_func)(newtd); #endif /* I feel sleepy */ - cpu_switch(td, newtd, td-td_lock); + cpu_switch(td, newtd, tmtx != NULL ? tmtx : td-td_lock); /* * Where am I? What year is it? * We are in the same thread that went to sleep above, Modified: stable/7/sys/kern/sched_ule.c == --- stable/7/sys/kern/sched_ule.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_ule.c Tue Feb 9 14:56:10 2010 (r203704) @@ -318,7 +318,6 @@ static void sched_balance_groups(void); static void sched_balance_group(struct tdq_group *); static void sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct td_sched *, int, int); -static inline struct mtx *thread_block_switch(struct thread *); static inline void thread_unblock_switch(struct thread *, struct mtx *); static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); #endif @@ -989,9 +988,11 @@ sched_setcpu(struct td_sched *ts, int cp * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ + spinlock_enter(); thread_lock_block(td); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); + spinlock_exit(); return (tdq); } @@ -1789,23 +1790,6 @@ sched_switchin(struct tdq
Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Tue, Feb 9, 2010 at 3:52 AM, Marcel Moolenaar mar...@freebsd.org wrote: Author: marcel Date: Tue Feb 9 05:52:35 2010 New Revision: 203696 URL: http://svn.freebsd.org/changeset/base/203696 Log: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month After this commit i couldn't build amd64 kernel anymore. I got this: -- stage 3.2: building everything -- cd /usr/obj/usr/src/sys/GARGA; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp VERSION=FreeBSD 9.0-CURRENT amd64 99 INSTALL=sh /usr/src/tools/install.sh PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin NO_CTF=1 /usr/obj/usr/src/make.amd64/make KERNEL=kernel all -DNO_MODULES_OBJ cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/kern/sys_process.c /usr/src/sys/kern/sys_process.c: In function 'ptrace': /usr/src/sys/kern/sys_process.c:520: error: 'union anonymous' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:520: error: 'union anonymous' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:535: error: 'union anonymous' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:535: error: 'union anonymous' has no member named 'pve32' -- Renato Botelho ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203706 - stable/7/sbin/dumpfs
Author: ru Date: Tue Feb 9 16:18:44 2010 New Revision: 203706 URL: http://svn.freebsd.org/changeset/base/203706 Log: MFC: r198231: Properly re-create -s size argument to newfs(8). Approved by: re (kib) Modified: stable/7/sbin/dumpfs/dumpfs.c Directory Properties: stable/7/sbin/dumpfs/ (props changed) Modified: stable/7/sbin/dumpfs/dumpfs.c == --- stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 15:23:15 2010 (r203705) +++ stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 16:18:44 2010 (r203706) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf(-s %jd , (intmax_t)fs-fs_size); + printf(-s %jd , (intmax_t)fsbtodb(fs, fs-fs_size)); printf(%s , disk.d_name); printf(\n); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203547 - head/sbin/sysctl
On Sat, Feb 06, 2010 at 01:39:08PM +, Gavin Atkinson wrote: Author: gavin Date: Sat Feb 6 13:39:08 2010 New Revision: 203547 URL: http://svn.freebsd.org/changeset/base/203547 Log: Add the -i option to the synopsis. Submitted by: dhw MFC after: 1 week (with r203310) Modified: head/sbin/sysctl/sysctl.8 Please also add it to the program's usage(). Cheers, -- Ruslan Ermilov r...@freebsd.org FreeBSD committer ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203707 - head/usr.sbin/wake
Author: imp Date: Tue Feb 9 17:16:13 2010 New Revision: 203707 URL: http://svn.freebsd.org/changeset/base/203707 Log: Anything that casts struct sockaddr * to struct sockaddr_foo is safe due to careful design. We've not yet figured out how to properly annotate the sockaddr structs to communicate this to the compiler and there's a number of constructs in the tree that make this annotation challenging. As such, reduce warns to 3 here because this code really isn't warns 6 safe, even if it kinda sorta appears to be on intel (which has no such alignment restrictions). Warns 4 adds the -Wcast-align warning. # fixes the mips tinderbox build Modified: head/usr.sbin/wake/Makefile Modified: head/usr.sbin/wake/Makefile == --- head/usr.sbin/wake/Makefile Tue Feb 9 16:18:44 2010(r203706) +++ head/usr.sbin/wake/Makefile Tue Feb 9 17:16:13 2010(r203707) @@ -3,4 +3,6 @@ PROG= wake MAN= wake.8 +WARNS?= 3 + .include bsd.prog.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203708 - head/sys/kern
Author: marcel Date: Tue Feb 9 17:20:00 2010 New Revision: 203708 URL: http://svn.freebsd.org/changeset/base/203708 Log: Unbreak building kernels with COMPAT_32 enabled. The actual support for the PT_VM_ENTRY request from 32-bit processes will follow. Pointy hat: marcel Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c == --- head/sys/kern/sys_process.c Tue Feb 9 17:16:13 2010(r203707) +++ head/sys/kern/sys_process.c Tue Feb 9 17:20:00 2010(r203708) @@ -73,6 +73,17 @@ struct ptrace_io_desc32 { u_int32_t piod_addr; u_int32_t piod_len; }; + +struct ptrace_vm_entry32 { + uint32_tpve_cookie; + uint32_tpve_start; + uint32_tpve_end; + uint32_tpve_offset; + u_int pve_prot; + u_int pve_pathlen; + uint32_tpve_path; +}; + #endif /* @@ -484,6 +495,7 @@ ptrace(struct thread *td, struct ptrace_ struct fpreg32 fpreg32; struct reg32 reg32; struct ptrace_io_desc32 piod32; + struct ptrace_vm_entry32 pve32; #endif } r; void *addr; @@ -1075,6 +1087,13 @@ kern_ptrace(struct thread *td, int req, break; case PT_VM_ENTRY: +#ifdef COMPAT_IA32 + /* XXX to be implemented. */ + if (wrap32) { + error = EDOOFUS; + break; + } +#endif PROC_UNLOCK(p); error = ptrace_vm_entry(td, p, addr); PROC_LOCK(p); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Feb 9, 2010, at 1:57 AM, Kostik Belousov wrote: +map = p-p_vmspace-vm_map; I think this place lacks two safety measures: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. Vmspace may be shared between stopped debugee and other process using rfork(2), thus modified despite the fact that traced process is stopped. Will do. I considered it, but thought it wouldn't be necessary because the process has stopped. I didn't consider the rfork(2) case with RFMEM. Good catch! +entry = map-header.next; +if (pve-pve_cookie != NULL) { +while (entry != map-header entry != pve-pve_cookie) +entry = entry-next; Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_ENTRY) invocations ? I think the debugger should be informed about this situation, otherwise interface is too unreliable. I didn't think so, but I also didn't consider rfork :-) We can always put the timestamp in the structure. Either (1) the tracing process fills it on request or (2) the request returns it on completion. (1) the kernel checks the timestamp with the one in the map and returns an appropriate error. If the request has a timestamp of 0, no checking is performed. (2) the tracing process can check the timestamp returned by each request and compare that with the return value of the PT_VM_TIMESTAMP and restart the iteration. Either way, if the entry is reused, the timestamp will have changed and either the kernel or the tracing process can take appropriate action. Thoughts? BTW: I prefer 2. -- Marcel Moolenaar xcl...@mac.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203704 - stable/7/sys/kern
On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: Author: attilio Date: Tue Feb 9 14:56:10 2010 New Revision: 203704 URL: http://svn.freebsd.org/changeset/base/203704 Log: MFC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Does this require an MFC of a change to cpu_switch() for sparc64? -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203704 - stable/7/sys/kern
2010/2/9 John Baldwin j...@freebsd.org: On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: Author: attilio Date: Tue Feb 9 14:56:10 2010 New Revision: 203704 URL: http://svn.freebsd.org/changeset/base/203704 Log: MFC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Does this require an MFC of a change to cpu_switch() for sparc64? It is already done by marius. (I waited for his work before to let this go in). Attilio -- Peace can only be achieved by understanding - A. Einstein ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203710 - head/usr.sbin/rpcbind
Author: imp Date: Tue Feb 9 18:10:56 2010 New Revision: 203710 URL: http://svn.freebsd.org/changeset/base/203710 Log: When you have multiple addresses on the same network on different interfaces (such as when you are part of a carp pool), and you run rpcbind -h to restrict which interfaces have rpc services, rpcbind can none-the-less return addresses that aren't in the -h list. This patch enforces the rule that when you specify -h on the command line, then services returned from rpcbind must be to one of the addresses listed in -h, or be a loopback address (since localhost is implicit when running -h). The root cause of this is the assumption in addrmerge that there can be only one interface that matches a given network IP address. This turns out not to be the case. To retain historical behavior, I didn't try to fix the routine to prefer the address that the request came into, since I didn't know the side effects that might cause in the normal case. My quick analysis suggests that it wouldn't be a problem, but since this code is tricky I opted for the more conservative patch of only restricting the reply when -h is in effect. Hence, this change will have no effect when you are running rpcbind without -h. Reviewed by: alfred@ Sponsored by: iX Systems MFC after:2 weeks Modified: head/usr.sbin/rpcbind/rpcbind.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/rpcbind.c == --- head/usr.sbin/rpcbind/rpcbind.c Tue Feb 9 17:29:04 2010 (r203709) +++ head/usr.sbin/rpcbind/rpcbind.c Tue Feb 9 18:10:56 2010 (r203710) @@ -92,6 +92,7 @@ int oldstyle_local = 0; int verboselog = 0; char **hosts = NULL; +struct sockaddr **bound_sa; int ipv6_only = 0; int nhosts = 0; int on = 1; @@ -119,6 +120,7 @@ static void rbllist_add(rpcprog_t, rpcve struct netbuf *); static void terminate(int); static void parseargs(int, char *[]); +static void update_bound_sa(void); int main(int argc, char *argv[]) @@ -130,6 +132,8 @@ main(int argc, char *argv[]) parseargs(argc, argv); + update_bound_sa(); + /* Check that another rpcbind isn't already running. */ if ((rpcbindlockfd = (open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444))) == -1) @@ -323,8 +327,7 @@ init_transport(struct netconfig *nconf) * If no hosts were specified, just bind to INADDR_ANY. * Otherwise make sure 127.0.0.1 is added to the list. */ - nhostsbak = nhosts; - nhostsbak++; + nhostsbak = nhosts + 1; hosts = realloc(hosts, nhostsbak * sizeof(char *)); if (nhostsbak == 1) hosts[0] = *; @@ -657,6 +660,75 @@ error: return (1); } +/* + * Create the list of addresses that we're bound to. Normally, this + * list is empty because we're listening on the wildcard address + * (nhost == 0). If -h is specified on the command line, then + * bound_sa will have a list of the addresses that the program binds + * to specifically. This function takes that list and converts them to + * struct sockaddr * and stores them in bound_sa. + */ +static void +update_bound_sa(void) +{ + struct addrinfo hints, *res = NULL; + int i; + + if (nhosts == 0) + return; + bound_sa = malloc(sizeof(*bound_sa) * nhosts); + memset(hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + for (i = 0; i nhosts; i++) { + if (getaddrinfo(hosts[i], NULL, hints, res) != 0) + continue; + bound_sa[i] = malloc(res-ai_addrlen); + memcpy(bound_sa[i], res-ai_addr, res-ai_addrlen); + } +} + +/* + * Match the sa against the list of addresses we've bound to. If + * we've not specifically bound to anything, we match everything. + * Otherwise, if the IPv4 or IPv6 address matches one of the addresses + * in bound_sa, we return true. If not, we return false. + */ +int +listen_addr(const struct sockaddr *sa) +{ + int i; + + /* +* If nhosts == 0, then there were no -h options on the +* command line, so all addresses are addresses we're +* listening to. +*/ + if (nhosts == 0) + return 1; + for (i = 0; i nhosts; i++) { + if (bound_sa[i] == NULL || + sa-sa_family != bound_sa[i]-sa_family) + continue; + switch (sa-sa_family) { + case AF_INET: + if (memcmp(SA2SINADDR(sa), SA2SINADDR(bound_sa[i]), + sizeof(struct in_addr)) == 0) + return (1); + break; +#ifdef INET6 + case AF_INET6: + if (memcmp(SA2SIN6ADDR(sa),
svn commit: r203711 - in head: tools/build/mk usr.bin
Author: delphij Date: Tue Feb 9 18:22:26 2010 New Revision: 203711 URL: http://svn.freebsd.org/changeset/base/203711 Log: As it turns out, fmt(1) is being used by the base system as well as the ports tree extensively and it is probably a good idea to keep it regardless of NO_MAIL setting. Reported by: Alexander Best Reviewed by: antoine X-MFC-With: r203584 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 18:10:56 2010(r203710) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 18:22:26 2010(r203711) @@ -1539,7 +1539,6 @@ OLD_FILES+=usr/share/man/man8/pac.8.gz .if ${MK_MAIL} == no OLD_FILES+=usr/bin/Mail OLD_FILES+=usr/bin/biff -OLD_FILES+=usr/bin/fmt OLD_FILES+=usr/bin/from OLD_FILES+=usr/bin/mail OLD_FILES+=usr/bin/mailx Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Tue Feb 9 18:10:56 2010(r203710) +++ head/usr.bin/Makefile Tue Feb 9 18:22:26 2010(r203711) @@ -66,7 +66,7 @@ SUBDIR= alias \ ${_file2c} \ find \ finger \ - ${_fmt} \ + fmt \ fold \ ${_from} \ fstat \ @@ -296,7 +296,6 @@ _locate=locate # XXX msgs? .if ${MK_MAIL} != no _biff= biff -_fmt= fmt _from= from _mail= mail _msgs= msgs ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203713 - head/gnu/usr.bin/groff/tmac
Author: marcel Date: Tue Feb 9 18:40:40 2010 New Revision: 203713 URL: http://svn.freebsd.org/changeset/base/203713 Log: Add description for libefi. Pointed out by: ru Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local == --- head/gnu/usr.bin/groff/tmac/mdoc.local Tue Feb 9 18:34:42 2010 (r203712) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Tue Feb 9 18:40:40 2010 (r203713) @@ -43,6 +43,7 @@ .ds doc-str-Lb-libdevstat Device Statistics Library (libdevstat, \-ldevstat) .ds doc-str-Lb-libdisk Interface to Slice and Partition Labels Library (libdisk, \-ldisk) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) +.ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) .ds doc-str-Lb-libfetchFile Transfer Library (libfetch, \-lfetch) .ds doc-str-Lb-libgeom Userland API Library for kernel GEOM subsystem (libgeom, \-lgeom) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Tue, Feb 09, 2010 at 09:30:51AM -0800, Marcel Moolenaar wrote: On Feb 9, 2010, at 1:57 AM, Kostik Belousov wrote: + map = p-p_vmspace-vm_map; I think this place lacks two safety measures: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. Vmspace may be shared between stopped debugee and other process using rfork(2), thus modified despite the fact that traced process is stopped. Will do. I considered it, but thought it wouldn't be necessary because the process has stopped. I didn't consider the rfork(2) case with RFMEM. Good catch! + entry = map-header.next; + if (pve-pve_cookie != NULL) { + while (entry != map-header entry != pve-pve_cookie) + entry = entry-next; Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_ENTRY) invocations ? I think the debugger should be informed about this situation, otherwise interface is too unreliable. I didn't think so, but I also didn't consider rfork :-) We can always put the timestamp in the structure. Either (1) the tracing process fills it on request or (2) the request returns it on completion. (1) the kernel checks the timestamp with the one in the map and returns an appropriate error. If the request has a timestamp of 0, no checking is performed. (2) the tracing process can check the timestamp returned by each request and compare that with the return value of the PT_VM_TIMESTAMP and restart the iteration. Either way, if the entry is reused, the timestamp will have changed and either the kernel or the tracing process can take appropriate action. Thoughts? BTW: I prefer 2. I agree that #2 looks preferably, except that I consider it more convenient when libc syscall wrapper return value is 0/-1 instead of -1/some data. This means that timestamp might be added to the existing struct ptrace_vm_entry. pgprWBMarTceo.pgp Description: PGP signature
svn commit: r203714 - head/lib/libefi
Author: marcel Date: Tue Feb 9 18:43:20 2010 New Revision: 203714 URL: http://svn.freebsd.org/changeset/base/203714 Log: Various fixes like spelling, style and syntax. Submitted by: ru (thanks!) Modified: head/lib/libefi/libefi.3 Modified: head/lib/libefi/libefi.3 == --- head/lib/libefi/libefi.3Tue Feb 9 18:40:40 2010(r203713) +++ head/lib/libefi/libefi.3Tue Feb 9 18:43:20 2010(r203714) @@ -25,24 +25,28 @@ .\ .\ $FreeBSD$ .\ -.Dd Januari 29, 2010 +.Dd January 29, 2010 .Dt LIBEFI 3 .Os .Sh NAME .Nm efi_getvar , efi_nextvarname , efi_setvar -.Nd Interface for accessing the EFI variable services +.Nd interface for accessing the EFI variable services .Sh LIBRARY .Lb libefi .Sh SYNOPSIS .In libefi.h .Ft int -.Fn efi_getvar char *name uuid_t *vendor uint32_t *attrib \ -size_t *datasize void *data +.Fo efi_getvar +.Fa char *name uuid_t *vendor uint32_t *attrib +.Fa size_t *datasize void *data +.Fc .Ft int .Fn efi_nextvarname size_t *namesize char *name uuid_t *vendor .Ft int -.Fn efi_setvar char *name uuid_t *vendor uint32_t attrib \ -size_t datasize void *data +.Fo efi_setvar +.Fa char *name uuid_t *vendor uint32_t attrib +.Fa size_t datasize void *data +.Fc .Sh DESCRIPTION The .Nm libefi @@ -53,18 +57,19 @@ The .Fn efi_nextvarname function is used to enumerate the variables. The -.Nm namesize +.Fa namesize parameter needs to be set to the size of the buffer pointed to by -.Nm name . +.Fa name . On return, -.Nm namesize -is set to the length of the variable name (including the terminating '\\0') +.Fa namesize +is set to the length of the variable name (including the terminating +.Ql \e0 ) irrespective of whether the buffer was big enough. The buffer pointed to by -.Nm name +.Fa name contains the full or partial variable name on return. Only on successful completion of the request is the -.Nm vendor +.Fa vendor updated. The values returned should be passed to successive calls to .Fn efi_nextvarname @@ -76,11 +81,11 @@ can be passed to .Fn efi_getvar to obtain the value and attribute of the variable. The buffer that is to contain the value is specified by -.Nm data +.Fa data and the size of the buffer is given by -.Nm datasize . +.Fa datasize . The attribute pointed to by -.Nm attrib +.Fa attrib consists of the bit values defined by the EFI specification. .Pp Variables can be created, modified and deleted using the @@ -91,15 +96,17 @@ order for the request to succeed. Note that for runtime accessable variables the boottime accessable bit must be set as well. To delete a variable, set -.Nm datasize +.Fa datasize to 0. .Pp The vendor UUID is used to avoid collisions between variable names of different vendors. -Variables created for use by FreeBSD should use the -.Nm EFI_FREEBSD_VARIABLE +Variables created for use by +.Fx +should use the +.Dv EFI_FREEBSD_VARIABLE UUID as defined in the -.Nm libefi +.In libefi.h header file. .Sh RETURN VALUES Upon successful completion, these functions return 0. @@ -127,10 +134,10 @@ the buffer provided. The .Nm libefi library first appeared in -.Fx 9 +.Fx 9.0 for the ia64 architecture. .Sh AUTHORS The .Nm libefi -library and corresponding manual page were written by +library and this manual page were written by .An Marcel Moolenaar Aq mar...@freebsd.org . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203715 - stable/8/etc
Author: bms Date: Tue Feb 9 18:43:50 2010 New Revision: 203715 URL: http://svn.freebsd.org/changeset/base/203715 Log: MFC Revision: 203574 Add sane-port (Scanner Access Now Easy) as port 6566. Obtained from: http://www.iana.org/assignments/port-numbers Modified: stable/8/etc/services (contents, props changed) Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/services == --- stable/8/etc/services Tue Feb 9 18:43:20 2010(r203714) +++ stable/8/etc/services Tue Feb 9 18:43:50 2010(r203715) @@ -2338,6 +2338,8 @@ sge_execd 6445/tcp #Grid Engine Execut sge_execd 6445/udp #Grid Engine Execution Service xdsxdm 6558/tcp xdsxdm 6558/udp +sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port +sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) acmsoda6969/tcp acmsoda6969/udp ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203716 - head/sys/dev/bge
Author: yongari Date: Tue Feb 9 19:12:06 2010 New Revision: 203716 URL: http://svn.freebsd.org/changeset/base/203716 Log: Move device specific flag configuration to attach routine. The softc obtained in device probe wouldn't be the same one used in device attach. Drivers should not assume any values stored in softc structure in probe routine will be available for its attach routine. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Tue Feb 9 18:43:50 2010(r203715) +++ head/sys/dev/bge/if_bge.c Tue Feb 9 19:12:06 2010(r203716) @@ -1993,10 +1993,6 @@ bge_probe(device_t dev) snprintf(buf, 96, %s, %sASIC rev. %#08x, model, br != NULL ? : unknown , id); device_set_desc_copy(dev, buf); - if (pci_get_subvendor(dev) == DELL_VENDORID) - sc-bge_flags |= BGE_FLAG_NO_3LED; - if (did == BCOM_DEVICEID_BCM5755M) - sc-bge_flags |= BGE_FLAG_ADJUST_TRIM; return (0); } t++; @@ -2607,6 +2603,10 @@ bge_attach(device_t dev) sc-bge_flags |= BGE_FLAG_ADC_BUG; if (sc-bge_chipid == BGE_CHIPID_BCM5704_A0) sc-bge_flags |= BGE_FLAG_5704_A0_BUG; + if (pci_get_subvendor(dev) == DELL_VENDORID) + sc-bge_flags |= BGE_FLAG_NO_3LED; + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc-bge_flags |= BGE_FLAG_ADJUST_TRIM; if (BGE_IS_5705_PLUS(sc) !(sc-bge_flags BGE_FLAG_ADJUST_TRIM)) { if (sc-bge_asicrev == BGE_ASICREV_BCM5755 || ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203717 - head/sbin/sysctl
Author: gavin Date: Tue Feb 9 19:13:45 2010 New Revision: 203717 URL: http://svn.freebsd.org/changeset/base/203717 Log: Add -i to usage() Noticed by: ru MFC after:5 days Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c == --- head/sbin/sysctl/sysctl.c Tue Feb 9 19:12:06 2010(r203716) +++ head/sbin/sysctl/sysctl.c Tue Feb 9 19:13:45 2010(r203717) @@ -75,7 +75,7 @@ usage(void) { (void)fprintf(stderr, %s\n%s\n, - usage: sysctl [-bdehNnoqx] name[=value] ..., + usage: sysctl [-bdehiNnoqx] name[=value] ..., sysctl [-bdehNnoqx] -a); exit(1); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Feb 9, 2010, at 10:40 AM, Kostik Belousov wrote: *snip* Action items: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. *snip* We can always put the timestamp in the structure. *snip* (2) the tracing process can check the timestamp returned by each request and compare that with the return value of the PT_VM_TIMESTAMP and restart the iteration. *snip* I agree that #2 looks preferably, except that I consider it more convenient when libc syscall wrapper return value is 0/-1 instead of -1/some data. This means that timestamp might be added to the existing struct ptrace_vm_entry. Of course. When I said returned, I didn't mean returned as the return value from ptrace. I used return to convey origin and direction of the information flow (see also the first sentence of my response :-) I'll implement it and send a patch for review to avoid unnecessary repository churn... Thanks! -- Marcel Moolenaar xcl...@mac.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203718 - stable/8/sys/netinet
Author: qingli Date: Tue Feb 9 19:27:54 2010 New Revision: 203718 URL: http://svn.freebsd.org/changeset/base/203718 Log: MFC r203401 Some of the existing ppp and vpn related scripts create and set the IP addresses of the tunnel end points to the same value. In these cases the loopback route is not installed for the local end. Modified: stable/8/sys/netinet/in.c Directory Properties: stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/in.c == --- stable/8/sys/netinet/in.c Tue Feb 9 19:13:45 2010(r203717) +++ stable/8/sys/netinet/in.c Tue Feb 9 19:27:54 2010(r203718) @@ -921,6 +921,12 @@ in_ifinit(struct ifnet *ifp, struct in_i if (ia-ia_addr.sin_addr.s_addr == INADDR_ANY) return (0); + if (ifp-if_flags IFF_POINTOPOINT) { + if (ia-ia_dstaddr.sin_addr.s_addr == ia-ia_addr.sin_addr.s_addr) + return (0); + } + + /* * add a loopback route to self */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203719 - head/lib/libc/nls
Author: gabor Date: Tue Feb 9 19:37:12 2010 New Revision: 203719 URL: http://svn.freebsd.org/changeset/base/203719 Log: - Deal with some special cases [1] - style(9) nits Pointed out by: jilles [1] Approved by: delphij (mentor) Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c == --- head/lib/libc/nls/msgcat.c Tue Feb 9 19:27:54 2010(r203718) +++ head/lib/libc/nls/msgcat.c Tue Feb 9 19:37:12 2010(r203719) @@ -77,19 +77,22 @@ __FBSDID($FreeBSD$); #defineNLERR ((nl_catd) -1) #define NLRETERR(errc) { errno = errc; return (NLERR); } -#define SAVEFAIL(n, e) { WLOCK(NLERR); \ - np = malloc(sizeof(struct catentry)); \ - if (np != NULL) { \ - np-name = strdup(n); \ - np-caterrno = e; \ - SLIST_INSERT_HEAD(cache, np, list); \ - } \ - UNLOCK; \ - } +#define SAVEFAIL(n, l, e) { WLOCK(NLERR); \ + np = malloc(sizeof(struct catentry)); \ + if (np != NULL) { \ + np-name = strdup(n); \ + np-path = NULL; \ + np-lang = (l == NULL) ? NULL : strdup(l); \ + np-caterrno = e; \ + SLIST_INSERT_HEAD(cache, np, list); \ + } \ + UNLOCK; \ + errno = e; \ + } static nl_catd load_msgcat(const char *, const char *, const char *); -static pthread_rwlock_t rwlock; +static pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; struct catentry { SLIST_ENTRY(catentry)list; @@ -114,10 +117,12 @@ catopen(const char *name, int type) int saverr, spcleft; char path[PATH_MAX]; + /* sanity checking */ if (name == NULL || *name == '\0') NLRETERR(EINVAL); if (strchr(name, '/') != NULL) + /* have a pathname */ lang = NULL; else { if (type == NL_CAT_LOCALE) @@ -135,12 +140,14 @@ catopen(const char *name, int type) /* Try to get it from the cache first */ RLOCK(NLERR); SLIST_FOREACH(np, cache, list) { - if (strcmp(np-name, name) == 0) { + if ((strcmp(np-name, name) == 0) + ((lang != NULL np-lang != NULL + strcmp(np-lang, lang) == 0) || (np-lang == lang))) { if (np-caterrno != 0) { /* Found cached failing entry */ UNLOCK; NLRETERR(np-caterrno); - } else if (strcmp(np-lang, lang) == 0) { + } else { /* Found cached successful entry */ np-refcount++; UNLOCK; @@ -154,6 +161,7 @@ catopen(const char *name, int type) if (strchr(name, '/') != NULL) return (load_msgcat(name, name, lang)); + /* sanity checking */ if ((plang = cptr1 = strdup(lang)) == NULL) return (NLERR); if ((cptr = strchr(cptr1, '@')) != NULL) @@ -218,6 +226,7 @@ catopen(const char *name, int type) too_long: free(plang); free(base); + SAVEFAIL(name, lang, ENAMETOOLONG); NLRETERR(ENAMETOOLONG); } pathP += strlen(tmpptr); @@ -241,6 +250,7 @@ catopen(const char *name, int type) } free(plang); free(base); + SAVEFAIL(name, lang, ENOENT); NLRETERR(ENOENT); } @@ -317,6 +327,7 @@ catclose(nl_catd catd) { struct catentry *np; + /* sanity checking */ if (catd == NULL || catd == NLERR) { errno = EBADF; return (-1); @@ -325,13 +336,15 @@ catclose(nl_catd catd) /* Remove from cache if not referenced any more */ WLOCK(-1); SLIST_FOREACH(np, cache, list) { - if ((np-catd-__size == catd-__size) - memcmp((const void *)np-catd, (const void *)catd, np-catd-__size) == 0) { + if (catd == np-catd) { np-refcount--; if (np-refcount == 0) { munmap(catd-__data,
svn commit: r203721 - head/share/man/man9
Author: trasz Date: Tue Feb 9 20:58:39 2010 New Revision: 203721 URL: http://svn.freebsd.org/changeset/base/203721 Log: Add references to VOP_* man pages to vnode(9). Modified: head/share/man/man9/vnode.9 Modified: head/share/man/man9/vnode.9 == --- head/share/man/man9/vnode.9 Tue Feb 9 20:18:14 2010(r203720) +++ head/share/man/man9/vnode.9 Tue Feb 9 20:58:39 2010(r203721) @@ -26,7 +26,7 @@ .\ .\ $FreeBSD$ .\ -.Dd May 20, 2003 +.Dd February 9, 2010 .Os .Dt VNODE 9 .Sh NAME @@ -161,6 +161,38 @@ interlock, will cause a LOR (Lock Order intertwining of VM Objects and Vnodes. .Sh SEE ALSO .Xr malloc 9 , +.Xr VOP_ACCESS 9 , +.Xr VOP_ACLCHECK 9 , +.Xr VOP_ADVLOCK 9 , +.Xr VOP_ATTRIB 9 , +.Xr VOP_BWRITE 9 , +.Xr VOP_CREATE 9 , +.Xr VOP_FSYNC 9 , +.Xr VOP_GETACL 9 , +.Xr VOP_GETEXTATTR 9 , +.Xr VOP_GETPAGES 9 , +.Xr VOP_GETVOBJECT 9 , +.Xr VOP_INACTIVE 9 , +.Xr VOP_IOCTL 9 , +.Xr VOP_LINK 9 , +.Xr VOP_LISTEXTATTR 9 , +.Xr VOP_LOCK 9 , +.Xr VOP_LOOKUP 9 , +.Xr VOP_OPENCLOSE 9 , +.Xr VOP_PATHCONF 9 , +.Xr VOP_PRINT 9 , +.Xr VOP_RDWR 9 , +.Xr VOP_READDIR 9 , +.Xr VOP_READLINK 9 , +.Xr VOP_REALLOCBLKS 9 , +.Xr VOP_REMOVE 9 , +.Xr VOP_RENAME 9 , +.Xr VOP_REVOKE 9 , +.Xr VOP_SETACL 9 , +.Xr VOP_SETEXTATTR 9 , +.Xr VOP_STRATEGY 9 , +.Xr VOP_VPTOCNP 9 , +.Xr VOP_VPTOFH 9 , .Xr VFS 9 .Sh AUTHORS This manual page was written by ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203722 - head/share/man/man9
Author: trasz Date: Tue Feb 9 21:01:18 2010 New Revision: 203722 URL: http://svn.freebsd.org/changeset/base/203722 Log: Remove VOP_VPTOFH(9) from references in VFS(9), as it's a VOP, not VFS operation. Modified: head/share/man/man9/VFS.9 Modified: head/share/man/man9/VFS.9 == --- head/share/man/man9/VFS.9 Tue Feb 9 20:58:39 2010(r203721) +++ head/share/man/man9/VFS.9 Tue Feb 9 21:01:18 2010(r203722) @@ -28,7 +28,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 4, 2010 +.Dd February 9, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,6 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203723 - head/usr.bin/find
Author: ed Date: Tue Feb 9 21:24:41 2010 New Revision: 203723 URL: http://svn.freebsd.org/changeset/base/203723 Log: Don't let find(1) depend on struct timeb. This structure is deprecated and only used by ftime(2), which is part of libcompat. The second argument of get_date() is unused, which means we can just remove it entirely. Modified: head/usr.bin/find/extern.h head/usr.bin/find/function.c head/usr.bin/find/getdate.y Modified: head/usr.bin/find/extern.h == --- head/usr.bin/find/extern.h Tue Feb 9 21:01:18 2010(r203722) +++ head/usr.bin/find/extern.h Tue Feb 9 21:24:41 2010(r203723) @@ -43,8 +43,7 @@ PLAN *find_formplan(char **); PLAN *not_squish(PLAN *); PLAN *or_squish(PLAN *); PLAN *paren_squish(PLAN *); -struct timeb; -time_t get_date(char *, struct timeb *); +time_t get_date(char *); struct stat; voidprintlong(char *, char *, struct stat *); int queryuser(char **); Modified: head/usr.bin/find/function.c == --- head/usr.bin/find/function.cTue Feb 9 21:01:18 2010 (r203722) +++ head/usr.bin/find/function.cTue Feb 9 21:24:41 2010 (r203723) @@ -50,7 +50,6 @@ __FBSDID($FreeBSD$); #include sys/acl.h #include sys/wait.h #include sys/mount.h -#include sys/timeb.h #include dirent.h #include err.h @@ -1155,7 +1154,7 @@ c_newer(OPTION *option, char ***argvp) new = palloc(option); /* compare against what */ if (option-flags F_TIME2_T) { - new-t_data = get_date(fn_or_tspec, (struct timeb *) 0); + new-t_data = get_date(fn_or_tspec); if (new-t_data == (time_t) -1) errx(1, Can't parse date/time: %s, fn_or_tspec); } else { Modified: head/usr.bin/find/getdate.y == --- head/usr.bin/find/getdate.y Tue Feb 9 21:01:18 2010(r203722) +++ head/usr.bin/find/getdate.y Tue Feb 9 21:24:41 2010(r203723) @@ -28,7 +28,6 @@ __FBSDID($FreeBSD$); #else /* defined(vms) */ # include sys/types.h # include sys/time.h -# include sys/timeb.h #endif /* !defined(vms) */ #if defined (__STDC__) || defined (USG) @@ -69,7 +68,7 @@ static int yyparse(void); static int yylex(void); static int yyerror(const char *); -time_t get_date(char *, struct timeb *); +time_t get_date(char *); #define EPOCH 1970 #define HOUR(x)((time_t)(x) * 60) @@ -849,58 +848,50 @@ difftm (struct tm *a, struct tm *b) } time_t -get_date(char *p, struct timeb *now) +get_date(char *p) { -struct tm *tm, gmt; -struct timeb ftz; +struct tm *tm, *gmt_ptr, gmt; +inttzoff; time_t Start; time_t tod; time_t nowtime; bzero (gmt, sizeof(struct tm)); yyInput = p; -if (now == NULL) { - struct tm *gmt_ptr; -now = ftz; - (void)time (nowtime); +(void)time (nowtime); - gmt_ptr = gmtime (nowtime); - if (gmt_ptr != NULL) - { - /* Make a copy, in case localtime modifies *tm (I think - that comment now applies to *gmt_ptr, but I am too - lazy to dig into how gmtime and locatime allocate the - structures they return pointers to). */ - gmt = *gmt_ptr; - } - - if (! (tm = localtime (nowtime))) - return -1; +gmt_ptr = gmtime (nowtime); +if (gmt_ptr != NULL) +{ + /* Make a copy, in case localtime modifies *tm (I think + that comment now applies to *gmt_ptr, but I am too + lazy to dig into how gmtime and locatime allocate the + structures they return pointers to). */ + gmt = *gmt_ptr; +} - if (gmt_ptr != NULL) - ftz.timezone = difftm (gmt, tm) / 60; - else - /* We are on a system like VMS, where the system clock is - in local time and the system has no concept of timezones. - Hopefully we can fake this out (for the case in which the - user specifies no timezone) by just saying the timezone - is zero. */ - ftz.timezone = 0; +if (! (tm = localtime (nowtime))) + return -1; - if(tm-tm_isdst) - ftz.timezone += 60; -} +if (gmt_ptr != NULL) + tzoff = difftm (gmt, tm) / 60; else -{ - nowtime = now-time; -} + /* We are on a system like VMS, where the system clock is + in local time and the system has no concept of timezones. + Hopefully we can fake this out (for the case in which the + user specifies no timezone) by just saying the timezone + is zero. */ + tzoff = 0; + +if(tm-tm_isdst) + tzoff += 60; tm
svn commit: r203724 - head/sys/netinet
Author: bz Date: Tue Feb 9 21:31:53 2010 New Revision: 203724 URL: http://svn.freebsd.org/changeset/base/203724 Log: Properly free resources when destroying the TCP hostcache while tearing down a network stack (in the VIMAGE jail+vnet case). For that break out the logic from tcp_hc_purge() into an internal function we can call from both, the sysctl handler and the tcp_hc_destroy(). Sponsored by: ISPsystem Reviewed by: silby, lstewart MFC After:8 days Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c == --- head/sys/netinet/tcp_hostcache.cTue Feb 9 21:24:41 2010 (r203723) +++ head/sys/netinet/tcp_hostcache.cTue Feb 9 21:31:53 2010 (r203724) @@ -115,6 +115,7 @@ static VNET_DEFINE(struct callout, tcp_h static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS); +static void tcp_hc_purge_internal(int); static void tcp_hc_purge(void *); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0, @@ -235,10 +236,19 @@ tcp_hc_init(void) void tcp_hc_destroy(void) { - - /* XXX TODO walk the hashtable and free all entries */ + int i; callout_drain(V_tcp_hc_callout); + + /* Purge all hc entries. */ + tcp_hc_purge_internal(1); + + /* Free the uma zone and the allocated hash table. */ + uma_zdestroy(V_tcp_hostcache.zone); + + for (i = 0; i V_tcp_hostcache.hashsize; i++) + mtx_destroy(V_tcp_hostcache.hashbase[i].hch_mtx); + free(V_tcp_hostcache.hashbase, M_HOSTCACHE); } #endif @@ -633,22 +643,14 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) } /* - * Expire and purge (old|all) entries in the tcp_hostcache. Runs - * periodically from the callout. + * Caller has to make sure the curvnet is set properly. */ static void -tcp_hc_purge(void *arg) +tcp_hc_purge_internal(int all) { - CURVNET_SET((struct vnet *) arg); struct hc_metrics *hc_entry, *hc_next; - int all = 0; int i; - if (V_tcp_hostcache.purgeall) { - all = 1; - V_tcp_hostcache.purgeall = 0; - } - for (i = 0; i V_tcp_hostcache.hashsize; i++) { THC_LOCK(V_tcp_hostcache.hashbase[i].hch_mtx); TAILQ_FOREACH_SAFE(hc_entry, @@ -664,6 +666,24 @@ tcp_hc_purge(void *arg) } THC_UNLOCK(V_tcp_hostcache.hashbase[i].hch_mtx); } +} + +/* + * Expire and purge (old|all) entries in the tcp_hostcache. Runs + * periodically from the callout. + */ +static void +tcp_hc_purge(void *arg) +{ + CURVNET_SET((struct vnet *) arg); + int all = 0; + + if (V_tcp_hostcache.purgeall) { + all = 1; + V_tcp_hostcache.purgeall = 0; + } + + tcp_hc_purge_internal(all); callout_reset(V_tcp_hc_callout, V_tcp_hostcache.prune * hz, tcp_hc_purge, arg); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203726 - stable/8/sys/dev/aac
Author: emaste Date: Tue Feb 9 22:05:30 2010 New Revision: 203726 URL: http://svn.freebsd.org/changeset/base/203726 Log: MFC r198593: Rename aac_fast_intr to aac_filter to reflect its current use. Eliminate the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aacvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c == --- stable/8/sys/dev/aac/aac.c Tue Feb 9 22:01:42 2010(r203725) +++ stable/8/sys/dev/aac/aac.c Tue Feb 9 22:05:30 2010(r203726) @@ -909,8 +909,11 @@ aac_new_intr(void *arg) mtx_unlock(sc-aac_io_lock); } +/* + * Interrupt filter for !NEW_COMM interface. + */ int -aac_fast_intr(void *arg) +aac_filter(void *arg) { struct aac_softc *sc; u_int16_t reason; @@ -2032,18 +2035,11 @@ aac_setup_intr(struct aac_softc *sc) } } else { if (bus_setup_intr(sc-aac_dev, sc-aac_irq, - INTR_TYPE_BIO, aac_fast_intr, NULL, + INTR_TYPE_BIO, aac_filter, NULL, sc, sc-aac_intr)) { device_printf(sc-aac_dev, - can't set up FAST interrupt\n); - if (bus_setup_intr(sc-aac_dev, sc-aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, - NULL, (driver_intr_t *)aac_fast_intr, - sc, sc-aac_intr)) { - device_printf(sc-aac_dev, -can't set up MPSAFE interrupt\n); - return (EINVAL); - } + can't set up interrupt filter\n); + return (EINVAL); } } return (0); Modified: stable/8/sys/dev/aac/aacvar.h == --- stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:01:42 2010 (r203725) +++ stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:05:30 2010 (r203726) @@ -441,7 +441,7 @@ extern int aac_shutdown(device_t dev); extern int aac_suspend(device_t dev); extern int aac_resume(device_t dev); extern voidaac_new_intr(void *arg); -extern int aac_fast_intr(void *arg); +extern int aac_filter(void *arg); extern voidaac_submit_bio(struct bio *bp); extern voidaac_biodone(struct bio *bp); extern voidaac_startio(struct aac_softc *sc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203727 - head/sys/net
Author: bz Date: Tue Feb 9 22:15:59 2010 New Revision: 203727 URL: http://svn.freebsd.org/changeset/base/203727 Log: Add an SDT provider for vnets along with probes for vnet_alloc and vnet_destroy. Use the line number rather than NULL as dummy argument. Note: the fbt provider does not reliably provide :return probes (depending on optimization levels used at compile time) making it unusable for scripts to generate complete call-traces with well defined boundaries over allocations or destructions of virtual network stacks. Sponsored by: ISPsystem MFC After:8 days Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c == --- head/sys/net/vnet.c Tue Feb 9 22:05:30 2010(r203726) +++ head/sys/net/vnet.c Tue Feb 9 22:15:59 2010(r203727) @@ -38,11 +38,13 @@ __FBSDID($FreeBSD$); #include opt_ddb.h #include opt_kdb.h +#include opt_kdtrace.h #include sys/param.h #include sys/kdb.h #include sys/kernel.h #include sys/jail.h +#include sys/sdt.h #include sys/systm.h #include sys/sysctl.h #include sys/linker_set.h @@ -210,6 +212,13 @@ static TAILQ_HEAD(, vnet_data_free) vnet TAILQ_HEAD_INITIALIZER(vnet_data_free_head); static struct sx vnet_data_free_lock; +SDT_PROVIDER_DEFINE(vnet); +SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, int); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, int, struct vnet *); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, int, struct vnet *); +SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, int, struct vnet *); +SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, int); + /* * Allocate a virtual network stack. */ @@ -218,8 +227,10 @@ vnet_alloc(void) { struct vnet *vnet; + SDT_PROBE1(vnet, functions, vnet_alloc, entry, __LINE__); vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet-vnet_magic_n = VNET_MAGIC_N; + SDT_PROBE2(vnet, functions, vnet_alloc, alloc, __LINE__, vnet); /* * Allocate storage for virtualized global variables and copy in @@ -244,6 +255,7 @@ vnet_alloc(void) LIST_INSERT_HEAD(vnet_head, vnet, vnet_le); VNET_LIST_WUNLOCK(); + SDT_PROBE2(vnet, functions, vnet_alloc, return, __LINE__, vnet); return (vnet); } @@ -255,6 +267,7 @@ vnet_destroy(struct vnet *vnet) { struct ifnet *ifp, *nifp; + SDT_PROBE2(vnet, functions, vnet_destroy, entry, __LINE__, vnet); KASSERT(vnet-vnet_sockcnt == 0, (%s: vnet still has sockets, __func__)); @@ -281,6 +294,7 @@ vnet_destroy(struct vnet *vnet) vnet-vnet_data_base = 0; vnet-vnet_magic_n = 0xdeadbeef; free(vnet, M_VNET); + SDT_PROBE1(vnet, functions, vnet_destroy, return, __LINE__); } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203721 - head/share/man/man9
On Tuesday 09 February 2010 3:58:39 pm Edward Tomasz Napierala wrote: Author: trasz Date: Tue Feb 9 20:58:39 2010 New Revision: 203721 URL: http://svn.freebsd.org/changeset/base/203721 Log: Add references to VOP_* man pages to vnode(9). Hmm, it seems VOP_MARKATIME.9 is missing, probably because the actual manpage for that is missing. :-P -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203728 - head/sys/compat/linux
Author: delphij Date: Tue Feb 9 22:30:51 2010 New Revision: 203728 URL: http://svn.freebsd.org/changeset/base/203728 Log: - Return EAFNOSUPPORT instead of EINVAL for unsupported address family, this matches the Linux behavior. - Check if we have sufficient space allocated for socket structure, which fixes a buffer overflow when wrong length is being passed into the emulation layer. [1] PR: kern/138860 Submitted by: Mateusz Guzik mjguzik gmail com Reported by: Alexander Best [1] MFC after:2 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cTue Feb 9 22:15:59 2010 (r203727) +++ head/sys/compat/linux/linux_socket.cTue Feb 9 22:30:51 2010 (r203728) @@ -128,7 +128,7 @@ do_sa_get(struct sockaddr **sap, const s bdom = linux_to_bsd_domain(kosa-sa_family); if (bdom == -1) { - error = EINVAL; + error = EAFNOSUPPORT; goto out; } @@ -157,8 +157,13 @@ do_sa_get(struct sockaddr **sap, const s } } else #endif - if (bdom == AF_INET) + if (bdom == AF_INET) { alloclen = sizeof(struct sockaddr_in); + if (*osalen alloclen) { + error = EINVAL; + goto out; + } + } sa = (struct sockaddr *) kosa; sa-sa_family = bdom; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203729 - head/sys/net
Author: bz Date: Tue Feb 9 22:39:34 2010 New Revision: 203729 URL: http://svn.freebsd.org/changeset/base/203729 Log: Add DDB support for printing vnet_sysinit and vnet_sysuninit ordered call lists. Try to lookup function/symbol names and print those in addition to the pointers, along with the constants for subsystem and order. This is useful for debugging vnet teardown ordering issues. Make it possible to call the actual printing frunction from normal code at runtime, ie. from vnet_sysuninit(), if DDB support is there. Sponsored by: ISPsystem MFC After:8 days Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c == --- head/sys/net/vnet.c Tue Feb 9 22:30:51 2010(r203728) +++ head/sys/net/vnet.c Tue Feb 9 22:39:34 2010(r203729) @@ -57,6 +57,7 @@ __FBSDID($FreeBSD$); #ifdef DDB #include ddb/ddb.h +#include ddb/db_sym.h #endif #include net/if.h @@ -219,6 +220,10 @@ SDT_PROBE_DEFINE2(vnet, functions, vnet_ SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, int, struct vnet *); SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, int); +#ifdef DDB +static void db_show_vnet_print_vs(struct vnet_sysinit *, int); +#endif + /* * Allocate a virtual network stack. */ @@ -713,6 +718,64 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) } } +static void +db_show_vnet_print_vs(struct vnet_sysinit *vs, int ddb) +{ + const char *vsname, *funcname; + c_db_sym_t sym; + db_expr_t offset; + +#define xprint(...)\ + if (ddb)\ + db_printf(__VA_ARGS__); \ + else\ + printf(__VA_ARGS__) + + if (vs == NULL) { + xprint(%s: no vnet_sysinit * given\n, __func__); + return; + } + + sym = db_search_symbol((vm_offset_t)vs, DB_STGY_ANY, offset); + db_symbol_values(sym, vsname, NULL); + sym = db_search_symbol((vm_offset_t)vs-func, DB_STGY_PROC, offset); + db_symbol_values(sym, funcname, NULL); + xprint(%s(%p)\n, (vsname != NULL) ? vsname : , vs); + xprint( 0x%08x 0x%08x\n, vs-subsystem, vs-order); + xprint( %p(%s)(%p)\n, + vs-func, (funcname != NULL) ? funcname : , vs-arg); +#undef xprint +} + +DB_SHOW_COMMAND(vnet_sysinit, db_show_vnet_sysinit) +{ + struct vnet_sysinit *vs; + + db_printf(VNET_SYSINIT vs Name(Ptr)\n); + db_printf( Subsystem Order\n); + db_printf( Function(Name)(Arg)\n); + TAILQ_FOREACH(vs, vnet_constructors, link) { + db_show_vnet_print_vs(vs, 1); + if (db_pager_quit) + break; + } +} + +DB_SHOW_COMMAND(vnet_sysuninit, db_show_vnet_sysuninit) +{ + struct vnet_sysinit *vs; + + db_printf(VNET_SYSUNINIT vs Name(Ptr)\n); + db_printf( Subsystem Order\n); + db_printf( Function(Name)(Arg)\n); + TAILQ_FOREACH_REVERSE(vs, vnet_destructors, vnet_sysuninit_head, + link) { + db_show_vnet_print_vs(vs, 1); + if (db_pager_quit) + break; + } +} + #ifdef VNET_DEBUG DB_SHOW_COMMAND(vnetrcrs, db_show_vnetrcrs) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203731 - in head/sys: nfs nfsclient
Author: marius Date: Tue Feb 9 23:40:07 2010 New Revision: 203731 URL: http://svn.freebsd.org/changeset/base/203731 Log: Some style(9) fixes Modified: head/sys/nfs/nfs_common.c head/sys/nfs/nfs_common.h head/sys/nfsclient/nfs_krpc.c Modified: head/sys/nfs/nfs_common.c == --- head/sys/nfs/nfs_common.c Tue Feb 9 22:41:00 2010(r203730) +++ head/sys/nfs/nfs_common.c Tue Feb 9 23:40:07 2010(r203731) @@ -37,7 +37,7 @@ __FBSDID($FreeBSD$); /* * These functions support the macros and help fiddle mbuf chains for - * the nfs op functions. They do things like create the rpc header and + * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ @@ -75,10 +75,11 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; -static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, +int how); u_quad_t -nfs_curusec(void) +nfs_curusec(void) { struct timeval tv; @@ -176,7 +177,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d while (left == 0) { *mdp = mp = mp-m_next; if (mp == NULL) - return NULL; + return (NULL); left = mp-m_len; *dposp = mtod(mp, caddr_t); } @@ -184,13 +185,13 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d ret = *dposp; *dposp += siz; } else if (mp-m_next == NULL) { - return NULL; + return (NULL); } else if (siz MHLEN) { panic(nfs S too big); } else { MGET(mp2, how, MT_DATA); if (mp2 == NULL) - return NULL; + return (NULL); mp2-m_len = siz; mp2-m_next = mp-m_next; mp-m_next = mp2; @@ -206,7 +207,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d /* Loop around copying up the siz2 bytes */ while (siz2 0) { if (mp2 == NULL) - return NULL; + return (NULL); xfer = (siz2 mp2-m_len) ? mp2-m_len : siz2; if (xfer 0) { bcopy(mtod(mp2, caddr_t), ptr, xfer); @@ -229,7 +230,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d *dposp = npos; } } - return ret; + return (ret); } /* @@ -273,19 +274,21 @@ nfsm_build_xx(int s, struct mbuf **mb, c ret = *bpos; (*mb)-m_len += s; *bpos += s; - return ret; + return (ret); } void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_WAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_WAIT)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); } static void * @@ -299,10 +302,10 @@ nfsm_dissect_xx_sub(int s, struct mbuf * if (t1 = s) { ret = *dpos; *dpos += s; - return ret; + return (ret); } - cp2 = nfsm_disct(md, dpos, s, t1, how); - return cp2; + cp2 = nfsm_disct(md, dpos, s, t1, how); + return (cp2); } int @@ -312,11 +315,11 @@ nfsm_strsiz_xx(int *s, int m, struct mbu tl = nfsm_dissect_xx(NFSX_UNSIGNED, mb, bpos); if (tl == NULL) - return EBADRPC; + return (EBADRPC); *s = fxdr_unsigned(int32_t, *tl); if (*s m) - return EBADRPC; - return 0; + return (EBADRPC); + return (0); } int @@ -327,10 +330,10 @@ nfsm_adv_xx(int s, struct mbuf **md, cad t1 = mtod(*md, caddr_t) + (*md)-m_len - *dpos; if (t1 = s) { *dpos += s; - return 0; + return (0); } t1 = nfs_adv(md, dpos, s, t1); if (t1) - return t1; - return 0; + return (t1); + return (0); } Modified: head/sys/nfs/nfs_common.h == --- head/sys/nfs/nfs_common.h Tue Feb 9 22:41:00 2010(r203730) +++ head/sys/nfs/nfs_common.h Tue Feb 9 23:40:07 2010(r203731) @@ -33,7 +33,6 @@ * $FreeBSD$ */ - #ifndef _NFS_NFS_COMMON_H_ #define _NFS_NFS_COMMON_H_ @@ -86,7 +85,7 @@ do { \ goto nfsmout; \ } \ } while (0) - + #definenfsm_dissect(c, s) \ ({ \ void *ret; \
Re: svn commit: r203584 - head/tools/build/mk
On Sat, Feb 6, 2010 at 4:38 PM, Xin LI delp...@freebsd.org wrote: Author: delphij Date: Sun Feb 7 00:38:31 2010 New Revision: 203584 URL: http://svn.freebsd.org/changeset/base/203584 Log: Add files for NO_MAIL, NO_SENDMAIL and NO_MAILWRAPPER. MFC after: 2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 7 00:26:47 2010 (r203583) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 7 00:38:31 2010 (r203584) @@ -1536,9 +1536,33 @@ OLD_FILES+=usr/share/man/man8/lpd.8.gz OLD_FILES+=usr/share/man/man8/pac.8.gz .endif -#.if ${MK_MAILWRAPPER} == no -# to be filled in -#.endif +.if ${MK_MAIL} == no +OLD_FILES+=usr/bin/Mail +OLD_FILES+=usr/bin/biff +OLD_FILES+=usr/bin/fmt +OLD_FILES+=usr/bin/from +OLD_FILES+=usr/bin/mail +OLD_FILES+=usr/bin/mailx +OLD_FILES+=usr/bin/msgs +OLD_FILES+=usr/libexec/comsat +OLD_FILES+=usr/share/examples/etc/mail.rc +OLD_FILES+=usr/share/man/man1/Mail.1.gz +OLD_FILES+=usr/share/man/man1/biff.1.gz +OLD_FILES+=usr/share/man/man1/fmt.1.gz +OLD_FILES+=usr/share/man/man1/from.1.gz +OLD_FILES+=usr/share/man/man1/mail.1.gz +OLD_FILES+=usr/share/man/man1/mailx.1.gz +OLD_FILES+=usr/share/man/man1/msgs.1.gz +OLD_FILES+=usr/share/man/man8/comsat.8.gz +OLD_FILES+=usr/share/misc/mail.help +OLD_FILES+=usr/share/misc/mail.tildehelp +.endif + +.if ${MK_MAILWRAPPER} == no +OLD_FILES+=etc/mail/mailer.conf +OLD_FILES+=usr/sbin/mailwrapper +OLD_FILES+=usr/share/man/man8/mailwrapper.8.gz +.endif Hi, Thanks for fixing this. Do you think that usr/sbin/sendmail should be added here in the mailwrapper section, since it is a symlink to /usr/sbin/mailwrapper? -- Rob Farmer #.if ${MK_MAN} == no # This should add a dependency to a special target which removes all man pages. @@ -1750,9 +1774,220 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz # to be filled in or replaced with a special target #.endif -#.if ${MK_SENDMAIL} == no -# to be filled in -#.endif +.if ${MK_SENDMAIL} == no +OLD_FILES+=bin/rmail +OLD_FILES+=usr/bin/vacation +OLD_FILES+=usr/include/libmilter/mfapi.h +OLD_FILES+=usr/include/libmilter/mfdef.h +OLD_FILES+=usr/lib/libmilter.a +OLD_LIBS+=usr/lib/libmilter.so.5 +OLD_FILES+=usr/lib/libmilter_p.a +.if ${TARGET_ARCH} == amd64 +OLD_FILES+=usr/lib32/libmilter.a +OLD_LIBS+=usr/lib32/libmilter.so.5 +OLD_FILES+=usr/lib32/libmilter_p.a +.endif +OLD_FILES+=usr/libexec/mail.local +OLD_FILES+=usr/libexec/sendmail/sendmail +OLD_FILES+=usr/libexec/smrsh +OLD_FILES+=usr/sbin/editmap +OLD_FILES+=usr/sbin/mailstats +OLD_FILES+=usr/sbin/makemap +OLD_FILES+=usr/sbin/praliases +OLD_FILES+=usr/share/doc/smm/08.sendmailop/paper.ascii.gz +OLD_FILES+=usr/share/man/man1/mailq.1.gz +OLD_FILES+=usr/share/man/man1/newaliases.1.gz +OLD_FILES+=usr/share/man/man1/vacation.1.gz +OLD_FILES+=usr/share/man/man5/aliases.5.gz +OLD_FILES+=usr/share/man/man8/editmap.8.gz +OLD_FILES+=usr/share/man/man8/hoststat.8.gz +OLD_FILES+=usr/share/man/man8/mail.local.8.gz +OLD_FILES+=usr/share/man/man8/mailstats.8.gz +OLD_FILES+=usr/share/man/man8/makemap.8.gz +OLD_FILES+=usr/share/man/man8/praliases.8.gz +OLD_FILES+=usr/share/man/man8/purgestat.8.gz +OLD_FILES+=usr/share/man/man8/rmail.8.gz +OLD_FILES+=usr/share/man/man8/sendmail.8.gz +OLD_FILES+=usr/share/man/man8/smrsh.8.gz +OLD_FILES+=usr/share/sendmail/cf/README +OLD_FILES+=usr/share/sendmail/cf/cf/Makefile +OLD_FILES+=usr/share/sendmail/cf/cf/README +OLD_FILES+=usr/share/sendmail/cf/cf/chez.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/clientproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-hpux10.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-hpux9.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-osf1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-solaris2.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-sunos4.1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-ultrix4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cyrusproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-bsd4.4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-hpux10.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-hpux9.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-linux.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-mpeix.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-nextstep3.3.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-osf1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-solaris.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-sunos4.1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-ultrix4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/huginn.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/knecht.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mail.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mail.eecs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mailspool.cs.mc
svn commit: r203732 - in head/sys: nfs nfsclient nfsserver
Author: marius Date: Tue Feb 9 23:45:14 2010 New Revision: 203732 URL: http://svn.freebsd.org/changeset/base/203732 Log: - Move nfs_realign() from the NFS client to the shared NFS code and remove the NFS server version in order to reduce code duplication. The shared version now uses a second parameter how, which is passed on to m_get(9) and m_getcl(9) as the server used M_WAIT while the client requires M_DONTWAIT, and replaces the the previously unused parameter hsiz. - Change nfs_realign() to use nfsm_aligned() so as with other NFS code the alignment check isn't actually performed on platforms without strict alignment requirements for performance reasons because as the comment suggests unaligned data only occasionally occurs with TCP. - Change fha_extract_info() to use nfs_realign() with M_DONTWAIT rather than M_WAIT because it's called with the RPC sp_lock held. Reviewed by: jhb, rmacklem MFC after:1 week Modified: head/sys/nfs/nfs_common.c head/sys/nfs/nfs_common.h head/sys/nfsclient/nfs_krpc.c head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfs/nfs_common.c == --- head/sys/nfs/nfs_common.c Tue Feb 9 23:40:07 2010(r203731) +++ head/sys/nfs/nfs_common.c Tue Feb 9 23:45:14 2010(r203732) @@ -56,6 +56,7 @@ __FBSDID($FreeBSD$); #include sys/malloc.h #include sys/sysent.h #include sys/syscall.h +#include sys/sysctl.h #include vm/vm.h #include vm/vm_object.h @@ -78,6 +79,16 @@ nfstype nfsv3_type[9] = { static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +SYSCTL_DECL(_vfs_nfs); + +static int nfs_realign_test; +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RD, nfs_realign_test, +0, Number of realign tests done); + +static int nfs_realign_count; +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RD, nfs_realign_count, +0, Number of mbuf realignments done); + u_quad_t nfs_curusec(void) { @@ -337,3 +348,59 @@ nfsm_adv_xx(int s, struct mbuf **md, cad return (t1); return (0); } + +/* + * Check for badly aligned mbuf data and realign by copying the unaligned + * portion of the data into a new mbuf chain and freeing the portions of the + * old chain that were replaced. + * + * We cannot simply realign the data within the existing mbuf chain because + * the underlying buffers may contain other rpc commands and we cannot afford + * to overwrite them. + * + * We would prefer to avoid this situation entirely. The situation does not + * occur with NFS/UDP and is supposed to only occassionally occur with TCP. + * Use vfs.nfs.realign_count and realign_test to check this. + */ +int +nfs_realign(struct mbuf **pm, int how) +{ + struct mbuf *m, *n; + int off; + + ++nfs_realign_test; + while ((m = *pm) != NULL) { + if (!nfsm_aligned(m-m_len, u_int32_t) || + !nfsm_aligned(mtod(m, intptr_t), u_int32_t)) { + /* +* NB: we can't depend on m_pkthdr.len to help us +* decide what to do here. May not be worth doing +* the m_length calculation as m_copyback will +* expand the mbuf chain below as needed. +*/ + if (m_length(m, NULL) = MINCLSIZE) { + /* NB: m_copyback handles space MCLBYTES */ + n = m_getcl(how, MT_DATA, 0); + } else + n = m_get(how, MT_DATA); + if (n == NULL) + return (ENOMEM); + /* +* Align the remainder of the mbuf chain. +*/ + n-m_len = 0; + off = 0; + while (m != NULL) { + m_copyback(n, off, m-m_len, mtod(m, caddr_t)); + off += m-m_len; + m = m-m_next; + } + m_freem(*pm); + *pm = n; + ++nfs_realign_count; + break; + } + pm = m-m_next; + } + return (0); +} Modified: head/sys/nfs/nfs_common.h == --- head/sys/nfs/nfs_common.h Tue Feb 9 23:40:07 2010(r203731) +++ head/sys/nfs/nfs_common.h Tue Feb 9 23:45:14 2010(r203732) @@ -48,6 +48,7 @@ extern nfstype nfsv3_type[]; intnfs_adv(struct mbuf **, caddr_t *, int, int); u_quad_t nfs_curusec(void); void *nfsm_disct(struct mbuf **, caddr_t *, int, int, int); +intnfs_realign(struct mbuf **, int); /*
svn commit: r203733 - head/tools/build/mk
Author: delphij Date: Wed Feb 10 00:01:35 2010 New Revision: 203733 URL: http://svn.freebsd.org/changeset/base/203733 Log: Symbolic link to mailwrapper should only be removed if both MK_MAILWRAPPER and MK_SENDMAIL is no. Reported by: Rob Farmer rfarmer at predatorlabs.net Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 23:45:14 2010(r203732) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 10 00:01:35 2010(r203733) @@ -1559,7 +1559,9 @@ OLD_FILES+=usr/share/misc/mail.tildehelp .if ${MK_MAILWRAPPER} == no OLD_FILES+=etc/mail/mailer.conf +.if ${MK_SENDMAIL} == no OLD_FILES+=usr/sbin/mailwrapper +.endif OLD_FILES+=usr/share/man/man8/mailwrapper.8.gz .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203584 - head/tools/build/mk
Hi, Rob, On Tue, Feb 9, 2010 at 3:40 PM, Rob Farmer rfar...@predatorlabs.net wrote: Hi, Thanks for fixing this. Do you think that usr/sbin/sendmail should be added here in the mailwrapper section, since it is a symlink to /usr/sbin/mailwrapper? I think I have overlooked this case unfortunately. It's not the usr/sbin/sendmail should be removed, but usr/sbin/mailwrapper should NOT be removed if sendmail is still there. I have committed a patch to fix that and thanks for reporting the problem. Cheers, -- Xin LI delp...@delphij.net http://www.delphij.net ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
On Feb 9, 2010, at 11:17 AM, Marcel Moolenaar wrote: Action items: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. I'll implement it and send a patch for review to avoid unnecessary repository churn... Please review attached patch. I have a sample session of how a debugger can use the information (see XXX lines): hob% /usr/obj/nfs/bsddbg/trunk/bdb/bdb images/abort/abort [cursor=0x2560:0] bdb run process 1539 created process 1539 stopped with signal 5 XXX: 1: 0x2000-0x20001fff, 5, 0 37 `/nfs/bsddbg/trunk/images/abort/abort` XXX: 2: 0x2001-0x20011fff, 3, 0 0 `` XXX: 3: 0x20004001-0x200040077fff, 5, 0 21 `/libexec/ld-elf.so.1` XXX: 4: 0x200040086000-0x200040089fff, 3, 0x66000 21 `/libexec/ld-elf.so.1` XXX: 5: 0x20004008a000-0x200040091fff, 3, 0 0 `` XXX: 6: 0x8000-0x8001, 3, 0 0 `` XXX: 7: 0x9ffe-0x9fff, 3, 0 0 `` 0x20004001c560: { // MFB; alloc r2 = ar.pfs, 0x0, 0x3, 0x3, 0x0 nop.f 0x0 nop.b 0x0 ;; } [cursor=0x20004001c560:0] bdb step process 1575 stopped with signal 5 0x20004001c560: { // MFB; alloc r2 = ar.pfs, 0x0, 0x3, 0x3, 0x0 nop.f 0x0 nop.b 0x0 ;; } [cursor=0x20004001c560:1] bdb continue process 1539 stopped with signal 6 XXX: 1: 0x2000-0x20001fff, 5, 0 37 `/nfs/bsddbg/trunk/images/abort/abort` XXX: 2: 0x2001-0x20011fff, 3, 0 0 `` XXX: 3: 0x20004001-0x200040077fff, 5, 0 21 `/libexec/ld-elf.so.1` XXX: 4: 0x20004007e000-0x200040085fff, 3, 0x6000 0 `` XXX: 5: 0x200040086000-0x200040089fff, 3, 0x66000 21 `/libexec/ld-elf.so.1` XXX: 6: 0x20004008a000-0x200040099fff, 3, 0 0 `` XXX: 7: 0x20004009c000-0x2000402e1fff, 5, 0 15 `/lib/libc.so.7` XXX: 8: 0x2000402e2000-0x2000402e, 0, 0x246000 0 `` XXX: 9: 0x2000402f-0x2000402fdfff, 3, 0x244000 15 `/lib/libc.so.7` XXX: 10: 0x2000402fe000-0x200040319fff, 3, 0x262000 0 `` XXX: 11: 0x200040328000-0x200040339fff, 3, 0xe000 0 `` XXX: 12: 0x8000-0x8001, 3, 0 0 `` XXX: 13: 0x9ffe-0x9fff, 3, 0 0 `` 0x2000402a0c40: { // MBB; cmp.eq p0, p6 = r0, r10 (p6)br.sptk.few 2000400ded00 br.ret.sptk.few rp ;; } [cursor=0x2000402a0c40:0] bdb -- Marcel Moolenaar xcl...@mac.com ptrace.diff Description: Binary data ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203735 - head/usr.bin/uname
Author: emaste Date: Wed Feb 10 00:18:15 2010 New Revision: 203735 URL: http://svn.freebsd.org/changeset/base/203735 Log: Add new -o option (r203042) to manpage synopsis and usage(). Submitted by: ru Modified: head/usr.bin/uname/uname.1 head/usr.bin/uname/uname.c Modified: head/usr.bin/uname/uname.1 == --- head/usr.bin/uname/uname.1 Wed Feb 10 00:02:09 2010(r203734) +++ head/usr.bin/uname/uname.1 Wed Feb 10 00:18:15 2010(r203735) @@ -40,7 +40,7 @@ .Nd display information about the system .Sh SYNOPSIS .Nm -.Op Fl aimnprsv +.Op Fl aimnoprsv .Sh DESCRIPTION The .Nm Modified: head/usr.bin/uname/uname.c == --- head/usr.bin/uname/uname.c Wed Feb 10 00:02:09 2010(r203734) +++ head/usr.bin/uname/uname.c Wed Feb 10 00:18:15 2010(r203735) @@ -245,6 +245,6 @@ NATIVE_SYSCTLNAME_GET(ident, kern.ident void usage(void) { - fprintf(stderr, usage: uname [-aimnprsv]\n); + fprintf(stderr, usage: uname [-aimnoprsv]\n); exit(1); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203736 - releng/7.3
Author: kensmith Date: Wed Feb 10 00:26:20 2010 New Revision: 203736 URL: http://svn.freebsd.org/changeset/base/203736 Log: Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process. Approved by: re (implicit) Added: releng/7.3/ - copied from r203735, stable/7/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203737 - stable/8/usr.bin/netstat
Author: delphij Date: Wed Feb 10 00:34:13 2010 New Revision: 203737 URL: http://svn.freebsd.org/changeset/base/203737 Log: MFC r202060: Add a new option, -q howmany, which when used in conjuction with -w, exits netstat after _howmany_ outputs. Requested by: thomasa Reviewed by: freebsd-net (bms, old version in early 2007) Modified: stable/8/usr.bin/netstat/if.c stable/8/usr.bin/netstat/main.c stable/8/usr.bin/netstat/netstat.1 stable/8/usr.bin/netstat/netstat.h Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/if.c == --- stable/8/usr.bin/netstat/if.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/if.c Wed Feb 10 00:34:13 2010 (r203737) @@ -685,6 +685,8 @@ loop: if (!first) putchar('\n'); fflush(stdout); + if ((noutputs != 0) (--noutputs == 0)) + exit(0); oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); Modified: stable/8/usr.bin/netstat/main.c == --- stable/8/usr.bin/netstat/main.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/main.c Wed Feb 10 00:34:13 2010 (r203737) @@ -332,6 +332,7 @@ int hflag; /* show counters in human re intiflag; /* show interfaces */ intLflag; /* show size of listen queues */ intmflag; /* show memory stats */ +intnoutputs = 0; /* how much outputs before we exit */ intnumeric_addr; /* show addresses numerically */ intnumeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ @@ -358,7 +359,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, AaBbdf:ghI:iLlM:mN:np:rSstuWw:xz)) != -1) + while ((ch = getopt(argc, argv, AaBbdf:ghI:iLlM:mN:np:q:rSstuWw:xz)) != -1) switch(ch) { case 'A': Aflag = 1; @@ -444,6 +445,11 @@ main(int argc, char *argv[]) } pflag = 1; break; + case 'q': + noutputs = atoi(optarg); + if (noutputs != 0) + noutputs++; + break; case 'r': rflag = 1; break; @@ -780,7 +786,7 @@ usage(void) [-M core] [-N system], netstat -i | -I interface [-abdhntW] [-f address_family]\n [-M core] [-N system], - netstat -w wait [-I interface] [-d] [-M core] [-N system], + netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany], netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n [-M core] [-N system], netstat -i | -I interface -s [-f protocol_family | -p protocol]\n Modified: stable/8/usr.bin/netstat/netstat.1 == --- stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:34:13 2010 (r203737) @@ -32,7 +32,7 @@ .\@(#)netstat.1 8.8 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 9, 2009 +.Dd January 10, 2010 .Dt NETSTAT 1 .Os .Sh NAME @@ -136,6 +136,7 @@ is also present, print interface names u .Op Fl d .Op Fl M Ar core .Op Fl N Ar system +.Op Fl q Ar howmany .Ek .Xc At intervals of @@ -146,6 +147,11 @@ traffic on all configured network interf or a single .Ar interface . If +.Fl q +is also present, exit after +.Ar howmany +outputs. +If .Fl d is also present, show the number of dropped packets. .It Xo Modified: stable/8/usr.bin/netstat/netstat.h == --- stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:34:13 2010 (r203737) @@ -45,6 +45,7 @@ extern inthflag; /* show counters in hu extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ extern int mflag; /* show memory stats */ +extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203738 - releng/7.3
Author: kensmith Date: Wed Feb 10 04:01:45 2010 New Revision: 203738 URL: http://svn.freebsd.org/changeset/base/203738 Log: Update branch tag for 'make update'. Approved by: re (implicit) Modified: releng/7.3/Makefile.inc1 Modified: releng/7.3/Makefile.inc1 == --- releng/7.3/Makefile.inc1Wed Feb 10 00:34:13 2010(r203737) +++ releng/7.3/Makefile.inc1Wed Feb 10 04:01:45 2010(r203738) @@ -88,7 +88,7 @@ CLEANDIR= cleandir .endif CVS?= cvs -CVSFLAGS?= -r RELENG_7 -P -d -I! +CVSFLAGS?= -r RELENG_7_3 -P -d -I! SUP?= /usr/bin/csup SUPFLAGS?= -g -L 2 .if defined(SUPHOST) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203739 - releng/7.3/share/examples/cvsup
Author: kensmith Date: Wed Feb 10 04:06:29 2010 New Revision: 203739 URL: http://svn.freebsd.org/changeset/base/203739 Log: Update branch tag. Approved by: re (implicit) Modified: releng/7.3/share/examples/cvsup/standard-supfile Modified: releng/7.3/share/examples/cvsup/standard-supfile == --- releng/7.3/share/examples/cvsup/standard-supfileWed Feb 10 04:01:45 2010(r203738) +++ releng/7.3/share/examples/cvsup/standard-supfileWed Feb 10 04:06:29 2010(r203739) @@ -49,7 +49,7 @@ *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr -*default release=cvs tag=RELENG_7 +*default release=cvs tag=RELENG_7_3 *default delete use-rel-suffix # If you seem to be limited by CPU rather than network or disk bandwidth, try ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203740 - releng/7.3/sys/sys
Author: kensmith Date: Wed Feb 10 04:09:33 2010 New Revision: 203740 URL: http://svn.freebsd.org/changeset/base/203740 Log: Adjust __FreeBSD_version for this being the 7.3-RELEASE release branch. Approved by: re (implicit) Modified: releng/7.3/sys/sys/param.h Modified: releng/7.3/sys/sys/param.h == --- releng/7.3/sys/sys/param.h Wed Feb 10 04:06:29 2010(r203739) +++ releng/7.3/sys/sys/param.h Wed Feb 10 04:09:33 2010(r203740) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702106 /* Master, propagated to newvers */ +#define __FreeBSD_version 703000 /* Master, propagated to newvers */ #ifndef LOCORE #include sys/types.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203741 - releng/7.3/sys/conf
Author: kensmith Date: Wed Feb 10 04:10:36 2010 New Revision: 203741 URL: http://svn.freebsd.org/changeset/base/203741 Log: Ready for 7.3-RC1. Approved by: re (implicit) Modified: releng/7.3/sys/conf/newvers.sh Modified: releng/7.3/sys/conf/newvers.sh == --- releng/7.3/sys/conf/newvers.sh Wed Feb 10 04:09:33 2010 (r203740) +++ releng/7.3/sys/conf/newvers.sh Wed Feb 10 04:10:36 2010 (r203741) @@ -32,7 +32,7 @@ TYPE=FreeBSD REVISION=7.3 -BRANCH=PRERELEASE +BRANCH=RC1 if [ X${BRANCH_OVERRIDE} != X ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203742 - stable/7/sys/sys
Author: kensmith Date: Wed Feb 10 04:12:55 2010 New Revision: 203742 URL: http://svn.freebsd.org/changeset/base/203742 Log: Bump __FreeBSD_version to reflect that releng/7.3 has been branched. Approved by: re (implicit) Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h == --- stable/7/sys/sys/param.hWed Feb 10 04:10:36 2010(r203741) +++ stable/7/sys/sys/param.hWed Feb 10 04:12:55 2010(r203742) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702106 /* Master, propagated to newvers */ +#define __FreeBSD_version 703100 /* Master, propagated to newvers */ #ifndef LOCORE #include sys/types.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203743 - head/sys/mips/mips
Author: neel Date: Wed Feb 10 05:43:31 2010 New Revision: 203743 URL: http://svn.freebsd.org/changeset/base/203743 Log: Enable interrupts before doing AST processing to avoid a deadlock. Specifically on an SMP kernel it was observed that if both the processors are doing an exit1() via ast()-postsig()-sigexit() then we will deadlock. This happens because exit1() calls vmspace_exit() that in turn calls pmap_invalidate_all(). This function tries to do a smp_rendezvous() which blocks because the other processor is not responding to IPIs - because it too is doing AST processing with interrupts disabled. Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S == --- head/sys/mips/mips/exception.S Wed Feb 10 04:12:55 2010 (r203742) +++ head/sys/mips/mips/exception.S Wed Feb 10 05:43:31 2010 (r203743) @@ -728,6 +728,18 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE sw a3, STAND_RA_OFFSET(sp) # for debugging /* + * Enable interrupts before doing ast(). + * + * On SMP kernels the AST processing might trigger IPI to other processors. + * If that processor is also doing AST processing with interrupts disabled + * then we may deadlock. + */ + mfc0a0, COP_0_STATUS_REG + or a0, a0, SR_INT_ENAB + mtc0a0, COP_0_STATUS_REG + ITLBNOPFIX + +/* * DO_AST enabled interrupts */ DO_AST ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203744 - head/sys/kern
Author: davidxu Date: Wed Feb 10 05:47:34 2010 New Revision: 203744 URL: http://svn.freebsd.org/changeset/base/203744 Log: In function umtxq_insert_queue, use parameter q (shared/exclusive queue) instead of hard coded constant. This does not affect RELENG_8 and previous, because the code only exists in the HEAD. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c == --- head/sys/kern/kern_umtx.c Wed Feb 10 05:43:31 2010(r203743) +++ head/sys/kern/kern_umtx.c Wed Feb 10 05:47:34 2010(r203744) @@ -420,7 +420,7 @@ umtxq_insert_queue(struct umtx_q *uq, in uc = umtxq_getchain(uq-uq_key); UMTXQ_LOCKED_ASSERT(uc); KASSERT((uq-uq_flags UQF_UMTXQ) == 0, (umtx_q is already on queue)); - uh = umtxq_queue_lookup(uq-uq_key, UMTX_SHARED_QUEUE); + uh = umtxq_queue_lookup(uq-uq_key, q); if (uh != NULL) { LIST_INSERT_HEAD(uc-uc_spare_queue, uq-uq_spare_queue, link); } else { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203745 - head/sys/mips/mips
Author: neel Date: Wed Feb 10 06:29:43 2010 New Revision: 203745 URL: http://svn.freebsd.org/changeset/base/203745 Log: Call profclock() and statclock() explicitly on all cpus. Prior to this change these functions were called only on the BSP indirectly via hardclock(). top -P now shows usage statistics of all cpus. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c == --- head/sys/mips/mips/tick.c Wed Feb 10 05:47:34 2010(r203744) +++ head/sys/mips/mips/tick.c Wed Feb 10 06:29:43 2010(r203745) @@ -55,7 +55,7 @@ uint64_t counter_freq; uint64_t cycles_per_tick; uint64_t cycles_per_usec; uint64_t cycles_per_sec; -uint64_t cycles_per_hz; +uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; u_int32_t counter_upper = 0; u_int32_t counter_lower_last = 0; @@ -136,6 +136,9 @@ void mips_timer_init_params(uint64_t platform_counter_freq, int double_count) { + stathz = hz; + profhz = hz; + /* * XXX: Do not use printf here: uart code 8250 may use DELAY so this * function should be called before cninit. @@ -151,18 +154,23 @@ mips_timer_init_params(uint64_t platform cycles_per_tick = counter_freq / 1000; cycles_per_hz = counter_freq / hz; + cycles_per_stathz = counter_freq / stathz; + cycles_per_profhz = counter_freq / profhz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); cycles_per_sec = counter_freq ; counter_timecounter.tc_frequency = counter_freq; - printf(hz=%d cyl_per_hz:%jd cyl_per_usec:%jd freq:%jd cyl_per_hz:%jd cyl_per_sec:%jd\n, + printf(hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd + cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd + cyl_per_sec:%jd\n, hz, cycles_per_tick, cycles_per_usec, counter_freq, cycles_per_hz, - cycles_per_sec - ); + cycles_per_stathz, + cycles_per_profhz, + cycles_per_sec); set_cputicker(tick_ticker, counter_freq, 1); } @@ -280,17 +288,18 @@ clock_intr(void *arg) else hardclock_cpu(USERMODE(tf-sr)); } + /* Fire statclock at stathz. */ - cpu_ticks-stat_ticks += stathz; - if (cpu_ticks-stat_ticks = cycles_per_hz) { - cpu_ticks-stat_ticks -= cycles_per_hz; + cpu_ticks-stat_ticks += cycles_per_tick; + if (cpu_ticks-stat_ticks = cycles_per_stathz) { + cpu_ticks-stat_ticks -= cycles_per_stathz; statclock(USERMODE(tf-sr)); } /* Fire profclock at profhz, but only when needed. */ - cpu_ticks-prof_ticks += profhz; - if (cpu_ticks-prof_ticks = cycles_per_hz) { - cpu_ticks-prof_ticks -= cycles_per_hz; + cpu_ticks-prof_ticks += cycles_per_tick; + if (cpu_ticks-prof_ticks = cycles_per_profhz) { + cpu_ticks-prof_ticks -= cycles_per_profhz; if (profprocs != 0) profclock(USERMODE(tf-sr), tf-pc); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203746 - head/sys/mips/mips
Author: neel Date: Wed Feb 10 06:57:05 2010 New Revision: 203746 URL: http://svn.freebsd.org/changeset/base/203746 Log: Code cleanup: - make some variables static - remove unused variables. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c == --- head/sys/mips/mips/tick.c Wed Feb 10 06:29:43 2010(r203745) +++ head/sys/mips/mips/tick.c Wed Feb 10 06:57:05 2010(r203746) @@ -47,21 +47,19 @@ __FBSDID($FreeBSD$); #include sys/time.h #include sys/timetc.h +#include machine/hwfunc.h #include machine/clock.h #include machine/locore.h #include machine/md_var.h uint64_t counter_freq; -uint64_t cycles_per_tick; -uint64_t cycles_per_usec; -uint64_t cycles_per_sec; -uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; - -u_int32_t counter_upper = 0; -u_int32_t counter_lower_last = 0; -inttick_started = 0; -void platform_initclocks(void); +static uint64_t cycles_per_tick; +static uint64_t cycles_per_usec; +static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; + +static u_int32_t counter_upper = 0; +static u_int32_t counter_lower_last = 0; struct clk_ticks { @@ -103,10 +101,8 @@ mips_timer_early_init(uint64_t clock_hz) void platform_initclocks(void) { - if (!tick_started) { - tc_init(counter_timecounter); - tick_started++; - } + + tc_init(counter_timecounter); } static uint64_t @@ -157,20 +153,17 @@ mips_timer_init_params(uint64_t platform cycles_per_stathz = counter_freq / stathz; cycles_per_profhz = counter_freq / profhz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); - cycles_per_sec = counter_freq ; counter_timecounter.tc_frequency = counter_freq; printf(hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd - cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd - cyl_per_sec:%jd\n, + cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd\n, hz, cycles_per_tick, cycles_per_usec, counter_freq, cycles_per_hz, cycles_per_stathz, - cycles_per_profhz, - cycles_per_sec); + cycles_per_profhz); set_cputicker(tick_ticker, counter_freq, 1); } @@ -307,7 +300,7 @@ clock_intr(void *arg) #if 0 /* TARGET_OCTEON */ /* Run the FreeBSD display once every hz ticks */ wheel_run += cycles_per_tick; - if (wheel_run = cycles_per_sec) { + if (wheel_run = cycles_per_usec * 100ULL) { wheel_run = 0; octeon_led_run_wheel(); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r203747 - head/usr.bin/find
Author: ed Date: Wed Feb 10 07:15:21 2010 New Revision: 203747 URL: http://svn.freebsd.org/changeset/base/203747 Log: Remove unneeded CFLAGS. Modified: head/usr.bin/find/Makefile Modified: head/usr.bin/find/Makefile == --- head/usr.bin/find/Makefile Wed Feb 10 06:57:05 2010(r203746) +++ head/usr.bin/find/Makefile Wed Feb 10 07:15:21 2010(r203747) @@ -4,7 +4,6 @@ PROG= find SRCS= find.c function.c ls.c main.c misc.c operator.c option.c \ getdate.y -CFLAGS+= -DHAVE_SYS_TIMEB_H -I${.CURDIR} YFLAGS= .include bsd.prog.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org