From: John P Williams <jpw@zk3.dec.com>
To: Marco Alberoni <alberoni@sasib18.sasibrlw.bo.nettuno.it>
Subject: Re: Profiler for OSF
Date: 1998/04/24 [thread overview]
Message-ID: <3540CF7A.CF981647@zk3.dec.com> (raw)
In-Reply-To: 353C577F.4F65@sasib18.sasibrlw.bo.nettuno.it
> I need to profile some processes which link shared libraries
> at run time (procedures belonging to these libraries are loaded
> using "dl_open" calls).
> I work on a digital workstation. Tools on the machine like
> prof or gprof don't permit to profile such kind of processes.
> Which kind of tool (if existing) can I use?
If your workstation is an Alpha running Digital UNIX V4.0 or later,
and if you are actually calling the dlopen(3) runtime library routine,
there are a few options you can use. I do not understand Dirk Grunwald's
distinction between "shared libraries" and "modules". As far as I have
been able to find out, dlopen(3) only loads shared libraries, and
atom(1) is able to instrument shared libraries that are loaded with
dlopen(3) - you just need to name the libraries in the atom command.
However, I will be happy to be corrected.
1) Compiling the program with the -p flag (as I guess you did), you can:
setenv PROFFLAGS -all
setenv _RLD_LIST DEFAULT:lib1.so:lib2.so
as described in the prof(1) and loader(5) man-pages.
Setting PROFFLAGS to -all requests profiling of all shared libraries.
Setting _RLD_LIST to DEFAULT plus a list of the application's
libraries that are dynamically opened with dlopen(3) tells the
loader to load the shared libraries as if they had been linked
into the program with ld(1). So, if the application can tolerate
this change in when the libraries are loaded, this should help.
2) A command like
atom -tool hiprof -incobj lib1.so -incobj lib2.so app
or
atom -tool pixie -incobj lib1.so -incobj lib2.so app
should let you use hiprof with gprof to print a call-graph profile
or to use pixie with prof to print various instruction-count
profiles. The -incobj flags tell atom(1) to instrument the
specified shared libraries even if they are loaded with dlopen.
If the program does not use threads, the hiprof profile can be
enhanced with the atom -toolargs=-cputime option, which gives a
non-sampled profile in terms of CPU cycles used, instead of
instructions executed.
The atom command and its hiprof and pixie tools (etc) are in
the optional software development subsets in the Digital UNIX kit.
If you would like to use the latest versions of these tools on
Digital UNIX V4.0 or later, please send me email for information
on our field-test quality Advance Developer's Kit.
3) The Digital Continuous Profiling Infrastructure (DCPI) is currently
available as a free but licensed advance development distribution:
http://www.research.digital.com/SRC/dcpi/
It uses the Alpha processor's hardware performance counters to
profile a whole system at very low overhead and then analyze the
results off-line. Its profiles use a higher sampling rate than
does compiling with -p. It profiles all applications' uses of
each shared library, so you may need to ensure that only your
application is running while the profile is being collected.
Please send me email if you would like more information.
John P Williams, Digital UNIX Development Environment Group
next prev parent reply other threads:[~1998-04-24 4:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-21 4:00 Profiler for OSF Marco Alberoni
1998-04-21 4:00 ` Joel K. Gallun
1998-04-21 4:00 ` Dirk Grunwald
1998-04-22 4:00 ` Jeff Donsbach
1998-04-24 4:00 ` John P Williams [this message]
1998-04-24 4:00 ` Dirk Grunwald
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox