Re: Sun Studio on Linux spinlock patch

From: Julius Stroffek <Julius(dot)Stroffek(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Sun Studio on Linux spinlock patch
Date: 2008-03-10 14:58:13
Message-ID: 47D54C85.9030307@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> This patch seems broken in a number of ways. Why are you removing
> -DLINUX_PROFILE, for example? Are you sure you don't need -D_GNU_SOURCE?
> And why add -DSUNOS4_CC, which is a Solaris-specific define (not that
> we seem to be using it anywhere anymore)? Do we really have to have a
> configure-time probe to detect this particular compiler?
>
You are right, removing -DLINUX_PROFILE seems to break profiling
on linux when compiled with sun studio.

I am not quite sure about the desired usage of _GNU_SOURCE and SUNOS4_CC
macros.
I would not expect _GNU_SOURCE to be defined when compiling sources with
Sun Studio.
I am not quite sure why SUNOS4_CC was supposed to be defined at all for
Solaris as well.
There are already enough macros defined -- "__sun" is defined on Solaris
by both Sun
Studio and gcc and "__SUNPRO_C" is defined by Sun Studio on both Linux
and Solaris.

Should we then remove _GNU_SOURCE and SUNOS4_CC macro definitions from
the build scripts since they are not used at all in the source code?

Configure-time probe for sun studio is required to create tas.s link to
the proper
file - sunstudio_x86.s (or sunstudio_sparc.s). This is done during a run
of a configure
script based on settings for the platform. Since these settings may vary
on the same platform
based on the compiler we need to have a configure-time probe.
> But I guess the *real* question is why anyone would care ... what
> benefit is there to using Sun's compiler on Linux?
>
Some tools bundled with sun studio might be used. I personally run into this
when I wanted to debug postgres with sun studio ide and wanted to compile
it first. It is based on netbeans, written in java so it needs a big
enough memory,
however it offers a great possibility to explore postgres internals during
a query execution, etc. It is especially useful, if you do not know what
you are
interested in during a compilation. I am using this to step over join
order search
plugins. I mostly use Solaris for this but I switched to linux for a while.

I wrote a blog with more details about this.
http://blogs.sun.com/databases/entry/debugging_postgresql_backends_on_solaris
There is also a screenshot showing how it looks in action
http://mediacast.sun.com/users/%7Ejulo/media/pgss_debugging.png

Also, there was some message a while back on pgsql-bugs from Len Zaifman
requesting
this as well.

Cheers

Julo

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Teodor Sigaev 2008-03-10 14:59:27 Re: Include Lists for Text Search
Previous Message Heikki Linnakangas 2008-03-10 14:53:32 Re: Very slow (2 tuples/second) sequential scan after bulk insert; speed returns to ~500 tuples/second after commit