Linux-Development-Sys Digest #390, Volume #8 Thu, 4 Jan 01 12:13:15 EST
Contents:
Re: GetTickCount() in Linux? (Josef Moellers)
Re: GetTickCount() in Linux? (Kasper Dupont)
Re: How to write this kind of regular expression (Paul Sackun)
Re: GetTickCount() in Linux? (Josef Moellers)
Moving processes ("frederik")
Re: Forcing a Core Dump (Erik Hensema)
Re: PrivateICE Linux system level symbolic source debugger ("Gene Heskett")
Re: Kernel Non-boot (Paul Sackun)
Re: Forcing a Core Dump (Villy Kruse)
IPChains incompatible with Kernel 2.4.0-test12 ("Markus Spiritus Familiaris")
Re: GetTickCount() in Linux? (Paul Miller)
Re: Moving processes (Kasper Dupont)
Re: GetTickCount() in Linux? (Kasper Dupont)
Re: Moving processes (Derek M. Flynn)
Re: GetTickCount() in Linux? (Josef Moellers)
Re: GetTickCount() in Linux? ("Nils M. Lunde")
Linux with < 2 MB RAM, is it possible (Daniel Aarno)
Re: Linux with < 2 MB RAM, is it possible (Kasper Dupont)
QUES: Uninterruptible BOGO MIPS udelay access from application (Tom J)
----------------------------------------------------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 09:29:06 +0100
"Nils M. Lunde" wrote:
> =
> Hi.
> =
> I need to know the time used by a certain part of a program.
> In MS Windows I use the GetTickCount() function.
> This function does not tend to exist in Linux, so I wonder what I shoul=
d
> do!?
> I've taken a look at the getrusage() function, but this function does n=
ot
> seem to count the time actually used by the program;
> if I use the sleep() function in the program, for example, this will no=
t
> make any difference on the time used.
> =
> I've also checked out the gettimeofday() function, but this seems to ha=
ve a
> rather large system overhead + it is a problem when the time used excee=
ds 24
> hours.
> =
> The only thing that seems to work is so-called jiffies, but these are o=
nly
> available in kernel mode.
> =
> Isn't there a way to do this in user-mode?
If you can run that program as root, you can mmap that part of kernel
data space that contains the jiffies counter. Reading it is then just
another memory access.
If you have a Pentium III or higher, you can also use the TSC register.
Look into /proc/cpuinfo. If "flags" contains "tsc", mail me for the
code. Beware that TSC is a 64 bit register (long long) and runs at full
clock speed, i.e. at 800MHz on an 800MHz CPU.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 09:05:03 +0000
Josef Moellers wrote:
>
[...]
>
> If you can run that program as root, you can mmap that part of kernel
> data space that contains the jiffies counter. Reading it is then just
> another memory access.
> If you have a Pentium III or higher, you can also use the TSC register.
> Look into /proc/cpuinfo. If "flags" contains "tsc", mail me for the
> code. Beware that TSC is a 64 bit register (long long) and runs at full
> clock speed, i.e. at 800MHz on an 800MHz CPU.
>
> --
> Josef M�llers (Pinguinpfleger bei FSC)
> If failure had no penalty success would not be a prize (T. Pratchett)
In /proc/uptime you can read the jifies
converted to seconds with two decimals.
You can also read the timer line in
/proc/interrupts, but then you need to
know the number of jifies pr. second.
(This is normally 100 except from a few
architectures where it is 1000)
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED] (Paul Sackun)
Subject: Re: How to write this kind of regular expression
Reply-To: [EMAIL PROTECTED]
Date: Thu, 04 Jan 2001 09:01:33 GMT
In article <[EMAIL PROTECTED]>, InterFan wrote:
>I want to substitute part of this kind of string :
>HGSSI:MSISDN=msisdn,SS=ss[,BSG=bsg][,FNUM=fnum[,OFA=ofa][,TIME=time]]
>
>string in '[]' is optional.
>
>I want to use regular expression to deal with it. How to do ? thanks.
>
It depends on which part you want to change.
If you want to change the =<word> part (e.g. msisdn -> foobar) you would do:
s/=msisdn/=foobar/
I know quite a bit about regexes but you will have to be much much much more
specific regarding what you want to substitute.
--
Liberty is always dangerous, but it is the safest thing we have.
-- Harry Emerson Fosdick
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 10:41:32 +0100
Kasper Dupont wrote:
> =
> Josef Moellers wrote:
> >
> [...]
> >
> > If you can run that program as root, you can mmap that part of kernel=
> > data space that contains the jiffies counter. Reading it is then just=
> > another memory access.
> > If you have a Pentium III or higher, you can also use the TSC registe=
r.
> > Look into /proc/cpuinfo. If "flags" contains "tsc", mail me for the
> > code. Beware that TSC is a 64 bit register (long long) and runs at fu=
ll
> > clock speed, i.e. at 800MHz on an 800MHz CPU.
> >
> > --
> > Josef M=F6llers (Pinguinpfleger bei FSC)
> > If failure had no penalty success would not be a prize (T. P=
ratchett)
> =
> In /proc/uptime you can read the jifies
> converted to seconds with two decimals.
> You can also read the timer line in
> /proc/interrupts, but then you need to
> know the number of jifies pr. second.
> (This is normally 100 except from a few
> architectures where it is 1000)
That may be right, but all of these require entry into kernel space.
Reading "jiffies" from an mmapped page or reading the TSC register is
just a handfull of instructions.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: "frederik" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.networking,comp.unix.programmer
Subject: Moving processes
Date: Thu, 4 Jan 2001 10:37:19 +0100
Hello,
I am currently working on an implementation of a Mobile Agent platform. The
agents run in different processes on several host machines in a network.
The agents and thus the processes have to be movable from one host to
another for load balancing purposes.
Does anybody know wether it is possible to capture the state of a running
process, transfer it to another host and restarting it on the other machine
in the same state as it left the first one
Frederik De Backer
student University of Ghent.
------------------------------
From: [EMAIL PROTECTED] (Erik Hensema)
Subject: Re: Forcing a Core Dump
Date: Thu, 4 Jan 2001 00:21:37 +0100
Reply-To: [EMAIL PROTECTED]
Marc Schneider ([EMAIL PROTECTED]) wrote:
>I have a bug which is difficult to debug. I am getting intermitted
>Segmentation Fault in my program. If I run the program in a debugger,
>it doesn't segfault. I would like to force my program to dump core
>for all segfaults. Is there an easy way to do this?
Sure, just don't install a SIGSEGV handler.
BTW is your application multithreaded? When a multithreaded application
doesn't crash under a debugger, you've often got race-conditions which
don't occur under the debugger because of the slightly different timing
(other race-conditions may occur, tough).
>BTW, I'm running RH6.1 if that make a difference.
Nah.
--
Erik Hensema ([EMAIL PROTECTED])
12:19am up 5 days, 12:33, 2 users, load average: 1.08, 1.13, 1.35
------------------------------
Date: 4 Jan 2001 7:8:19 -0500
From: "Gene Heskett" <[EMAIL PROTECTED]>
Subject: Re: PrivateICE Linux system level symbolic source debugger
Gene Heskett sends Greetings to Klaus Peter;
1: This almost looks like spam
2: whereinhells the linewrap setting in your agent, set for 72 chars
please.
3: Stuff the html someplace near a black hole, news is TEXT based and
there is no excuse for trippling the size of the message AND making it
un-readable at the same time.
KPG> PrivateICE Linux system level symbolic source debugger
KPG> the debugger that will create faster turnaround times when
KPG> creating drivers for the LINUX operating system. Step through
KPG> source code on a live system, stop system with a keystroke at
KPG> any moment you want, see the inner workings of the LINUX kernel,
KPG> see your hardware in realtime, find nasty bugs more easily, no
KPG> need for printk()'s anymore. It's the SoftICE for LINUX. See for
KPG> yourself, source code and binary is now available for the first
KPG> time on http://www.sourceforge.net/projects/pice.
KPG> Want to help make this a great open source product, mail to
KPG> [EMAIL PROTECTED]
Now here I can read it, my editor did the line wrapping yours didn't.
This looks as if it would be a fine debugging tool.
[snip html]
Cheers, Gene
--
Gene Heskett, CET, UHK |Amiga A2k Zeus040, Linux @ 600mhz
email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
# <http://www.thirdwave.net/~jimlucia/amigahomeauto> #
ISP's please take note: My spam control policy is explicit!
#Any Class C address# involved in spamming me is added to my killfile
never to be seen again. Message will be automaticly deleted without dl.
This messages reply content, but not any previously quoted material,
is � 2000 by Gene Heskett, all rights reserved.
--
------------------------------
From: [EMAIL PROTECTED] (Paul Sackun)
Subject: Re: Kernel Non-boot
Reply-To: [EMAIL PROTECTED]
Date: Thu, 04 Jan 2001 12:01:13 GMT
In article <MzS46.44119$[EMAIL PROTECTED]>, mpierce wrote:
>Mandrake 7.2, kernel 2.2.17-21
>
>Compiled new kernel-2.4.0-test12
>Compiled & install modules - no runs, no drips, no errors.
>Mv bzImage to vmlinuz-2.4.0-test12 to make a boot disk
I think the problem might be in the last step. Please describe what you mean by
"Mv bzImage to vmlinuz-2.4.0-test12 to make a boot disk" and I might be able to
help. Did you rerun lilo? Copy System.map to the right place??
--
Emerson's Law of Contrariness:
Our chief want in life is somebody who shall make us do what we
can. Having found them, we shall then hate them for it.
------------------------------
From: [EMAIL PROTECTED] (Villy Kruse)
Subject: Re: Forcing a Core Dump
Date: 4 Jan 2001 12:53:18 GMT
On Thu, 04 Jan 2001 06:03:25 GMT, Paul Sackun <[EMAIL PROTECTED]> wrote:
>
>Another thing you can do if for some reason RH6.1 doesn't coredump w/ segfaults
>is create signal handler for SIGSEGV and have it call abort(3).
>
In this situation the abort won't produce a core either. Besides, when you
catch SIGSEGV and later call abort you get another context in your core file
which will make analysis later more difficult.
Also, note that suid programs will never produce a core dump.
Villy
------------------------------
From: "Markus Spiritus Familiaris" <[EMAIL PROTECTED]>
Subject: IPChains incompatible with Kernel 2.4.0-test12
Date: Thu, 4 Jan 2001 14:00:43 +0100
Hi!
I just installed the new hackerkernel 2.4.0-test12 on my linux box
i achieved to compile and everything, machine boots up.
but there's a problem:
kernel gives out the following:
"IPCHains FAILED: Incompatible with this kernel: Protocol not available"
I have turned on the options required for NAT/IPCHAINS in the kernel
compilation questions, but it still doesnt work;
i dont know why.
hm.
i have SuSE 6.3 installed on my box. With the standard kernel supplied with
this package (i think its 2.2.13 or so) masquerading works.
I
Help would be very appreciated.
Thanx in advance.
[EMAIL PROTECTED]
------------------------------
From: Paul Miller <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 07:32:31 -0600
> I need to know the time used by a certain part of a program.
> In MS Windows I use the GetTickCount() function.
> This function does not tend to exist in Linux, so I wonder what I should
> do!?
Try clock().
--
Paul Miller - [EMAIL PROTECTED]
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.networking,comp.unix.programmer
Subject: Re: Moving processes
Date: Thu, 04 Jan 2001 14:29:22 +0000
frederik wrote:
>
> Hello,
>
> I am currently working on an implementation of a Mobile Agent platform. The
> agents run in different processes on several host machines in a network.
> The agents and thus the processes have to be movable from one host to
> another for load balancing purposes.
> Does anybody know wether it is possible to capture the state of a running
> process, transfer it to another host and restarting it on the other machine
> in the same state as it left the first one
>
> Frederik De Backer
> student University of Ghent.
That is not trivial, but can be possible. You have to make a
routine to run through your memory mappings and save anything
that is not automatically saved to files. You have to run
through open files and save fd, name and flags. If the program
uses other resources you have to do something about them as
well. Encapsulating all resources in a library can make this
easier.
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 14:33:17 +0000
Josef Moellers wrote:
>
> Kasper Dupont wrote:
> >
> > Josef Moellers wrote:
> > >
> > [...]
> > >
> > > If you can run that program as root, you can mmap that part of kernel
> > > data space that contains the jiffies counter. Reading it is then just
> > > another memory access.
> > > If you have a Pentium III or higher, you can also use the TSC register.
> > > Look into /proc/cpuinfo. If "flags" contains "tsc", mail me for the
> > > code. Beware that TSC is a 64 bit register (long long) and runs at full
> > > clock speed, i.e. at 800MHz on an 800MHz CPU.
> > >
> > > --
> > > Josef M�llers (Pinguinpfleger bei FSC)
> > > If failure had no penalty success would not be a prize (T. Pratchett)
> >
> > In /proc/uptime you can read the jifies
> > converted to seconds with two decimals.
> > You can also read the timer line in
> > /proc/interrupts, but then you need to
> > know the number of jifies pr. second.
> > (This is normally 100 except from a few
> > architectures where it is 1000)
>
> That may be right, but all of these require entry into kernel space.
> Reading "jiffies" from an mmapped page or reading the TSC register is
> just a handfull of instructions.
>
No, any process can read /proc/uptime and
/proc/interrupts. By comparing the information
it is even posible to compute the jiffi rate.
Mmaping parts of kernel space on the other
hand requires superuser priveleges and is not
a good idea.
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED] (Derek M. Flynn)
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.networking,comp.unix.programmer
Subject: Re: Moving processes
Date: Thu, 04 Jan 2001 14:48:39 GMT
frederik wrote:
> I am currently working on an implementation of a Mobile Agent platform. The
> agents run in different processes on several host machines in a network.
> The agents and thus the processes have to be movable from one host to
> another for load balancing purposes.
> Does anybody know wether it is possible to capture the state of a running
> process, transfer it to another host and restarting it on the other machine
> in the same state as it left the first one
Look at the work being done by the Condor project at:
http://www.cs.wisc.edu/condor/
In addition, they wrote an article that you might try to find:
"Checkpointing and Migration of UNIX Processes in the Condor Distributed
Processing System" Dr Dobbs Journal, February 1995
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 04 Jan 2001 15:58:05 +0100
Kasper Dupont wrote:
> =
> Josef Moellers wrote:
[ ... ]
> > That may be right, but all of these require entry into kernel space.
> > Reading "jiffies" from an mmapped page or reading the TSC register is=
> > just a handfull of instructions.
> >
> =
> No, any process can read /proc/uptime and
> /proc/interrupts. By comparing the information
> it is even posible to compute the jiffi rate.
Yes, but I was referring to the fact that opening and reading a node in
/proc means that you issue a system call with an enormous amount of
overhead just to read a few bytes.
In the original posting, "Nils M. Lunde" <[EMAIL PROTECTED]> wrote:
> I've also checked out the gettimeofday() function, but this seems to
> have a
> rather large system overhead
And I doubt that a combination of open()/read() has less overhead than
gettimeofday().
> Mmaping parts of kernel space on the other
> hand requires superuser priveleges and is not
> a good idea.
If the OP's program runs with superuser privileges anyway or if his
intention is just to time a loop, why not change to root and save a few
(or lots of) cycles?
Back to the issue: Nils, have you looked at times(2)? I know, this is a
system call, too ...
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: "Nils M. Lunde" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Thu, 4 Jan 2001 16:37:53 +0100
>Back to the issue: Nils, have you looked at times(2)? I know, this is a
>system call, too ...
>
I've tried, but this only returns the time in seconds.
I need to know the time in milliseconds.
But I'm using jiffies now, and it is working all right.
Thanks for your help!
-Nils Magne
------------------------------
From: [EMAIL PROTECTED] (Daniel Aarno)
Subject: Linux with < 2 MB RAM, is it possible
Date: 4 Jan 2001 15:32:49 GMT
Is it possible to run linux on a 386 with less then 2 MB RAM?
If it is, may I have some hints on what to chage or where to look for the changes
--
Bishop - [EMAIL PROTECTED]
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Linux with < 2 MB RAM, is it possible
Date: Thu, 04 Jan 2001 16:09:18 +0000
Daniel Aarno wrote:
>
> Is it possible to run linux on a 386 with less then 2 MB RAM?
>
> If it is, may I have some hints on what to chage or where to look for the changes
>
> --
> Bishop - [EMAIL PROTECTED]
It might be possible, but it would be hard to make
it run. If you actually get it runing the performance
would probably be horrible. I don't think it would
be worth the effort.
The kernel is normally placed starting at address
0x100000, which is after the 1MB range used for
base memory, video memory and rom. If there is only
640KB Base memory or the extended memory is too
small for even the smallest kernel you will have
to rewrite loader/decompresion/kernel to make the
kernel run from base memory. Even if you can make
the kernel fit into base memory it will need some
more memory to actually get some work done.
I suggest you upgrade the computer with 8MB or
more memory if that is posible.
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED] (Tom J)
Subject: QUES: Uninterruptible BOGO MIPS udelay access from application
Date: Thu, 4 Jan 2001 16:06:22 GMT
Hello. I have read most of the mini howto on bogo mips.
I take it that this is a strictly kernel thing, so I could use udelay(us)
in a driver. By the way, is it uninterruptible?
Is there access for applications to udelay uninterruptibly so tthat nothing
else can happen (as long is power is on) during the timer loop?
Then I could use it for precision timing. Is udelay uninterruptible
when used in the kernel (e.g. in a driver module)?
Thanks
--
Tom J.; tej at world.std.com Massachusetts USA; MSCS; Systems Programmer
Dist. Real-Time Data Acquisition S/W for Science and Eng. under POSIX,
C, C++, X, Motif, Graphics, Audio http://world.std.com/~tej
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************