[RFC] prototype of top(1)'s CPU current frequency display

2006-08-20 Thread Norikatsu Shigemura
I want to see CPU current frequency on top(1), because I want
to see relation of process status (CPU usage) and cpu current
frequency using powerd(8) on the fly.  In recently, many CPUs
for servers like Xeon support frequency changing like Speed
Step Technology.  I run powerd(8) on these servers.  So I
should know performance issue, whichever program performance
or server performance.  I wrote a little usability patch.
But I don't think that my code is not good:-(.  So please
improve my code.

Wellknown problem.
1. assume only 1 CPU.
2. assume dev.cpu.0.freq is always exists.
3. display position is good?

--- usr.bin/top/machine.c.orig  Wed May 18 22:42:51 2005
+++ usr.bin/top/machine.c   Sun Aug 20 16:41:59 2006
@@ -153,10 +153,10 @@
 
 /* these are for detailing the process states */
 
-int process_states[8];
+int process_states[9];
 char *procstatenames[] = {
,  starting, ,  running, ,  sleeping, ,  stopped, ,
-zombie, ,  waiting, ,  lock, ,
+zombie, ,  waiting, ,  lock, ,  MHz, ,
NULL
 };
 
@@ -628,6 +628,9 @@
prev_pp-ki_pctcpu += pp-ki_pctcpu;
}
}
+
+   /* CPU current frequency */
+   GETSYSCTL(dev.cpu.0.freq, process_states[8]);
 
/* if requested, sort the interesting processes */
if (compare != NULL)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [PATCH] adding two new options to 'cp'

2006-08-20 Thread Mike Silbersack


On Wed, 26 Jul 2006, Eric Anderson wrote:

I'm tired of trying to use rsync or gcp (which doesn't like symlinks often) 
to copy trees of files/directories using hard links, so I added the gcp-ish 
options -a and -l.


...


Comments? Flames? Committers willing to commit?

Eric


Having just read this thread start to finish, I strongly feel that Eric 
should be given an award for putting up with all the crap he was given and 
not losing his temper.


In sincerely hope that this thread does not scare off others who have 
local patches that they are considering contributing to FreeBSD.


Mike Silby Silbersack
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


uplcom and getty

2006-08-20 Thread Yoichi NAKAYAMA
Can't we use ttyU0 with getty?

I have USB to serial converter ELECOM UC-SGT
# usbdevs -v | grep Prolific
 port 2 addr 4: full speed, power 500 mA, config 1, USB-Serial 
Controller(0x5004), Prolific Technology Inc.(0x056e), rev 3.00

I linked two machine with RS232C reverse cable and UC-SGT.
I cannot connect getty on ttyU0 on the machine.
  remote# cu -l /dev/ttyd0
does not print anything.

I have the line
  ttyU0   /usr/libexec/getty std.9600   vt100   on secure
in /etc/ttys and getty is actually running as
  local# ps -ax | grep ttyU0 | grep -v grep
   1171  ??  I  0:00.40 /usr/libexec/getty std.9600 ttyU0

# I have no problem with
#   local# cu -l /dev/cuaU0
# to connect getty running on ttyd0 of remote machine.
-- 
Yoichi NAKAYAMA
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


global date via module howto

2006-08-20 Thread Roman Kurakin

Hi,

   I have the following problem:
module A
   int x;

module B
   extern int x;

   Module A is loaded, module B can't be loaded cause of unknow 'x'.
What should I do to make x global?

PS. I am working on porting irda support for USB devices from NetBSD.
The current model consists of two layers hw and sw. hw is the usb device
driver. sw is some software layer the same for all device and it is a
child on top of hw 'bus'. To make this working I need to add
DRIVER_MODULE for each 'bus'. To make sw independent from the
bus I need to export _driver and _class structures and put DRIVER_MODULE
in 'bus' code instead of 'child'.

rik

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


About loader(8) forth

2006-08-20 Thread Matteo Riondato
Hi folks,
I'm trying to understand how the loader forth works to see if it's
possible to develop something similar to knoppix boot menu and use it
for FreeSBIE. 
Just to have a try, I replaced /boot/beastie.4th with file a
containing only: 

. Welcome to FreeSBIE
exit

then I deleted the line mentioning beastie-start from /boot/loader.rc
and rebooted my machine.

I wanted the machine to print Welcome to FreeSBIE and then escape to
loader prompt.

Saying it didn't work is probably not enough. I got an error message
saying Compile failed followed by some codes I didn't had the time
to copy because my machine auto-rebooted.

I must admit I'm a forth newbie. What so important id I miss?
Any hint that will make me proceed in the correct direction will be much
appreciated.
Thanks in advance
Best regards
-- 
Matteo Riondato
FreeBSD Committer (http://www.freebsd.org)
G.U.F.I. Staff Member (http://www.gufi.org)
FreeSBIE Developer (http://www.freesbie.org)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


PCI express support?

2006-08-20 Thread David Gilbert
I got a PCI express version of the Intel gigabit adaptor to try.
Heh.  Comes with a big-ass heatsink on the card.  I found that a bit
amusing.

But it doesn't probe up.  Is this because PCI Express is not supported
(1x in this case --- the little slot), or because I need to put in the
constants for this card?

Dave.

-- 

|David Gilbert, Independent Contractor.   | Two things can be  |
|Mail:   [EMAIL PROTECTED]|  equal if and only if they |
|http://daveg.ca  |   are precisely opposite.  |
=GLO
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Adding remove file option to BSD tar?

2006-08-20 Thread Tim Kientzle

What do people think about adding an equivalent to
gtars --remove-files?


Shouldn't be too tricky.  If you think you know
how to implement it, send me the diffs.

Doing this safely is nearly impossible, of
course.  In the compressed case, the compression
pipeline buffers a LOT of data ...


Actually, this might not be as hard as I first thought.

Just keep a FIFO of files added to the archive, and
a running count of the total size of those files.
When the count exceeds some limit, delete the
oldest file in the queue and update the size.
If you keep the limit pretty high (2MB?  10MB?),
then you can be pretty confident that files
will not get deleted before they have been
safely added to the archive.

Tim Kientzle
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Aqcuiring full path to running process from outside the kernel

2006-08-20 Thread Reko Turja
I've been playing with Open Watcom for a bit in FreeBSD and for a 
while there's been one stumblim block for further advancement. Watcom 
uses a method for storing program messages etc. where these messages 
are stored as a resource file inside the executable itself. As the 
commands are usually invoked without the canonical path, the tools 
cannot find the resource portion stored inside.


This far I've been looking for some solutions from which none seem to 
work too well. vn_fullpath (9) is running only inside kernel I think, 
and with the approach using kvm_openfiles and kvm_getprocs I can only 
get the command without the path (there are vnode etc. structures 
inside the kinfo_proc structure, but those seem to be unavailable from 
user space). Of course /proc might help in here, but I rather kept the 
code compilable on very vanilla system.


Any pointers on how to proceed would be welcome.

-Reko 


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Aqcuiring full path to running process from outside the kernel

2006-08-20 Thread Mike Meyer
In [EMAIL PROTECTED], Reko Turja [EMAIL PROTECTED] typed:
 I've been playing with Open Watcom for a bit in FreeBSD and for a 
 while there's been one stumblim block for further advancement. Watcom 
 uses a method for storing program messages etc. where these messages 
 are stored as a resource file inside the executable itself. As the 
 commands are usually invoked without the canonical path, the tools 
 cannot find the resource portion stored inside.
 
 This far I've been looking for some solutions from which none seem to 
 work too well. vn_fullpath (9) is running only inside kernel I think, 
 and with the approach using kvm_openfiles and kvm_getprocs I can only 
 get the command without the path (there are vnode etc. structures 
 inside the kinfo_proc structure, but those seem to be unavailable from 
 user space). Of course /proc might help in here, but I rather kept the 
 code compilable on very vanilla system.
 
 Any pointers on how to proceed would be welcome.

In general, what you're asking can't be done on Unix.  The vn_fullpath
man page notes this by pointing out that it makes a best effort, and
giving a list of reasons why it isn't reliable. Many of those apply in
your case as well.

However, you can also make a best effort. Check argv[0] to see if you
have an absolute path. If not, do what the shell would do to find the
executable - look for it on $PATH. Once you've found it, call
realpath(3) to canonicalize the path.

mike
-- 
Mike Meyer [EMAIL PROTECTED]  http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Aqcuiring full path to running process from outside the kernel

2006-08-20 Thread Reko Turja
Of course I did find about the CTL_KERN.KERN_PROC.KERN_PROC_PATHNAME 
sysctl method of grabbing the path just about the same time Mike 
replied to my query... Seems that either of the ways suggested by Mike 
could be used as fallback.


Sorry about the noise.

-Reko 


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI express support?

2006-08-20 Thread Antony Mawer

On 21/08/2006 3:09 AM, David Gilbert wrote:

I got a PCI express version of the Intel gigabit adaptor to try.
Heh.  Comes with a big-ass heatsink on the card.  I found that a bit
amusing.

But it doesn't probe up.  Is this because PCI Express is not supported
(1x in this case --- the little slot), or because I need to put in the
constants for this card?


You might want to try the latest Intel driver from their site, or 
alternatively I think the latest driver has been merged to 6.1-STABLE. I 
had a Intel Pro/1000 PT, and it was only recognised in -CURRENT. Using 
the official Intel driver allowed me to get it running on 6.1. This was 
prior to the recent MFC of the newer driver.


-Antony
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI express support?

2006-08-20 Thread Mike Tancsa
On Sun, 20 Aug 2006 13:09:28 -0400, in sentex.lists.freebsd.hackers
you wrote:

I got a PCI express version of the Intel gigabit adaptor to try.
Heh.  Comes with a big-ass heatsink on the card.  I found that a bit
amusing.

But it doesn't probe up.  Is this because PCI Express is not supported
(1x in this case --- the little slot), or because I need to put in the
constants for this card?

Just the devids seem to work just fine for me

http://lists.freebsd.org/pipermail/freebsd-hardware/2006-June/003550.html

---Mike

Mike Tancsa, Sentex communications http://www.sentex.net
Providing Internet Access since 1994
[EMAIL PROTECTED], (http://www.tancsa.com)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI express support?

2006-08-20 Thread AlanBAKA

Search for Pro/1000 PT Server Adapter Drive on their web site
It works for any Pro/1000 chip from intel on from 4.x to 6.x FreeBSD

Mike Tancsa wrote:


On Sun, 20 Aug 2006 13:09:28 -0400, in sentex.lists.freebsd.hackers
you wrote:

 


I got a PCI express version of the Intel gigabit adaptor to try.
Heh.  Comes with a big-ass heatsink on the card.  I found that a bit
amusing.

But it doesn't probe up.  Is this because PCI Express is not supported
(1x in this case --- the little slot), or because I need to put in the
constants for this card?
   



Just the devids seem to work just fine for me

http://lists.freebsd.org/pipermail/freebsd-hardware/2006-June/003550.html

---Mike

Mike Tancsa, Sentex communications http://www.sentex.net
Providing Internet Access since 1994
[EMAIL PROTECTED], (http://www.tancsa.com)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]

 



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: global date via module howto

2006-08-20 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Roman Kurakin [EMAIL PROTECTED] writes:
: I have the following problem:
: module A
: int x;
: 
: module B
: extern int x;
: 
: Module A is loaded, module B can't be loaded cause of unknow 'x'.
: What should I do to make x global?

Better to make module B depend on module A.  Making it global is
generally a bad idea.

in module A:
MODULE_VERSION(A, 1);

In module B:
MODULE_DEPEND(B, A, 1, 1, 1);

Warner

: PS. I am working on porting irda support for USB devices from NetBSD.
: The current model consists of two layers hw and sw. hw is the usb device
: driver. sw is some software layer the same for all device and it is a
: child on top of hw 'bus'. To make this working I need to add
: DRIVER_MODULE for each 'bus'. To make sw independent from the
: bus I need to export _driver and _class structures and put DRIVER_MODULE
: in 'bus' code instead of 'child'.

Are you sure that you need to do this?  I'm pretty sure that you can
create a base class irdabus and then derive all the hw modules that
implement irdabus from than and all the children will automatically
probe.  No need to export the driver/class structures.

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]