diff options
author | Roger A. Faulkner <Roger.Faulkner@Oracle.COM> | 2010-04-03 09:48:44 -0700 |
---|---|---|
committer | Roger A. Faulkner <Roger.Faulkner@Oracle.COM> | 2010-04-03 09:48:44 -0700 |
commit | 3e14f97f673e8a630f076077de35afdd43dc1587 (patch) | |
tree | 9828b6b676f58d7b27dd28e00202d3f3461a5cd8 /usr/src/lib/libast/common/vmalloc/vmdebug.c | |
parent | 4f60987df4dcaa54a88b596f861fbf4f3382c65e (diff) | |
download | illumos-gate-3e14f97f673e8a630f076077de35afdd43dc1587.tar.gz |
6939349 RFE: Update ksh93 to ast-ksh.2010-03-09
6877392 ksh93 regresses 'uniq -c' performance
6887363 Korn shell 93 sometimes mishandles return value of its child process
6900314 (while true ; do true|true ; done) hang in ioctl() with SIGTTOU
6904557 wc no longer counts number of bytes correctly
6904575 cut -d with multibyte character no longer works
6904597 paste -d no longer works with multibyte characters
6904780 /usr/bin/cksum changed output in snv_128
6904870 uniq -s does not skip multibyte characters correctly
6904878 join -t no longer works with multibyte char separator
6907460 EXIT trap handlers are sometimes executed twice
6909579 libast getopt solaris compatibility broken
6920072 ksh93 tail -f, with unconditional .25s sleep and line parsing, about 37x slower than cat
6932124 mktemp in ksh93 is broken
Contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
Diffstat (limited to 'usr/src/lib/libast/common/vmalloc/vmdebug.c')
-rw-r--r-- | usr/src/lib/libast/common/vmalloc/vmdebug.c | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/usr/src/lib/libast/common/vmalloc/vmdebug.c b/usr/src/lib/libast/common/vmalloc/vmdebug.c index dede7d0469..3cb1e3963e 100644 --- a/usr/src/lib/libast/common/vmalloc/vmdebug.c +++ b/usr/src/lib/libast/common/vmalloc/vmdebug.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1985-2009 AT&T Intellectual Property * +* Copyright (c) 1985-2010 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -177,7 +177,7 @@ int type; /* operation being done */ bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(func),-1), ':'); } - *bufp++ = '\n'; + *(bufp - 1) = '\n'; *bufp = '\0'; vmdbwarn(vm,buf,(bufp-buf)); @@ -463,9 +463,9 @@ Void_t* data; vmdbcheck(vm); if((offset = KPVADDR(vm,data,dbaddr)) != 0) - { if(vm->disc->exceptf) + { dbwarn(vm,(Vmuchar_t*)data,offset == -1L ? 0 : 1,file,line,func,DB_FREE); + if(vm->disc->exceptf) (void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc); - dbwarn(vm,(Vmuchar_t*)data,offset == -1L ? 0 : 1,file,line,func,DB_FREE); CLRLOCK(vd,0); CLRINUSE(vd, inuse); return -1; @@ -537,9 +537,9 @@ int type; /* !=0 for movable, >0 for copy */ vmdbcheck(vm); if((offset = KPVADDR(vm,addr,dbaddr)) != 0) - { if(vm->disc->exceptf) + { dbwarn(vm,(Vmuchar_t*)addr,offset == -1L ? 0 : 1,file,line,func,DB_RESIZE); + if(vm->disc->exceptf) (void)(*vm->disc->exceptf)(vm,VM_BADADDR,addr,vm->disc); - dbwarn(vm,(Vmuchar_t*)addr,offset == -1L ? 0 : 1,file,line,func,DB_RESIZE); CLRLOCK(vd,0); CLRINUSE(vd, inuse); return NIL(Void_t*); @@ -744,6 +744,39 @@ done: return (Void_t*)data; } +/* print statistics of region vm. If vm is NULL, use Vmregion */ +#if __STD_C +ssize_t vmdbstat(Vmalloc_t* vm) +#else +ssize_t vmdbstat(vm) +Vmalloc_t* vm; +#endif +{ Vmstat_t st; + char buf[1024], *bufp; + + vmstat(vm ? vm : Vmregion, &st); + bufp = buf; + bufp = (*_Vmstrcpy)(bufp, "n_busy", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)((Vmulong_t)st.n_busy,-1), ','); + bufp = (*_Vmstrcpy)(bufp, " s_busy", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(st.s_busy),-1), '\n'); + bufp = (*_Vmstrcpy)(bufp, "n_free", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)((Vmulong_t)st.n_free,-1), ','); + bufp = (*_Vmstrcpy)(bufp, " s_free", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(st.s_free),-1), '\n'); + bufp = (*_Vmstrcpy)(bufp, "m_busy", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(st.m_busy),-1), ','); + bufp = (*_Vmstrcpy)(bufp, " m_free", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(st.m_free),-1), '\n'); + bufp = (*_Vmstrcpy)(bufp, "n_segment", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)((Vmulong_t)st.n_seg,-1), ','); + bufp = (*_Vmstrcpy)(bufp, " extent", '='); + bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(VLONG(st.extent),-1), '\n'); + *bufp = 0; + write(Dbfd, buf, strlen(buf)); + return strlen(buf); +} + static Vmethod_t _Vmdebug = { dballoc, |