Re: top/systat

2001-03-09 Thread Mikhail Kruk

[skip]

> When you try to run top, it looks for the symbol that represents nlist,
> and when it can't find it, it doesn't know where to find the nlist
> kernel function. I'm guessing nlist has something to do with a process
> list... hence, when top can't find nlist, it throws a fit.

I think nlist *is* the list of symbols. What I get from reading
kvm_nlist() it tries to lookup a given list of symbols in kernel. If it
fails, top gives up.
KVM_NLIST(3) more or less explains it.

Now I have another questions: it seems that under some conditions
kvm_nlist can fall back to some other method of getting the values:

/*
 * If we can't use the kld symbol lookup, revert to the
 * slow library call.
 */
if (!ISALIVE(kd))
return (__fdnlist(kd->nlfd, nl));

so my question is: whould this fdnlist work in abscence of kernel symbols?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message



Re: top/systat

2001-03-09 Thread Mikhail Kruk

Yeah, except that it doesn't list my problem. Well, now when I look at it
I realize that if I was any smarter I'd figure it out, but I just looked
at it and said to myself "Your kernel and userland are not synchronized?"
nope, that's not me, and kind of ignored tha second part of the paragraph
which deals with the symbols. I think FAQ should specifically say that
*striped kernel will cause the same top behavoir*.
Of course I might be overestemating number of people who are as dumb as I
am :)

> On Fri, Mar 09, 2001 at 02:14:21AM -0500, Mikhail Kruk wrote:
> > Hi,
> > So what's up with nlist in systat and top?
> >
> > Here is the output of systat:
> >
> >  systat: nlist: can't find following symbols:
> >   _ccpu
> >   _fscale
>
> See the FAQ.
>
> Kris
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message



Re: top/systat

2001-03-09 Thread Kris Kennaway

On Fri, Mar 09, 2001 at 02:14:21AM -0500, Mikhail Kruk wrote:
> Hi,
> So what's up with nlist in systat and top?
> 
> Here is the output of systat:
> 
>  systat: nlist: can't find following symbols:
>   _ccpu
>   _fscale

See the FAQ.

Kris

 PGP signature


Re: top/systat

2001-03-09 Thread Andrew Hesford

I'm probably going to make an ass out of myself¸ which has certainly
happened before. Still, a disclaimer: I don't know what I'm talking
about. Take everything I say with the whole canister of salt.

As I understand it, a symbol describes the relative entry point of a
function in a given block of code, so that programs know where to find
the functions they are looking for. Without symbols, programs have no
idea where to find functions in other programs.

By removing the kernel's symbols, you are saving some space.
However, you are also cutting away anything that isn't absolutely
essential to running the system.

When you try to run top, it looks for the symbol that represents nlist,
and when it can't find it, it doesn't know where to find the nlist
kernel function. I'm guessing nlist has something to do with a process
list... hence, when top can't find nlist, it throws a fit.

Please let me know how wrong or simplistic this understanding is... Now
I'm curious, too!

On Fri, Mar 09, 2001 at 03:32:10AM -0500, Mikhail Kruk wrote:
> btw this doesn't seem to make sense. I'd appreciate if you point me to
> something that would clarify this to me. I don't understand how top and
> friends use the symbols in kernel and I feel that I would like to know
> that.
-- 
Andrew Hesford
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message



Re: top, systat )-: (all rebuilt!)

2000-03-28 Thread Mikhail Teterin

The patches did the trick for me...

-mi

=On Tue, Mar 28, 2000 at 09:53:20AM -0500, Mikhail Teterin wrote:
=> Ruslan Ermilov once stated:
=>
=> =Do you use loader(8), or directly boot your kernel from boot blocks?
=>
=> Directly... Is that what it is?!?
=>
=Yes, starting from the following files/revisions:
=
=peter   1999/12/26 23:14:59 PST
=
=  Modified files:
=lib/libkvm   kvm.c kvm_alpha.c kvm_file.c
= kvm_getloadavg.c kvm_getswapinfo.c
= kvm_i386.c kvm_nlist.3 kvm_private.h
= kvm_proc.c kvm_sparc.c
=  Log:
=  Use kldsym(2) to lookup symbol values.  This avoids the kvm_mkdb juggling
=  and is module aware.  Yes, this means that kvm_nlist(3) will find symbols
=  in loaded modules.  The emulation of the nlist struct is pretty crude but
=  seems to work well enough for all the users in the tree that I found.
=
=  Revision  ChangesPath
=  1.12  +22 -113   src/lib/libkvm/kvm.c
=  1.4   +1 -2  src/lib/libkvm/kvm_alpha.c
=  1.9   +5 -0  src/lib/libkvm/kvm_file.c
=  1.3   +5 -1  src/lib/libkvm/kvm_getloadavg.c
=  1.10  +1 -2  src/lib/libkvm/kvm_getswapinfo.c
=  1.11  +5 -1  src/lib/libkvm/kvm_i386.c
=  1.5   +7 -9  src/lib/libkvm/kvm_nlist.3
=  1.5   +1 -1  src/lib/libkvm/kvm_private.h
=  1.25  +7 -2  src/lib/libkvm/kvm_proc.c
=  1.3   +5 -1  src/lib/libkvm/kvm_sparc.c
=
=
=Could you please try the following two patches (kindly provided by
=Bruce Evans), and tell us whether they help you.
=
=There is a kern/17422 on this issue, please follow-up to it.
=
=
=
=Cheers,
=--
=Ruslan Ermilov Sysadmin and DBA of the
[EMAIL PROTECTED]   United Commercial Bank,
[EMAIL PROTECTED] FreeBSD committer,
=+380.652.247.647   Simferopol, Ukraine
=
=http://www.FreeBSD.org The Power To Serve
=http://www.oracle.com  Enabling The Information Age

-- Start of included mail From:  Bruce Evans <[EMAIL PROTECTED]>

=Date:  Tue, 14 Mar 2000 13:51:49 +1100 (EST)
=X-Sender:  [EMAIL PROTECTED]
=To:  Ruslan Ermilov <[EMAIL PROTECTED]>
=cc:  Jordan Hubbard <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
=Subject:  Re: [4.0-ERRATA candidate?] loader(8)/kvm(3) interoperability issue

=On Mon, 13 Mar 2000, Ruslan Ermilov wrote:
=
=> One thing that should IMHO be pointed out in the upcoming 4.0-RELEASE's
=> ERRATA (or some more appropriate place), is the fact that the loader(8)
=> is now a prerequisite for certain programs using kvm(3) interface.
=> Obvious examples are top(1) and swapinfo(8).
=> 
=> If you boot your kernel without loader(8), directly through bootblocks,
=> these programs will not work.
=
=I don't user loader(8), and finally got around to fixing this.  The
=problem is that the kernel linker wants module data for the kernel.
=It defaults to using incomplete data if none is present.  The following
=supplies slightly less incomplete data:
=
=diff -c2 machdep.c~ machdep.c
=*** machdep.c~ Tue Feb 29 19:18:29 2000
=--- machdep.c  Mon Mar  6 10:05:52 2000
=***
=*** 1809,1812 
=--- 1799,1816 
=   preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
=   preload_bootstrap_relocate(KERNBASE);
=+  } else {
=+  static u_int32_t oldmoduledata[] = {
=+  1, sizeof("kernel"), 0, 0,
=+  2, sizeof("elf kernel"), 0, 0, 0,
=+  0x8004, 4, 0,
=+  0x8003, 4, 0,
=+  0, 0,
=+  };
=+ 
=+  preload_metadata = (caddr_t)&oldmoduledata[0];
=+  strcpy((char *)&oldmoduledata[2], "kernel");
=+  strcpy((char *)&oldmoduledata[6], "elf kernel");
=+  oldmoduledata[11] = roundup2(bootinfo.bi_esymtab, 4);
=+  oldmoduledata[14] = bootinfo.bi_symtab;
=   }
=   if (bootinfo.bi_envp)
=
=Bruce
=
-- End of included mail.

-- Start of included mail From:  Bruce Evans <[EMAIL PROTECTED]>

=Date:  Thu, 23 Mar 2000 01:33:15 +1100 (EST)
=X-Sender:  [EMAIL PROTECTED]
=To:  Ruslan Ermilov <[EMAIL PROTECTED]>
=Subject:  Re: [4.0-ERRATA candidate?] loader(8)/kvm(3) interoperability issue

=> Hmm, the kernel with this patch panics with fatal trap 12 earlier,
=> right after it reports the amount of available memory, if I boot
=> without loader(8), but works perfectly, if I do use loader(8).
=
=The symbol addresses in struct bootinfo were garbage when the symbol
=table was loaded but DDB was not configured.
=
=diff -c2 locore.s~ locore.s
=*** locore.s~  Mon Dec  6 11:12:51 1999
=--- locore.s   Thu Mar 23 01:11:57 2000
=***
=*** 45,51 
=  
=  #include "opt_bootp.h"
=- #include "opt_ddb.h"
=  #include "opt_nfsroot.h"
=- #include "opt_userconfig.h"
=  
=  #include 
=--- 45,49 
=***
=*** 751,756 
=   movl$R(_end),%esi
=  
=! /* include symbols if loaded and useful */
=! #ifdef DDB
=   movlR(_bootinfo+BI_ESYMT