automatic system info tool?

Started by Andrew Dunstanalmost 20 years ago84 messageshackers
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

Someone at the conference mentioned a tool that would portably and
reliably report system info such as architecture. If someone has details
I would like to have them, as it would help solve the buildfarm
personality problem properly.

cheers

andrew

#2Josh Berkus
josh@agliodbs.com
In reply to: Andrew Dunstan (#1)
Re: automatic system info tool?

Andrew,

Someone at the conference mentioned a tool that would portably and
reliably report system info such as architecture. If someone has details
I would like to have them, as it would help solve the buildfarm
personality problem properly.

There's potentially two, actually. A SF start-up is going to be
open-sourcing a tool, soon, and Jim Nasby said that Distributed.net has code
for this.

--
Josh Berkus
PostgreSQL @ Sun
San Francisco

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#1)
Re: automatic system info tool?

Andrew Dunstan wrote:

Someone at the conference mentioned a tool that would portably and
reliably report system info such as architecture.

What's wrong with config.guess?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Eisentraut (#3)
Re: automatic system info tool?

Peter Eisentraut wrote:

Andrew Dunstan wrote:

Someone at the conference mentioned a tool that would portably and
reliably report system info such as architecture.

What's wrong with config.guess?

That will probably be OK for architecture.

We also classify buildfarm machines by <os, os_version, compiler,
compiler_version> and config.guess doesn't give us that, unfortunately.

However, I will look at canonicalising the architecture to the
config.guess values reported.

cheers

andrew

#5Dave Page
dpage@pgadmin.org
In reply to: Andrew Dunstan (#4)
Re: automatic system info tool?

-----Original Message-----
From: "Andrew Dunstan" <andrew@dunslane.net>
To: "Peter Eisentraut" <peter_e@gmx.net>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Sent: 16/07/06 23:50
Subject: Re: [HACKERS] automatic system info tool?

We also classify buildfarm machines by <os, os_version, compiler,
compiler_version> and config.guess doesn't give us that, unfortunately.

It also won't work on Win32 without msys (or SFU/Interix).

/D

#6Martijn van Oosterhout
kleptog@svana.org
In reply to: Andrew Dunstan (#4)
Re: automatic system info tool?

On Sun, Jul 16, 2006 at 06:49:26PM -0400, Andrew Dunstan wrote:

We also classify buildfarm machines by <os, os_version, compiler,
compiler_version> and config.guess doesn't give us that, unfortunately.

It would seem to be a lot easier to use the values from perl itself,
given you're already using it:

# perl -MConfig -e 'print "os=$Config{osname}, osvers=$Config{osvers}, archname=$Config{archname}\n"'
os=linux, osvers=2.6.15.4, archname=i486-linux-gnu-thread-multi

If you look at perl -V it give you a subset of useful values, probably
a lot nicer than munging config.guess. It'll even tell you the size of
of the C datatypes if you're interested :)

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#7Andrew Dunstan
andrew@dunslane.net
In reply to: Martijn van Oosterhout (#6)
Re: automatic system info tool?

I'm fairly familiar with it :-)

The trouble is that it gives info set at the time perl was compiled,
which doesn't help with the problem where a machine has been upgraded.
For example, on this FC3 machine it reports a different kernel version
from the one I have upgraded to, not surprisingly.

So what I need if possible is a runtime tool to detect the info we need.

cheers

andrew

Martijn van Oosterhout wrote:

Show quoted text

On Sun, Jul 16, 2006 at 06:49:26PM -0400, Andrew Dunstan wrote:

We also classify buildfarm machines by <os, os_version, compiler,
compiler_version> and config.guess doesn't give us that, unfortunately.

It would seem to be a lot easier to use the values from perl itself,
given you're already using it:

# perl -MConfig -e 'print "os=$Config{osname}, osvers=$Config{osvers}, archname=$Config{archname}\n"'
os=linux, osvers=2.6.15.4, archname=i486-linux-gnu-thread-multi

If you look at perl -V it give you a subset of useful values, probably
a lot nicer than munging config.guess. It'll even tell you the size of
of the C datatypes if you're interested :)

Have a nice day,

#8Martijn van Oosterhout
kleptog@svana.org
In reply to: Andrew Dunstan (#7)
Re: automatic system info tool?

On Mon, Jul 17, 2006 at 09:06:34AM -0400, Andrew Dunstan wrote:

I'm fairly familiar with it :-)

The trouble is that it gives info set at the time perl was compiled,
which doesn't help with the problem where a machine has been upgraded.
For example, on this FC3 machine it reports a different kernel version
from the one I have upgraded to, not surprisingly.

Hmm. The osname and archname might still be useful, but the rest could
be out of date.

So what I need if possible is a runtime tool to detect the info we need.

On UNIX systems uname may work pretty well. But I guess each system may
have slightly different options. What'll probably happen is that you
end up with a big if() statement testing $Config{osname} wtih each case
having specific code to determine the specifics. But for that you need
information. How do you get the currently running release of windows
for example?

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#9Bort, Paul
pbort@tmwsystems.com
In reply to: Martijn van Oosterhout (#8)
Re: automatic system info tool?

On UNIX systems uname may work pretty well. But I guess each
system may
have slightly different options. What'll probably happen is that you
end up with a big if() statement testing $Config{osname} wtih
each case
having specific code to determine the specifics. But for that you need
information. How do you get the currently running release of windows
for example?

If you can open a command shell you can get the OS version with the
'ver' command under Windows:

C:\>ver

Microsoft Windows XP [Version 5.1.2600]

C:\>

This should work on 2000 or later. (Windows 2000 is 5.0.something.)

Regards,
Paul

#10Martijn van Oosterhout
kleptog@svana.org
In reply to: Bort, Paul (#9)
Re: automatic system info tool?

On Mon, Jul 17, 2006 at 11:06:50AM -0400, Bort, Paul wrote:

If you can open a command shell you can get the OS version with the
'ver' command under Windows:

C:\>ver

Microsoft Windows XP [Version 5.1.2600]

How do you do this from a program though. Under UNIX uname() is a
function call as well as a program. It returns the os name, version,
hostname and system type.

Mind you, maybe perl provides emulation for uname?

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#11Steve Atkins
steve@blighty.com
In reply to: Martijn van Oosterhout (#10)
Re: automatic system info tool?

On Jul 17, 2006, at 12:57 PM, Martijn van Oosterhout wrote:

On Mon, Jul 17, 2006 at 11:06:50AM -0400, Bort, Paul wrote:

If you can open a command shell you can get the OS version with the
'ver' command under Windows:

C:\>ver

Microsoft Windows XP [Version 5.1.2600]

How do you do this from a program though. Under UNIX uname() is a
function call as well as a program. It returns the os name, version,
hostname and system type.

GetVersionEx() will get you the windows version, service pack, etc IIRC.

Cheers,
Steve

#12Bort, Paul
pbort@tmwsystems.com
In reply to: Martijn van Oosterhout (#10)
Re: automatic system info tool?

How do you do this from a program though. Under UNIX uname() is a
function call as well as a program. It returns the os name, version,
hostname and system type.

Multiple methods (TIMTOWTDI) depending on what you want:

my $verstring = `cmd.exe /c ver`;

# or

use Win32;
my ($string, $major, $minor, $build, $id ) = Win32::GetOSVersion;

The environment variables PROCESSOR_ARCHITECTURE and
PROCESSOR_IDENTIFIER should provide the basic hardware information.

Mind you, maybe perl provides emulation for uname?

Not that I know of.

Show quoted text

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

From each according to his ability. To each according to

his ability to litigate.

#13Jie Zhang
jzhang@greenplum.com
In reply to: Dave Page (#5)
On-disk bitmap index patch

Hi,

I have posted a patch to the CVS head for on-disk bitmap index to
pgsql-patches. If this can get in 8.2, that would be great. Any comments and
suggestions are welcome.

I still need to add several items:

(1) README file in src/backend/access/bitmap.
(2) Bitmap index documentation.
(3) Hiding the internal btree.

Also, I have disabled the multi-column index support because there is a
known problem. Assume that there is a bitmap index on a and b. When a query
predicate has only a, the current code may generate a wrong result. That's
because the current code assumes that b is null. The ultimate problem is
because the search code only handles one bitmap vector now. I need a fix to
support manipulating multiple bitmap vectors.

If you find any other problems, please let me know.

Thanks,
Jie

#14Andrej Ricnik-Bay
andrej.groups@gmail.com
In reply to: Bort, Paul (#12)
Re: automatic system info tool?

On 7/18/06, Bort, Paul <pbort@tmwsystems.com> wrote:

Mind you, maybe perl provides emulation for uname?

Not that I know of.

Wouldn't $^0 and $Config{archname} cover quite a few, though?

#15Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Steve Atkins (#11)
Re: automatic system info tool?

If you can open a command shell you can get the OS version with the

'ver' command under Windows:

C:\>ver

Microsoft Windows XP [Version 5.1.2600]

How do you do this from a program though. Under UNIX uname() is a
function call as well as a program. It returns the os name, version,

hostname and system type.

GetVersionEx() will get you the windows version, service
pack, etc IIRC.

in perl:

use POSIX;
print join(',',POSIX::uname()),"\n";

prints:
Windows NT,hostname.domain.com,5.0,Build 2195 (Service Pack 4),x86

Works on all Platforms.

(more detail on Win with: use Win32; join(' ', Win32::GetOSVersion()),
"\n";)

Andreas

#16Andrew Dunstan
andrew@dunslane.net
In reply to: Andrej Ricnik-Bay (#14)
Re: automatic system info tool?

Andrej Ricnik-Bay wrote:

On 7/18/06, Bort, Paul <pbort@tmwsystems.com> wrote:

Mind you, maybe perl provides emulation for uname?

Not that I know of.

Wouldn't $^0 and $Config{archname} cover quite a few, though?

No. As previously explained, these values reflect what was true when and
where perl was compiled. In general, I need what is true at the time
buildfarm is run.

Anyway, I think we have some good possibilities.

cheers

andrew

#17Gavin Sherry
swm@linuxworld.com.au
In reply to: Jie Zhang (#13)
Re: On-disk bitmap index patch

On Mon, 17 Jul 2006, Jie Zhang wrote:

Hi,

I have posted a patch to the CVS head for on-disk bitmap index to
pgsql-patches. If this can get in 8.2, that would be great. Any comments and
suggestions are welcome.

I still need to add several items:

(1) README file in src/backend/access/bitmap.
(2) Bitmap index documentation.
(3) Hiding the internal btree.

Also, I have disabled the multi-column index support because there is a
known problem. Assume that there is a bitmap index on a and b. When a query
predicate has only a, the current code may generate a wrong result. That's
because the current code assumes that b is null. The ultimate problem is
because the search code only handles one bitmap vector now. I need a fix to
support manipulating multiple bitmap vectors.

If you find any other problems, please let me know.

Is anyone else looking at this patch? I am reviewing it with Jie, tidying
it up and trying to solve some of the problems mentioned above. If anyone
wants to take a look at us, please ask for an updated patch.

Thanks,

Gavin

#18Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gavin Sherry (#17)
Re: On-disk bitmap index patch

Gavin Sherry <swm@linuxworld.com.au> writes:

Is anyone else looking at this patch?

It's on my list of things to look at, but so are a lot of other patches ;-)

A couple of comments after a *very* fast scan through the patch:

* The xlog routines need help; they seem to not be updated for recent
changes in the API for xlog recovery code.

* The hacks on vacuum.c (where it tests the AM name) are utterly
unacceptable. If you need the main code to do something special for a
particular index AM, define a bool flag column for it in pg_am.

* The interface to the existing executor bitmap scan code is mighty
messy --- seems like there's a lot of almost duplicate code, a lot
of rather invasive hacking, etc. This needs to be rethought and
refactored.

* Why in the world is it introducing duplicate copies of a lot
of btree comparison functions? Use the ones that are there.

* The patch itself is a mess: it introduces .orig and .rej files,
changes around $PostgreSQL$ lines, etc.

However, the main problem I've got with this is that a new index AM is a
pretty large burden, and no one's made the slightest effort to sell
pghackers on taking this on. What's the use-case, what's the
performance like, where is it really an improvement over what we've got?

regards, tom lane

#19Gavin Sherry
swm@linuxworld.com.au
In reply to: Tom Lane (#18)
Re: On-disk bitmap index patch

On Sun, 23 Jul 2006, Tom Lane wrote:

Gavin Sherry <swm@linuxworld.com.au> writes:

Is anyone else looking at this patch?

It's on my list of things to look at, but so are a lot of other patches ;-)

A couple of comments after a *very* fast scan through the patch:

* The xlog routines need help; they seem to not be updated for recent
changes in the API for xlog recovery code.

Yep. The patch was actually against 8.1 and was hastily brought up to 8.2.
I think Jie's intention was to simply let everyone know that this was
going on.

* The hacks on vacuum.c (where it tests the AM name) are utterly
unacceptable. If you need the main code to do something special for a
particular index AM, define a bool flag column for it in pg_am.

Yes.

* The interface to the existing executor bitmap scan code is mighty
messy --- seems like there's a lot of almost duplicate code, a lot
of rather invasive hacking, etc. This needs to be rethought and
refactored.

I agree.

* Why in the world is it introducing duplicate copies of a lot
of btree comparison functions? Use the ones that are there.

Yes, I raised this with Jie and she has fixed it. One thought is, we may
want to rename those comparison functions prefixed with 'bm' to make their
naming less confusing. They'll be used by btree, gin and bitmap index
methods. Anyway, a seperate patch.

* The patch itself is a mess: it introduces .orig and .rej files,
changes around $PostgreSQL$ lines, etc.

Right, not to mention patches to configure and a lot of style which needs
to be knocked into shape.

However, the main problem I've got with this is that a new index AM is a
pretty large burden, and no one's made the slightest effort to sell
pghackers on taking this on. What's the use-case, what's the
performance like, where is it really an improvement over what we've got?

For low cardinality sets, bitmaps greatly out perform btree. Jie and
others at Greenplum tested this implementation (and others) against very
large, low cardinality sets. I wasn't involved in it. I urge Jie and/or
Luke to present those results.

Thanks,

Gavin

#20Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gavin Sherry (#19)
Re: On-disk bitmap index patch

Gavin Sherry <swm@linuxworld.com.au> writes:

On Sun, 23 Jul 2006, Tom Lane wrote:

However, the main problem I've got with this is that a new index AM is a
pretty large burden, and no one's made the slightest effort to sell
pghackers on taking this on.

For low cardinality sets, bitmaps greatly out perform btree.

If the column is sufficiently low cardinality, you might as well just do
a seqscan --- you'll be hitting most of the heap's pages anyway. I'm
still waiting to be convinced that there's a sweet spot wide enough to
justify supporting another index AM. (I'm also wondering whether this
doesn't overlap the use-case for GIN.)

regards, tom lane

#21Luke Lonergan
llonergan@greenplum.com
In reply to: Tom Lane (#20)
#22Jie Zhang
jzhang@greenplum.com
In reply to: Gavin Sherry (#19)
#23Hannu Krosing
hannu@tm.ee
In reply to: Tom Lane (#20)
#24Jie Zhang
jzhang@greenplum.com
In reply to: Hannu Krosing (#23)
#25Bruce Momjian
bruce@momjian.us
In reply to: Jie Zhang (#24)
#26Jie Zhang
jzhang@greenplum.com
In reply to: Bruce Momjian (#25)
#27Gavin Sherry
swm@linuxworld.com.au
In reply to: Bruce Momjian (#25)
#28Mark Mielke
mark@mark.mielke.cc
In reply to: Bruce Momjian (#25)
#29Mark Kirkwood
mark.kirkwood@catalyst.net.nz
In reply to: Jie Zhang (#24)
#30Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Mielke (#28)
#31Mark Mielke
mark@mark.mielke.cc
In reply to: Tom Lane (#30)
#32Luke Lonergan
llonergan@greenplum.com
In reply to: Mark Mielke (#31)
#33Tom Lane
tgl@sss.pgh.pa.us
In reply to: Luke Lonergan (#32)
#34Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Luke Lonergan (#21)
#35Hannu Krosing
hannu@tm.ee
In reply to: Jim Nasby (#34)
#36Hannu Krosing
hannu@tm.ee
In reply to: Tom Lane (#33)
#37Josh Berkus
josh@agliodbs.com
In reply to: Tom Lane (#20)
#38Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hannu Krosing (#36)
#39Luke Lonergan
llonergan@greenplum.com
In reply to: Tom Lane (#38)
#40Tom Lane
tgl@sss.pgh.pa.us
In reply to: Josh Berkus (#37)
#41Ron Mayer
rm_pg@cheapcomplexdevices.com
In reply to: Tom Lane (#30)
#42Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ron Mayer (#41)
#43Mark Kirkwood
mark.kirkwood@catalyst.net.nz
In reply to: Tom Lane (#40)
#44Ayush Parashar
aparashar@greenplum.com
In reply to: Tom Lane (#33)
#45Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Kirkwood (#43)
#46Mark Kirkwood
mark.kirkwood@catalyst.net.nz
In reply to: Tom Lane (#45)
#47Luke Lonergan
llonergan@greenplum.com
In reply to: Tom Lane (#45)
#48Jie Zhang
jzhang@greenplum.com
In reply to: Luke Lonergan (#47)
#49Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Kirkwood (#46)
#50Jie Zhang
jzhang@greenplum.com
In reply to: Tom Lane (#49)
#51Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jie Zhang (#50)
#52Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Tom Lane (#38)
#53Jie Zhang
jzhang@greenplum.com
In reply to: Tom Lane (#51)
#54Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jim Nasby (#52)
#55Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Alvaro Herrera (#54)
#56Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Jie Zhang (#53)
#57Kenneth Marshall
ktm@it.is.rice.edu
In reply to: Jim Nasby (#55)
#58Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jim Nasby (#55)
#59Luke Lonergan
llonergan@greenplum.com
In reply to: Jim Nasby (#56)
#60Bruce Momjian
bruce@momjian.us
In reply to: Luke Lonergan (#59)
#61Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#58)
#62Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Alvaro Herrera (#58)
#63Dann Corbit
DCorbit@connx.com
In reply to: Bruce Momjian (#60)
#64Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dann Corbit (#63)
#65Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#64)
#66Luke Lonergan
llonergan@greenplum.com
In reply to: Bruce Momjian (#65)
#67Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#64)
#68Hannu Krosing
hannu@tm.ee
In reply to: Tom Lane (#64)
#69Hannu Krosing
hannu@tm.ee
In reply to: Bruce Momjian (#65)
#70Mark Mielke
mark@mark.mielke.cc
In reply to: Luke Lonergan (#66)
#71Luke Lonergan
llonergan@greenplum.com
In reply to: Mark Mielke (#70)
#72Bruce Momjian
bruce@momjian.us
In reply to: Luke Lonergan (#71)
#73Luke Lonergan
llonergan@greenplum.com
In reply to: Bruce Momjian (#72)
#74Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#61)
#75Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#74)
#76Luke Lonergan
llonergan@greenplum.com
In reply to: Jim Nasby (#62)
#77Neil Conway
neilc@samurai.com
In reply to: Luke Lonergan (#76)
#78Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Andrew Dunstan (#75)
#79Hannu Krosing
hannu@tm.ee
In reply to: Andrew Dunstan (#75)
#80Noname
bob_jenkins@burtleburtle.net
In reply to: Luke Lonergan (#32)
#81Bruce Momjian
bruce@momjian.us
In reply to: Hannu Krosing (#79)
#82Dann Corbit
DCorbit@connx.com
In reply to: Bruce Momjian (#81)
#83Kenneth Marshall
ktm@it.is.rice.edu
In reply to: Noname (#80)
#84Ron Mayer
rm_pg@cheapcomplexdevices.com
In reply to: Tom Lane (#64)