Delivering Binary Object Modification Tools for Program Analysis and Optimization. Digital Common Directory Interface, OM, Version 2, Atom, TruCiuster, Integrated Directory Services
Below you will find brief information for TruCiuster, eXcursion Version 2, OM, Atom, Integrated Directory Services, Common Directory Interface.
Advertisement
Advertisement
I
Linda S. Wilson
Craig A. Neth
NUchaei J. FUckabaugh
Delivering Binary Object
Modification Tools for
Program Analysis and
Optimization
Digital has developed two binary object modification tools for program analysis and optim ization on the Digital UNIX version 4.0 operating system for the Alpha platform. The tech nology origi nated from research performed at Digital's Western Research Laboratory. The
OM object modification tool is a transforma tion tool that focuses on postl ink optimizations.
OM can apply powerful intermodule and inter language optimizations, even to routines in sys tem li braries. Atom, an analysis tool with object modification, provides a flexible framework for customizing the transformation process to ana lyze a prog ram. With Atom, compilation system changes are not needed to create both si mple and sophisticated tools to directly diagnose or debug appl ication-specific performance prob lems. The linker and loader are enhanced to sup port Atom. The optim izations OM performs can be driven from performance data generated with the Atom-based pixie tool. Applying OM and Atom to commercial appl ications provided performance improvements of up to 1 5 percent.
H istorical ly on UNIX systems, optimization and pro gram analysis tools have been implemented primarily in the real m of compilers and r u n - time libraries. Such implementations have several d rawbacks, however.
For example, although the optimizations performed by compilers are effective, typical l�', they are limited to those that can be performed withi n the scope of a sin gJe source file. At best, the compiler can opti mize the set of files presented d u ri ng one compilation run.
Even the most sophisticated systems that save interme diate representations usually cannot perform opti mizations of cal l s to routines in system libraries or other libraries for which no sou rce or intermediate forms arc available . 1
The traditional UNIX performance analvsis tools, prof and gprof, req uire compiler support for inserting calls to pred efined ru n-time l i brary rou tines at the entry to each proced ure. The mon itor rou tines allow more user control over prof and gprof profi ling capa bil ities, but their usage requires modifications to the application source code. Because these capabilities are implemented as compilation options, users of the tools must recompile or, in the case of the mon itor rou tines, actually mod i fy their applications. For a l a rge applica tion, this can be an onerous requ i rement. Further, if the application uses libraries for w hich the source is unavai lable, many of the analysis capabilities are lost or severely impaired.
By comparison, object modification tools can per form arbitrary transformations on the executable program. The OM object modi fication tool is a trans formation tool that focuses on postli nk optimizations.
By pertcxming transformations after the link step, OM can apply powerful intermod u le and i nterlanguage optimizations, even to routines in system libraries.
Object transformations also have benefits in the area of program analysis. Atom, an analysis tool wirh object modification, provides a flexible framework tor cus tomizing the transformation process to analyze a pro gram. With Atom, compilation system changes are not needed to develop specialized types of debuggi ng or performance analysis tools. Appl ication developers can create both simple and sophisticated tools to directly diagnose or debug application -specific performance problems.
1 8 Digite1l TcchnicJI journal
Vol. 8 No. I 1 996
The OM and Atom technologies originated ti·om research performed at Digita l 's Western Research
Lab (WRL) in Palo Alto, California.' The software was developed into products by the Digi tal
Development Environment ( DUDE)
U N I X group a t
Digi ta l 's UNIX engi neeri ng site in Nashua, New
Hampshire. Both technologies are cu rrently shipping as supported products on D igital tor the Alpha platform :'
UNIX version 4.0
This paper first provides technical overviews tor both OM and Atom. An example Atom tool is presented to demonstrate how to use the Atom appli cation programming i nterface (API) to deve lop a cus tomized program analysis tool . Because OM and
Atom can be used together to enhance the etkctive ness of optjmi zations to :1pplication programs, the paper includes an overview regard ing the benefits of profi ling-directed optjmizations.
Subsequent sections discuss the product develop ment and tech nology transfer process for OM and
Atom and several design decisions that were made.
The paper describes the working relationship between
Wl�L and DUDE, the u til ization of the technology on
Independent Software Vendor (
ISV) applications, and the factors that drove the separate development strate gies for the two products. The paper concludes with a discussion about areas tor fu rther investigation and plans for future enhancements.
Technology Origins
Researchers at WRL investigating postlink opti miza tion techniques created OM in
1 992 '
Unlike compile time optirnizers, which operate on a single file, postlink optimizers can operate on the entjre executabk pro gram. For instance, OM can remove procedures that were linked into the executable but were never cal led, thereby red ucing the text spJce required by the pro gram and potential ly improving its paging behavior.;
Using the OM technology, the researchers fu rther discovered that the same bin ary code modi fication tech niques needed for optimizations could also be applied to the area of program instrumentation . I n tact, the processes o f instrumenti ng a n existi ng pro gram and generati ng a new execu table coul d be encapsu lated and a programmable interface provided to d rive the instr u mentation and analysis processes.
Atom evolved from this work -"·7
In 1 99 3 , WRL researchers Amitabh Srivastava and
Alan Eustace begJn planning with
DUDE engineers to provide OM and Atom JS supported products on the Digital
UNIX operating system . Different prod uct development and technology transfer strategies were used f(>r delivering the two tech nologies. The sec tion Product Development Considerations discusses the methods used and the f()rces that infl uenced the strategies.
Technical Overview of OM
OM performs transformations in three phases. It pro duces an i ntermediate representation , perf()rms opti mizations on thJt representation, and prod uces an executable i mage.
Intermediate Representation
In the fi rst phase, OM reads a special l y linked input til e that is produced by the linker, parses the object cod e, Jnd produces an i nrermed iJte representation of the instructions in the program . The flow informa tion and the program structure are maintained i n this representation.
Optimization ln tl1e optimization phase, OM performs various trans formations on the i n termediate representation created in the first phase. These transformations include
•
•
•
•
•
Tex t size reductions
Data size reductions
I nstruction and data reorganization to Improve cache behavior
I nstruction sched u ling and peephole optimization
User-directed procedure inlining
Text Size Reductions One type of text size reduction is the elimination of un used routi nes. Starting at the entry point of the image, OM exJmines the instruction stream for transfer-of-control instructions. OM fol lows each transter of control until it finds all reachJble routines i n the image . The remaining routines are potentiaUy unreachable and are candidates tor removal.
Before removing them, OM checks JJI candidates tor any add ress references. (Such references wi l l show up in the relocation entries for the symbol s . ) If no refer ences ex ist, OM em sJfdy remove the routine. A sec ond type of text size reduction is the elimination of most
GP
register reloading sequences.'·''
Data Size Reductions Because it operates on the entire program , OM performs optimizations that compilers are n ot able ro perform . One instance is with the addressJbiliry of globJl data. The general instruction sequence for accessing global data req uires the usc of a table of add ress constants ( the .litJ section ) and code necessary tor maintaining the cu rrent position in t.he table. Each entry in the address constant table is relo cated by the lin ker. Because OM knows the l ocation of
Jll global data, it c111 potentially remove the add ress entry while i nserting and removing code to more effi ciently reference the datJ directly. Removing Js many of the .lira entries Js possible l eaves more room in the data cache ( 0-cache) for the applicJtion 's global data.
Dig;ira.l
TcclllliGli
J o urml
Vo l .
R No.
I 1 ':196
1 9
20
This o pt im iz a t i on i s nor possible
:1t link time, b
c
c
1u s
c
the l inker c:tn neither i nsert nor re m ov e code .
Reorgan ization of the Image nizes :1 n i m; 1 g
B v deElll l t, O M re o r g a
c b1· reordering the routines in r h c i m ;1ge as determined by a depth -ti rst search of the routine order, starring at the main cnrrv poin t. I n the absence of profiling information , this orderi ng is usually better than the
In the linker's ordering. presence of p ro fi l in g kedback, OM pe rform
s
two more instruction-stream r e orck r i n gs: ( 1 ) r eorde r ing of r o uti n es based on b; 1 s i c block coums
;md
( 2 )
rourine o rd e r ing based on execution t i-cqu e n c l' .
OM first reorg;mizcs rou tines based on the basic block information co.l lected by a previous run of the i mage i n stru me nted with the Atom-b:tsed pixie tool. ON! L1ys rhe b asi c blocks to match the program's l i kely fl o II' of control . Branches are al ig ne d to match t he h;Hdll'are pred iction mechanism. As :1 resu l t,
OM packs together the most com mo1llv executed blocks. After b:tsic block reorganization, OM then reorders the routines in the image based on the cumul:ttivc basic block counts f()r each routi ne. The reorganized i m age i s ordered in a '''av similar to the wav the prof tool d isp!Jvs necu rion statistics. The reordering perr(mncd b1· OM is superior to that performed by cord, because cord docs 110t reorder basic blocks. cord is a U N IX profiling-directed opti mization utility that reorders pro ced ur e s in an exe cutable progrJm to cord(1) r e fer improve c1chc performance. The
e
n c e page on Digic1 l UNIX 1nsio n 4.0 describes the o p er a ti on of this urilir�· in more derai l .
Ela psed-time Performance
The o pt i m i z a ti o ns tllat
OM perf(>nm without p r o fi ling tCcd back can provid e elapsed -rime pedormancc i m p ro ve m ents o f u p ro
5 p e r c e n t. The teedback-dirccred optimizations can often pnwidc :11 1 <1dditioml i m p ro v ement of ti·om 5 ro lO p erce nt in elapsed time, t(lr a total i mprmTmcnr of up to 1 5 perce nt over an i m age not proc es sed by OM. S eve r a l commercial dJtabase progr;1 ms h:tve realized c l:t p s cdti me pe rfonnJn c e i mpro v e m e nt s ranging h·om 9 to l l percem with ked back.
Executable Image
Fi nally, i n the third phase, Olvl rc1ssembles
the tr;ms
f orm ed i ntermediate represcnc1rion into an exccu t;lhle i m a g e. ft pcrt(lrms relocation p r o ce ssi n g to reflect
Jny changes in data layo ut
or
program organization .
Technical Overview of Atom
The Atom tool ki t consists ofJ dril'er, an i nstrunKt1ta rion engine, Jnd an analysis run- time syste m . The
Atom engine performs transformations on an c :x c c u ta bl c program, converting it to an i n t
e
r med i a te torm. The e n gi ne then annotates rhc i n termcdi:ttc form and generates a nell', instru mcmed program .
Vol . 8 :-.i<>
I I Y96
The Atom engine is pr og r am m J b l e.
Atom a c c e p ts as i n p u t ;1 11 instrumentation rile and an :mal ysis ti le.
The i nstrumen tation fi le ddines the p oi nts at which the progrJm is to be instru mented and w lut an;1 l ysis routine is to be called
;1t uch ins t rume n t
J tion point.
The an;1 h·sis ti le (ddincci bttr in this section ) defines the anal ysis routines. Atom
<11iOII'S
i n s t ru m e nt ;Hion of a program at a very fi ne level of g ra nul arity. It supports instru mcnt:<tion before and after
•
•
•
•
•
Program execution
Shared l ibrarv loading
P ro ce du r e s
B:1sic blocks
I n d iv i d ual i nstructions
S u ppo r t i ng instru mcntJtion at these poi nts alloll's the development of a l l"i de
\";1riety of tools, a l l
11·irhin the Atom t
i
· am e
\\' ork.
Ex:�rnplcs
of' th e se tools are Gtche simulators, memory c hecking tools, and performance measu rcmenr tools . The h
· am
c
w o r k supports t h e cre ation of customi zed tools and can simpli
�
1ing d ec r ea se costs by rhe development of single-use tools.
The i nstrumentation tile is a
C language program that conrains calls to the
Atom
A P I .
The i ns tr u m c nt
; 1 tion ti le dcti nes anv arguments to be passed ro the analvsis routine. Arguments can instruction be register l'al ues, f i e lds, sym b ol names, addresses, ere . The instru mcntJtion the fil e is co m p ile d and then l i n ked with
Atom i n s tr u m e n t :t pertonn the i ns t rum
r
ion engine to c r e a te J tool to
e
nta t i on on ;1 target progr:1 m.
The
;malvsis file contains definitions ofrhc routines that arc called from the instru mentation p o i nts in rhe target program . The analysis rou tines record evenrs o r
process rbc
arguments that arc passed from
rhc
i n
s
t ru mentation points.
Bv co m
· enr ion , the instru me ntation and an:1 l vsis tiles arc n:<1ncd \Yi th the suffi xes inst.c and anal.c, r e s p e c t i v el v. Atom is i m·oked ;1s follows to crc:nc an i nstrumented e x ec u t abl e
:
% a t o m p r o g r a m t o o l . i n s t . c t o o l . a n a l . c
The atom co m m J n d is a d ri,·er that invokes the compiler :tnd linker to gencL1te the instrumented progra m . The rive steps of this process are
I . Compil e rhe instru mentJtion code .
2 . Link the instrumen tJtion code with t h e Atom i nsrrumcn t;ltion engi nc ro create an i ns rr u m e n ta tion rool .
3.
Compile the an a lysis code.
4. Lin k the :1 11:1lvsis cod e with the Atom Jnah·sis run ti me system, using the
U N IX ld tool with the
-r o pt i o n so the object may be used as inp u t to another link.
5 . Execute the instrumentation tool on the target program, providing rhe linked analysis cock as an argument.
T h e final step prod ucts an i nstrumented program l i n ked with th<:: analysis cod e . Figure l shows th<:: chang<::s i n memory l ayou t between the original pro gram and the instru ment<::d program.
An Example Atom Tool for Memory Debugging
The following d iscussion of an example Atom tool demonstrates how to usc the Atom
A P I to develop a customized program analysis too l .
A common development problem is locating the source of a memory overwrite. Figure 2 shows a con trived example program i n which the loop to ini ti�1lize an array exceeds the array boundarv and overwrites a
LOW
MEMORY
HIGH
MEMORY
STACK
READ-ONLY DATA
EXCEPTION DATA
- TEXT START
:
STACK
READ-ONLY DATA
EXCEPTION DATA
PROGRAM TEXT
ANALYSIS TEXT
INSTRUMENTED
PROGRAM TEXT
PROGRAM
TEXT
ADDRESSES
CHANGED
N E W DATA
START
-----........__
ANALYSIS gp -...__
ANALYSIS DATA
I
N I
T
IALIZED
/
OLD DATA
START
�
ANALYSIS DATA
UNINITIALIZED
(SET TO 0)
PROGRAM DATA
INITIALIZED
-- PROGRAM gp PROGRAM DATA
I N ITIALIZED
PROGRAM DATA
U N I N ITIALIZE D
HEAP
:
U N I NSTRUM ENTED
PROGRAM LAYOUT
PROGRAM DATA
U N I N ITIALIZED
HEAP
:
I NSTRUMENTED
PROGRAM LAYOUT
PROGRAM
DATA
ADDRESSES
UNCHANGED
Source · A. S rivastava and A. Eustace, '"ATOM: A System lor Building Customized Program Analysis Tools,'"
Proceedings of the SIGPLAN
'94
Conference on Programming Language Design and Implementation,
Orlando, Fla. (June 1 994). This paper is also available as Digital's Western Research Laboratory
(WRL) Research Report 94/2.
Figure 1 tvkmon· Lavout of I nstru mented Programs
1
2 l o n g n u m b e r s [ 8 J
=
{ Q } ; l o n g * p t r = n u m b e r s ;
3
4 m a i n ( )
5
{ i n t i ; 6
7
8
9
1 0 } f o r C i = O ; i < Z S ; i + + ) n u m b e r s [ i ) = i ;
Figure 2
ExJtnplc Progmm ll'ith Memory Overwrite
I * T h i s p o i n t e r i s o v e r w r i t t e n * I
I * b y t h i s a r r a y i n i t i a l i z a t i o n . * I
Di�irJ[ Ted111ical Journal
Vol . � No. l 1 996 2 1
poi nter v;1riabJe. I n this cJse, the initialization o f the rzumhers array detl.ned i n line I overwrites the con tents of the variable ptr ddined in l ine 2. This type of problem is often difticulr :md rime-consuming to locate with traditional debugging tools.
Atom can be used to develop a simple tool to loGlte the source of the overwrite . The tool would instr u ment each store i nstruction in the program a n d p:1ss the effective address of the store instruction and the value being stored to an Jnalysis routi ne. The ::m::dysis routine wou ld determine if the effective address is the address being traced and, if so, generJte a diJgnosri c .
The i nstru mentati on :md ;m ah'sis files f o r the mem_debug too l
Jre shown l ll
Figure 3 .
I nstrument! nit( ) registers the analysis routines with the Atom i nstrumentation engine a nd specifies rh::�t calls to the get_Jrgs( ) and open_ log( ) routines be inserted before the progrJm begins executing. A cal l ro the close _ log ( ) routi ne is dicr;ned when the pro tion engine calls I nstrument I nit( ) exactly once.
The Atom i nsu·umenrarion engine c1lls the
I nstrument( ) routjne once tar each executable objccr in the progr:lln. The routine instruments e::�ch store instruction that is not a stack opcrarjon wirl1 a c
:t l l to the analvsis routine mem_srore(
) . E;Kh call to the routine prO\;ides the address ofrhe store instruction, the target address of the store instruction, the value to be srorcd, and the file name, procedure n:�mc, and line nu mber.
The open_log( ) and close_Jog( ) analysis routines ::�rc selfexplanatory. The messages cou ld hJve been wrirren to the standard output, bccJusc, in this exJmple, they would not have interfered with the program output.
The ger_:�rgs( ) routine re;His the va l u e of the
MEM Df:JJI JG ;I NGS environ ment variable to obt:�in the datJ
-; ddress
� o be traced . The tool could luve been written to accept arguments from the command l i ne using the -too largs swi tch. The instrume n t
J tio n code would then JXISS the arguments to the analysis rou tine.
In the GlSe of this tool , using the environment v:�ri;1 bk to pass the arguments is bcneticial because the pro gram does not have to be reinsrrumented to tra c e
J new :tddress.
The mem_srore( ) routine is c1l led from each store instruction sire that was i nstrum e nted . If the tJrgct address of the store operation docs not march the trace add ress, the routine simply returns. If there is a matc h ,
J diagnostic is logged that gives i n fimnJtion about the location of the store.
To demonstrate how this tool would be used, sup pose one has determined b�, debugging that the vari able ptr is being overwritte n . The nm comma nd
IS used to determine the address ofptr as follows:
% n m - B p r o g r a m I g r e p p t r
O x 0 0 0 0 0 1 4 0 0 0 0 0 c 0 G p t r
I nstrument the program with the mem_debug tool .
22 Digit�!
Tcchnicll )oum�l
Vol . 8 No. l
1 996
% a t o m p r o g r a m m e m_d e b u g . i n s t . c m e m_d e b u g _ a n a l . c
Set the iv!Uv!_DtBUG_A NCSenviron ment v:�riable with the address to trace .
% s e t e n v M E M _D E B U G _A R G S 1 4 0 0 0 0 0 c 0
Run the instrumented program ,
% p r o g r a m - a t o m and view the log file .
% m o r e p r o g r a m . m e m_d e b u g . L o g
T r a c i n g a d d r e s s O x 1 4 0 0 0 0 0 c 0
A d d r e s s O x 1 4 0 0 0 0 0 c 0 m o d i f i e d w i t h \ v a l u e O x 1 6 : a t : O x 1 2 0 0 0 1 1 c 4 P r o c e d u r e : m a i n \
F i l e : p r o g r a m _ c L i n e :
9
Using this si mple Atom too l , the location of a mem orv overwrite can be detected q uickly. The instru m
� n ted program executes at nearly normal speed.
Tr:�d itional debugging methods to detect such errors are much more ti me-consuming.
Other Tools
An Jrca in which Atom capabilities have proven particu larly powcrfi.d is for hardware modeling and simulation .
Atom has been used as
:t te:�chi ng tool in university courses to trai n srudenrs on h:�rdware and operating sys tem design. Moreover, Digiol hardware designers have de\'eloped sophisticated Atom tools to evaluate designs tor ne\\' implementations oftbe Alpha cl�p.
The A tom tool ht contains 1 0 example tools that demonstrate the capabilities of this technology. The examples i nclude a branch pred iction tool, which is useful t(lr compiler designers,
:t procedure tr:�cing tool, which can be useful in following the How of un bm i li:�r code, and J simple cache simulation too
l
.
Atom Tool Environments
A.tulysis of certain types of programs can requi re use of speci:�lly designed Atom tools. for instance, to analyze a program thJt uses POSIX threads, an Atom
to
ol to hand le thre:�ds must also be designed , bec1use the analysis routines will be cal led from the threads in the appl.ic:�rion program. Therd(>re, the analysis rou ti nes need to be reentrant. They may also need to synchro nize access to data that is shared among the threads or manage cbta for i ndividual threJds. The thre
:� d m:tn agemenr in the analysis routines adds overhead to the execution time of the instrumented progr:� m; th1s overhe a d is not necessary for a non th readed progr:�m.
To effectively su pport both threaded and nonrhreaded programs, tWO rustinct versions of the same Atom tool. need to coexist. Designers developed tbe concept ot tool environ ments to add ress the issues of providing multiple versions of an Atom tool .
I *
* m e m_d e b u g _ i n s t . c
*
I n s t r u m e n t a t i o n f o r m e m o r y d e b u g g i n g t o o l
* T h i s t o o l i n s t r u m e n t s e v e r y s t o r e o p e r a t i o n i n a n a p p l i c a t i o n a n d
* r e p o r t s w h e n t h e a p p l i c a t i o n w r i t e s t o a u s e r - s p e c i f i e d a d d r e s s .
* T h e a d d r e s s s h o u l d b e a n a d d r e s s i n t h e d a t a s e g m e n t , n o t a
* s t a c k a d d r e s s .
*
* U s a g e : a t o m p r o g r a m m e m_d e b u g . i n s t . c m e m_d e b u g . a n a l . c
*
* I
# i n c l u d e < s t r i n g . h >
# i n c l u d e < c m p l r s l a t o m . i n s t . h >
I *
* I n i t i a l i z a t i o n s :
*
* r e g i s t e r a n a l y s i s r o u t i n e s d e f i n e t h e a n a l y s i s r o u t i n e s t o c a l l b e f o r e a n d a f t e r p r o g r a m e x e c u t i o n
*
* g e t _ a r g s ( ) r e a d s e n v i r o n m e n t v a r i a b l e M E M D E B U G A R G S f o r a d d r e s s t o t r a c e
* o p e n_ L o g ( ) - o p e n s t h e L o g f i L e t o r e c o r d o v e r w r i t e s t o t h e s p e c i f i e d a d d r e s s
* c l o s e_ L o g ( ) c l o s e s t h e L o g f i l e a t p r o g r a m t e r m i n a t i o n
* m e m s t o r e ( ) c h e c k s i f a s t o r e i n s t r u c t i o n w r i t e s t o t h e s p e c i f i e d a d d r e s s
* I v o i d I n s t r u m e n t i n i t C i n t a r g c , c h a r * * a r g v )
{
A d d C a L L P r o t o ( " g e t _a r g s ( ) " ) ;
A d d C a L L P r o t o ( " o p e n_ L o g ( c o n s t c h a r * ) " ) ;
A d d C a L L P r o t o C " c L o s e_ L o g ( ) " ) ;
A d d C a L L P r o t o C " m e m_ s t o r e C V A L U E , R E G V , L o n g , c o n s t c h a r * , c o n s t c h a r * , i n t ) " ) ;
A d d C a L L P r o g r a m C P r o g r a m B e f o r e , " g e t _a r g s " ) ;
A d d C a L L P r o g r a m ( P r o g r a m B e f o r e , " o p e n_ L o g " , b a s e n a m e C C c h a r * ) G e t O b j N a m e C G e t F i r s t O b j ( ) ) ) ) ;
A d d C a L L P r o g r a m C P r o g r a m A f t e r , " c l o s e_ l o g " ) ;
}
I *
* I n s t r u m e n t e a c h o b j e c t .
* I
I n s t r u m e n t ( i n t a r g c , c h a r * a r g v [ J , O b j * o b j )
{
P r o c
B l o c k
I n s t i n t
* p r o c ;
* b l o c k ;
* i n s t ; b a s e ;
I * b a s e r e g i s t e r o f m e m o r y r e f e r e n c e * I
I *
* S e a r c h f o r a l l o f t h e s t o r e i n s t r u c t i o n s i n t o t h e d a t a a r e a .
* I f o r ( p r o c
=
G e t F i r s t O b j P r o c C o b j ) ; p r o c ; f o r ( b l o c k
=
G e t F i r s t B L o c k ( p r o c ) ; p r o c b l o c k ;
=
G e t N e x t P r o c ( p r o c ) ) { b l o c k
=
G e t N e x t B l o c k C b l o c k ) ) { f o r ( i n s t
=
G e t F i r s t i n s t C b l o c k ) ; i n s t ; i n s t
=
G e t N e x t l n s t ( i n s t ) ) {
I *
* I n s t r u m e n t m e m o r y r e f e r e n c e s . S k i p $ s p b a s e d r e f e r e n c e s
* b e c a u s e t h e y r e f e r e n c e t h e s t a c k , n o t t h e d a t a a r e a .
* M e m o r y r e f e r e n c e s a r e i n s t r u m e n t e d w i t h a c a l l t o t h e
* m e m_ s t o r e a n a l y s i s r o u t i n e . T h e a r g u m e n t s p a s s e d a r e
* t h e t a r g e t a d d r e s s o f t h e s t o r e i n s t r u c t i o n ,
* t h e v a l u e t o b e s t o r e d a t t h e t a r g e t a d d r e s s ,
* t h e P C a d d r e s s o f t h e s t o r e i n s t r u c t i o n i n t h e p r o g r a m ,
* t h e p r o c e d u r e n a m e , f i l e n a m e , a n d s o u r c e L i n e f o r t h e
* P C a d d r e s s .
* I
Figure 3
Instrumentation and Analysis Code tor the mem_debug Tool
Digital Technical Journal
Vol. 8 No.
I 1 996 23
i f ( l s 1 n s t T y p e ( i n s t , I n s t T y p e S t o r e l l b a s e
=
G e t l n s t l n f o ( i n s t , I n s t R B l ;
{ i f ( b a s e
! =
R E G S P l
{
A d d C a l l l n s t ( i n s t , I n s t B e f o r e , " m e m_ s t o r e " ,
E f f A d d r V a l u e ,
G e t l n s t R e g E n u m ( i n s t , I n s t R A l ,
I n s t P C ( i n s t l ,
P r o c N a m e ( p r o c l ,
P r o c F i l e N a m e ( p r o c l ,
( i n t l l n s t l i n e N o ( i n s t l l ;
}
}
}
}
}
}
I *
* m e m_d e b u g . a n a l . c a n a l y s i s r o u t i n e s f o r m e m o r y d e b u g g i n g t o o l
*
* U s a g e : s e t e n v M E M D E B U G A R G S h e x a d d r e s s b e f o r e r u n n i n g
* t h e p r o g r a m .
* D i a g n o s t i c o u t p u t i s w r i t t e n t o p r o g r a m . m e m_ d e b u g . l o g
* I
# i n c l u d e < s t d i o . h >
# i n c l u d e < s t d l i b . h >
# i n c l u d e < s t r i n g . h >
# i n c l u d e < s y s l t y p e s . h > s t a t i c F I L E * l o g_ f i l e ; s t a t i c c a d d r t t r a c e _a d d r ;
I * O u t p u t f i l e f o r d i a g n o s t i c s * I
I * A d d r e s s t o m o n i t o r * I
I *
* C r e a t e L o g f i l e f o r d i a g n o s t i c s .
* I v o i d o p e n_ l o g ( c o n s t c h a r * p r o g n a m e l
{ c h a r n a m e [ 2 Q O J ; s p r i n t f ( n a m e , " % s . m e m_d e b u g . L o g " , p r o g n a m e l ; l o g_ f i l e
= f o p e n ( n a m e , " w " l ; i f <
! l o g _ f i l e l
{ f p r i n t f ( s t d e r r , " m e m_d e b u g : C a n ' t c r e a t e % s \ n " , n a m e ) ; f f l u s h ( s t d e r r l ; e x i t ( 1 l ;
} f p r i n t f ( l o g_ f i l e , " T r a c i n g a d d r e s s O x % p \ n \ n " , t r a c e _a d d r l ; f f l u s h ( l o g_ f i l e l ;
}
I *
* C l o s e t h e L o g f i l e .
* I v o i d c l o s e_ l o g ( v o i d l
{ f c l o s e < l o g_ f i l e l ;
}
I *
* G e t a d d r e s s t o t r a c e f r o m t h e e n v i r o n m e n t .
* I v o i d g e t _a r g s ( v o i d l
Figure 3
( cont inued )
24 Dig:inl Tcchniul journal
Vol. ll No. J 1 996
{ c h a r * a d d r ; i f ( l ( a d d r
= g e t e n v ( " M E M _D E B U G_ A R G S " ) ) )
{ f p r i n t f ( s t d e r r , " m e m_d e b u g : s e t M E M D E B U G A R G S t o h e x a d d r e s s \ n " ) ; f f l u s h ( s t d e r r ) ; e x i t ( 1 ) ;
} t r a c e a d d r ( c a d d r t ) s t r t o u l ( a d d r , 0 , 1 6 ) ;
}
I *
* T h e t a r g e t a d d r e s s i s a b o u t t o b e m o d i f i e d w i t h t h e g i v e n v a l u e .
* I f t h i s i s t h e a d d r e s s b e i n g t r a c e d , r e p o r t t h e m o d i f i c a t i o n .
* I v o i d m e m s t o r e ( c a d d r t u n s i g n e d L o n g c a d d r t c o n s t c h a r c o n s t c h a r u n s i g n e d
{ t a r g e t _ a d d r , v a l u e , p c ,
* p r o c ,
* f i l e ,
L i n e )
I * A d d r e s s b e i n g s t o r e d i n t o * I
I * V a l u e b e i n g s t o r e d a t t a r g e t _ a d d r * I
I * P C o f t h i s s t o r e i n s t r u c t i o n * I
I * P r o c e d u r e n a m e * I
I * F i L e n a m e * I
I * L i n e n u m b e r * I i f ( t a r g e t _a d d r t r a c e _a d d r )
{ f p r i n t f ( L o g _ f i l e , " A d d r e s s O x % p m o d i f i e d w i t h v a l u e O x % L x : \ n " , t a r g e t _a d d r , v a l u e ) ; f p r i n t f ( L o g _ f i l e , " \ t a t : O x % p " , p c ) ; i f ( p r o c
! =
N U L L )
{ f p r i n t f ( L o g _ f i l e , " P r o c e d u r e : % s p r o c > ; i f ( f i l e ! = N U L L ) f p r i n t f ( L o g_ f i l e , " F i l e : % s
} f p r i n t f ( L o g _ f i l e , " \ n " ) ; f f L u s h ( L o g_ f i L e ) ;
L i n e : % d " , f i l e , L i n e ) ;
}
}
Figure 3
(continued )
Tool environments accommodate seamless integra tion of specialized versions of tools into the Atom tool kit. They pro\'ide a means for extending the Atom ki t.
This f:tcility allows the addition of specialized Atom tools bv Digital's l ayered product groups or by cus tomers, while maintaining a consistent user i n terface.
The versions of the Atom tools hi prof, pixie,
Jnd
Third Degree that support POSIX threads are pro vided as a separate environ ment. hiprof is a perfor mance analvsis tool that collects data similar ro but with more precision than gprof. pixie is a basic block profi ling tool . Third Degree is a memory leak detec tion tool .
The fol lowing command invokes tbe Atom-based pixie tool for use on a nonthreaded program:
% a t o m p r o g r a m - t o o l p i x i e
The fOllowing comm:111d invokes the version of the pixie roo] that supports threaded programs:
% a t o m p r o g r a m - t o o l p i x i e - e n v t h r e a d s
Tools for orber specialized environments can be provided by defining a new environment name. For example, Atom tools written to work with a language specific run- time environment can be added to the
Atom tool kit by selecting an environment name for the category of tools. Similarly, tools designed to work on the kernel could be col lected into Jn environment.
The environ ment name is used in the names of rhe tool's instrumentation, analysis, and description files.
The description fi le for a tool provides the names of the instrumentation Jnd analysis fi les, as well as spe cial i nstructions for compiling and linki n g the tool .
For example, the pixie description tile tor threaded programs is named pixie.threads.dcsc. lt identifies the th readed versions of the pixie instrumentation and analysis ti les. The Atom driver builds rhe name of the description fi le from the argu ments to the
-tool and
-env switches on the command line. The contents of the description tile then d rive the subsequent steps of the build process.
Tool environments can be added without modifica tion ro the base Atom tech nology, thereby providing extensibil i ty to the tool kit while maintaining a consis tent i nterface.
Compact Relocations
Atom i nserts code into the text of the program , thus changing the location of routines. Atom req uires that relocation
intormatjon
be retained i n the
Digital Tedlllicll )oumJI
Vol. S
No. l 1996
2 5
executable image created bv the l i n ke r. This a llows
Atom to properly perform r-elocations on the insrru men ted executable.
Duri ng the normal process of linking, the relocation en tries stored in object files are climin;ltcd once thcv have been resolved. Because it effecrivdv rel i n ks th
� executable, Atom must have access to rl
; e relocation information .
Consider, tor example, an applic1tion that invokes a function through a statically initialized fi.mction pointer vJriablc, as shown in the followi ng code segment: v o i d f o o ( i n t a , i n t b )
{
} v o i d ( * p t r _ f o o ) ( i n t , i n t ) f o o ; v o i d b a r ( )
{
( * p t r_ f o o ) ( 1 , 2 ) ;
}
The Jdd ress of fu nction foo is stored i n rhc memory location referenced by the
ptr_foo
variable . When
Atom instruments this application, the add ress of
ji.;o
will change, and Atom needs to know to update the contents of the memorv location referenced bv
prr_jbo.
This is possible only i rhere is J relocation n:cor
� i pointing at this memory location. Addjng compact relo cations to the executable file solves this problem .
Compact relocations are smaller rh:m rcguL\l· re lo cations tor two reasons. First, the Atom system docs not req u i re all the information in the regu lar reloca tion records in order to instrument Jn executable.
Atom changes only the layout of the text segment, so relocation records that describe the data segments are not needed . Second, the remJining relocations can often be predicted by analyzing other p:u·ts of the cxecutJble file. This property is used to store a compact torm of the remai ning relocuion records.
Since compact relocation records arc represented in J difrerent form tban regular relocations, thev are stored in the .comment section of the object ti le .rather than in rhc normal relocation area.
Profiling-directed Optimization
OM and the Atom- based pixie tool can interoperate usi ng profiling-d irected optim i zation . The Atom based pixie too] is a basic block protilcr th;lt provides execu tion cou nts for each basic block when rhe pro gra m is r u n . The execution cou nts are then used as input to OM for performing optimizations on the exe cutJble that are d ri ven from actual run-time pert()r mancc data .
As an example, the fol l o\\'ing steps would be perkm11ed to utilize p rofi l ing-directed optimizations with
OM : l . % c c
- n o n _ s h a r e d - o p r o g r a m * . o
2 . % a t o m - t o o l p i x i e p r o g r a m
3. % p r o g r a m . p i x i e
4. % c c
- n o n _ s h a r e d - o m
- W L , - o m_i r e o r g_ f e e d b a c k , p r o g r a m * . o
I n step l , a nonsharcd version of the program is built. In step 2, the Atom- based pixie tool i nstru ments the progra m . Step
2 p roduces progra m . pixie and program .Addrs files. Step 3 resul ts in the exe cution of the instrumented program to generate a progra m . Counrs file. This ti le contains an execution cou nt for each basic bl ock in the progra m . The last step provides the basic block profi le as input to O M .
O M rearranges the text segment o f t h e program such that rhc most freq uently executed basic blocks and proced ures are placed in proximity to each other, rhus improving the instruction cache ( I -cache) hit rate.
Product Development Considerations
Bringing the OJ\11 and Atom tec hnologies from the lab oratory into use on current Digital UNIX production systems required lrcquem communication a nd coord i nation between WRL and DUDE engineers working on opposite coJsts of the U.S. The success of both proj ects depended upon establishi ng and mJintaining an atmosphere of cooperation among the engineers at the two locations. Common goals and criteria for bringing tJ1e technology to prod uct supported the teams d uring de,·elopment and planning work.
Among the product development consid erations tor OM and Atom were l . The products must Jdd ress a busi ness or customer requirement.
2 .
The products must meet customer expectations of features, usability, qu ality, and pertormance .
3.
Engineering, qu;�lity assurance, and documentJtion resou rces must be identified to ensure that the products could be enh;1tlced , updated to operate on ne\1' pl atform rclcJses, and supported throu gh out their l i fe cycles.
4.
The products must be released at the appropriate ti mes. Releasing J prod uct too early could resu lt in high support costs, perhaps at the expense of new development. Re leJsing a prod uct too late could compromise Digital's ability to leverage the new tech nology most effective ly.
Product Development and Technology Transfer
Process for OM
As part of their research and development et!orts,
WR.L engineers applied OM to large applications.
Researchers and Digital engi neers Jt ISV porti ng bbo ratories worked together to share intormation and to diagnose the performance problems of programs i n
26
Digit:ll
TedlJlical )ourn:ll
Vol.
8
No. I 1 9\!6
use on actual prod uction systems, such as relational database and
CAD applications. This cooperative eftort helped engineers determine the types of opti mizations that would benetit the broadest r:1nge of applications. In addition , the engineers were able to identity those opti mi zations that would be usefu l to specitic classes of applications and nlJke them switch-selectable through the OM i nterbce. The per tormann: improvements achieved on ISV :1ppl ications en:1bled OM to meet the criteria for :1ddressing cus tomer needs.
AJ though WRL researchers also :1pplied
OM to the
SPEC bench mark suite to me:1sure pedormance im provements, the primary tocus of the OM tech nology development was to provide perf(xmance im provements for applications currently in widespread use by the Digital U N I X customer bJSt:. With the focus of performance i mprove ments on l arge cus tomer appl ications,
OM satisfied a prominent Digital busi ness need tor inclusion in the D igital U N I X devel opmellt environment.
Engineers d iscussed the limitation that OM did not support shared libraries and the programs that used them . In this respect, the technology would not meet the expectations of all customers . Many ISV :1pplica tions and other performance-sensitive programs, how ever, are built nonshared to improve execution times.
Engi neers determined that the bendits tor this class of application outweighed this limitation of
OM, and, theref(xe, the limitation did not prevent moving forward to develop the prototype in to J prod uct.
Developers recognized the risks and support costs associJted with shipping the prototype, yet again decided that the proven benefits to existing applica tions outweighed these factors.
Because of the pressing business and customer needs tor this technol ogy, DUDE and WRL engineer ing concurred that
OM should be provided as a ful ly su pported component i n Digital U N I X version 3 . 0 .
Full prod uct development comm itmenrs from D U DE engineering, documentation, and quality assurance could not be made tor that release, however. Nte r discussion, WRL provided technical support :1 n d extensions to
OM t o address this need . D U D E engi neering agreed to provide consul ting support to WRL researchers on object tile and sym bol table f(xmats and on eval uations of text and data opti mizations.
The next issue the engineers faced was how to inte grate
OM i nto the existing development environment.
They evaluated three approaches.
The first approach was to make
OM a separate tool directly accessible to users as /usr/bi n/om . Thus, an application developer could utilize
OM as a separate step during the build process. This approach ottered two advantages. First, it was similar to the approach used to achieve the present internal use of OM and would require kw additional mod ificatjons to the
Digital U N I X development environment. The second advantage was that Atom and OM could be more easily merged i nto one tool since their usage would be similar. This merging would provide the potential efficiencies of a single stream of sources for the object modification technology.
A major disadvantage of this approach was that it put additional burden on the application developer.
OM req uires a specially linked input file p roduced by the linker. This intermediate input file is not a com plete executable nor is i t a p ure OMAGIC fi le.10 This approach would require customers to add and debug additional build steps to usc
OM on their applications.
The WRL and D U D E engineers agreed that the user complexity of this approach would be a significant bar rier to user acceptance of
OM.
The second approach was to change the compiler driver to i nvoke OM for linking an executable. With this approach, a switch would be added to the com piJer d river. If this switch was given , the driver would call /usr/libjcmpl rs/cc/om instead of the system linker to do the tina! link.
This approach had the advantage of reducing the complexity of the user interface for building an applica tion with
OM.
A developer cou ld specifY one switch to the compiler driver, and the driver would automaticaJiy invoke OM. This would al low a developer to introduce feedback-directed optimizations into the program by simply reli nking with the profiling information , thus making OM easier to use and less error-prone.
The disadvantage of this second approach was that the complex symbol resolution process in the linker wou l d need to be added to OM. The process of per forming symbo l resolution on Digital
UNIX
operating systems is nontrivial . There are special rules, boundary conditions, and constraints that the li nker must u nder stand. OM was designed to modifY an already resolved executable, and any problems introduced from adding linker semantics would discourage its use. Also, dupli cating l i n ker capabilities in
OM would req uire addi tional overhead in mai ntai ning both components.
The advantages and disadvantages of the second approach motivated the development of a third approach. The compiler drive r coul d be changed to invoke
OM during a postl ink optimization step. As in the second approach, a switch from the developer would trigger the invocation of
OM; however,
OM would be run atter the linker had performed symbol and li brary resolu tion.
The third approach is the one currently used . This method maintains separation between the l i n ki ng and optimization phases. When directed by the
-om switch, ld prod uces a specially linked object that will be used as input to OM. The compiler driver supplies this object as input to OM when the li nking is completed .
Digiral
Tc::d111ic�l )ou rn.1l
Vol .
8 No. l 1996
27
2K
The WRL : md D U D E engineers tound rh:n this fu nctional scpar�1tion also i mproved the cfricicnc1· of the development cfr(>rrs between WRL and DUi) E .
The sepa ration permitted concurrent Wl\L develop ment on OM and D U D E development on ld, with minimal inrerkrcncc. This approach Jllowcd more development ti me ro be dedicated to reclmic1l issues rather than de:- d i n g ll'ith sou rce manJgemcnt :111d i nte gration issues.
D U D E engineers :tddcd the OJ'vl sources into the
Digi tal U N I X development p updates
o
ol and intcgLncd
ti-om
WRL. WRL assu med responsibi lity t()r testing OM prior to providing source up(btes. As pre viously outlined, D U D E enginee rs i ntegrated su pport tc)r OM into the existi ng de1·e lopmenr Cill'iron menr tools tor the i nitial release.
Because of pro1·en pcrt()rmance impro1·uncnrs on
I SV applications, committed engineering cth>rts lw
WRL,
.__,
' b nccrs judged the technologv mature enough tc>r rele�1sc on prod uction systems. Efficient development str:ltc gies enabled Digital to rapidly turn this leadi ng-edge t echnology i nto a prod uct that bendits an import:mt segment of the Digital U N I X c ustomer b�1se .
W R.L com in ued engineeri ng support tc>r 0Jvl through the Digital U_:"\!I X 1-ersion
3.0
:md 3 . 2 releases.
Responsibilit1· t(>r the teclmolot,'\' gr:1du:�llv shifted ti·om WRL to D U D E m
·er the course of these releJscs.
Cu rrently, D DE fu llv supports �md en h�1 11ces OM while WlU. comi nues to provide consultation on the tech nology :tnd input for ti.1ture improv e m c ms.
Product Development and Technology Transfer
Process for Atom
W IU_ deploved c1rlv 1crsions of the Atom tool kit J t intern a l D igit:tl sites, I S V port i ng laboc1tories, and u n i,·ersiries, thus :�! l owing de1·cl opers to cxperimem with and evaluJte the Atom API. The cJrlv JV<l iLlbiJitl' of the tool kit promoted use of the Atom 'techno log).'·
User feedback :md requests for katu res helped the engi neers to more qu icklv and etketil'elv de1·elop J robust technologv fi'Oill the prorotl·pe .
Engineers thmughout Digital recogn i ze d Atom JS a unique and use fu l tec hnologv. Atom 's A P I , "·ith instrume nt:ttion <1 11d �lll<llysis eapJbilities doll'n to the instruction leve l , increased the power Jnd diversity of tools that could be nc::�red for soti:w;,rc :tnd h:lrdwJre development. Hardware development tc1ms used
Atom to sim u l ate the perto n n a nce of new Alpha impleme ntations. Software develope rs crc:�ted and sh:1red Atom tools t(>r debugging ;,nd mosuring pro gr�1111 ped(mn�lncc . The ,·:�lue of the Atom tec hnologv in soil-ing applicnion de,·elopment problems prm·ided the business justi fic a t ion t(>r developi ng the tcclmol ogy into a prod uct.
The prototl-pc version of Atom had se1-erJl
I i m i ta rions.
•
•
•
•
Like OM, the prototype version of Atom worked only on nonsh:1red applications. A prod u ction version of Atom would require support tor cJII sh�lred programs and si1Jred l i braries, since, bv debulr, programs arc built as cdl-sharcd program
�
.
A 1·iablc Atom prod uct ofkring needed to sup port these npes of progr::�ms, i n �1dd irion to non shared programs.
Progr::uns needed to be rel i n ked to rctJin relocatjon i n f(mn:ttion bd(>J'C Atom cou ld b e used . This add i rionJI build step impaired the usJbil i tl' ofAro m .
T h e Atom prototvpe p erform e d p oorly because it consu med a l�1rgc amoullt of memorv. 1VI uc h of the d ar:� collected about an excc u t:� ble t()r opti m i zation purposes 11·.1s not needed
[()r progr:t1n :tna ll·sis rr�l nst(mn<l rions .
The Atom API req u i red exte nsive d esign :md de,·e l opmenr ro support cJll-sh:-�rcd progr:� ms and sh:t red l i br�1rics.
The e ngineers decided to
aile)\\·
the OM and Atom te ch n
o
logie s to d il'erge so that the d i fkring requ i re mellts t()r optimi z ation and progra m Jn:�ll·sis cou l d be more etkctil'l·l l· :tddrcssed in eac h component.
Bec:�usc the cost of supporti ng :-� rcJuse ofrhe Atom proto t ype 1\'0uld have been high , WIU , a11d D U D E engi neer i n g developed a str:�tcgy tclr simultaneously releasi ng the Atom p rotot y pe while tC>C using engine e r
ing efforts on developing the prod uction version. An
A rom Ad1·� m c c d Dc1T iopmenr Kit ( A D K ) II' J
S released ll'irh Digit�1l U N I X 1·ersion 3 . 0
as
the initial step of the stra reg1·. The ADK prOI'ided customer <lCcess to the technologv 11 ith l i m i ted su ppon. Engineers 1 ic11ni the lack ofsuppmt for shared cxecur:.�blc objects as
Jn
::�ccept�1blc limir�nion tor rhe Atom A D K bur u n::�ccept ablc f(>r the tim I product.
In addition to <111owing WRL Jnd D U D E engineers ro t(xus 011 f1roducr development, this tirst str�ucgic step p ermim.
: d the engineeri ng te::Jms more time a nd flexi bilitl· to incremenullv add support f(>r Atom into otl1er prod uction components, such as the l inker ::�nd the lo:�der. for usabi l i tl' purposes, minor extensions ll'ere made to the loader to all o ll' i t ro auronutic:tllv load i nstrumented sh�1red libraries prod u ced by Atom tools.
The second step of the strategy W<lS to provide updJtcd Atom kits to users JS de1·cl opment of the soft ware progressed . These kits i ncluded the source code tor
nample
tools, m:.�nuals, and reference pages.
The
upd ate kits pnt<mncd t11·o fu nctions; ti1CI' su pported users and thel' pro1·ided feed back to the de1·elopment teams. D U D 1-'. and 'vVRL e n ginee r s posted information i n rern::� l lv ll'ithin DigitJ I II hen kits ll'erc <li'�Jilab le and de1-eloped ;1 m�1 i l ing l ist of Atom users. The Atom user
Vol . � �o. I 1 996
com nHmitY gre,,· to i nclude un iversities otem:t l customers.
<l!Ki se,·eral
Once the Atom ADK :tnd u pd < l te str:ttegv were est:tblished , D U D E en g i neering beg:� 11 to implement support t(>r Atom in the linker. As mentioned earl ier,
Atom i nserts text i nto J progr:un and req u ires reloca tion i n tonnation to cre:tte a correctly instru mented executable. The Atom prototype required a program to be l i n k ed to retain the reloc:ttion i n t(mnation , and this requirement presented
J
US<lbil itY problem tor users . ldeal lv, Atom wou ld be able to i nstrument the ot:cutables and shared libr,lries prod uced b v the linker. l1\' defa u l t
Mod ifying the l inker to retJin all trad itional reloca tion int(mnation by debult
W<lS not a cc eptable since the size increase in the executable wou l d have been prohibitive . [n some cases,
40
pncent of the object fi le consists of relootion rec o
r
ds. Engi neers did not view
<lll increase of that magn itude as <l viable solu tion. [n
:t d di tion, this solution con flicted with the goal of
Di gi tal U N I X versi on
3.0
to rt:d uce obj ect fi le size .
As a compromise,
D U D E engineeri ng i m p lemented comp<Kt re location support in the l in ker. Co m pact relocJtions prm·ided an acu.:prabk sol ution since they rt:qu irt:d t:1r less space th<m n:.:gul:tr re l oution records, typically less than
0 . 1
percent of the total tile size .
Another side effect of using comp:tct relocations as a solu tion wJs that i t introd uct:d a dependency between
Arom :tnd ld
.
Al l execut:t ble objects ro be processed by
Atom needed to have been gt:ne ratt:d with the l in ker that cont<lined compact reloc:nion support. There t(>re , to support Atom, l:tvert:d product libr:tries and third -parr\' li braries needt:d to be rt: l i nked with the comp:1ct relocation support.
In Digital U N I X version
3 . 0 ,
ld w:ts rnodi ned to genuart: compact reloc:nion int(mnarion in exe c u t:tblc objects. This a l lowed Atom to i nstru ment the debult output of ld.
Engi ncus viewed this capabi lity
;1s critical ro the usability and u l tim:tre su ccess of the
A rom tt:chnology.
The comp�lct relocation support i n l d
\\':tS rdint:d
;md
e xtended m·er the course of se,·eral
Digit:�! U N I X releases
Atom progressed .
;1S de,· c lopmenr work \\'ith
Concurrently, the WRL rese
::t r c h teJm expanded
JIH.l heg;m dn-elopment of tht: Atom Third Degree
;111d hi prof tools. WRL engint:ers also conr i n ued with
:tddi tions and i mprove ments
to
a suite of exampk
Atom tools.
After rhe rele::tse of Digital U N I X version
3 .0 ,
D U D E b egan design and deve l op m ent o f the prod uc tion ,·ersion of the core Atom rechnologv and the API .
D U D E engineers mod i tied :tnd extended the Atom
API as tool development progressed at WRL D uri ng peak development periods, en g inee rs discussed design issues daiil·
by
telephone Jnd electronic mail
.
Tht: original Atom AD K included the source code t(>r a nu mber of example Atom rools. Bec:tuse some of these tools contained h::trdware implementation dependencies, they would rt:quire ongoing and long tt:nn support to rem::tin operarion;11 on changing implementations of the Alpha <1rchitt: c tu re . For the sec; ond shipment of the Atom A DK in Digit:� I U N I X ver sion
3 . 2 ,
rhese high maintcnJIKe tools \\TIT remO\·ed
:tnd m:�de :t\·ai l:tble through unsupporrt:d c lunnels.
Bet\\'een releases of the AD I<.
011 the Digi t<J I U N I X operating
S\'Stem, the engi neering tt:<Jms continued to d e liver upd<Jte kits. Engineers schedu led delivery of tht: update kits to coincide with key milestones in the softw;HT development process. This srrategv ga,·e th e m more c ontro l over tht: development schedu l e
;1nd mi nimized risk. The update kits provided immedi
Jtc field test exposure tor the evolving Atom software.
The design , development, :tnd kit process was prac ticed i re r:ttively over a year to develop the origina l idc1s into J ful l product. T h e Atom update kits were provided tor
D i g ita l UNIX ve rsion
3 . 0
:tnd later
S\'S rt:ms, since most users did nor ha\'t: access to earlv \'er sions of Digita l U N IX 'usion kits
4 . 0 . Providing Atom t(>r use on pre-version
4 . 0 svste ms :tl l owed the sotrware ro be exercised in the ricld on acnwl applica tions prior to its i niti:tl release as a supported prod uct.
A l though support for earlier operating system versions added overhead and compkxiry to the process of pro viding tht: upd ate kits, tht: t:ngineni ng reams val ued the abu nd:�nce of user kedback that the process
\'iekkd . The benefits of usn input to the software dn·dopment process mmve ighed the on:rhc:td costs.
During Digital
UNIX
,·ersion
4.0
development ,
W R I . engi neers finalized the i mpkment:ttions of the hi prof and Third
Degree tools :tnd tr:tnskrred the tool
SOIII"C(S to D UDE tor fu r ther development. The vVRL developers l1:1d added su pport tor thrcJded applica tions on pre-version
4.0
Digital UN I X systems.
Because the i mplementation of threads c hanged in
\nsion
4.0,
D U D E e ngineers needed ro update the
Atom tools :teeordinglv.
D U D E engineers also developed an
Atom- based pixie roo! "·irh su pport tor threackd <l pplications. In
EKt, the Atom -based pixie tool rcplact:d the original version of pixie in Digiul U N I X \'ersion 4.0. The
A to m- b a s e d pixie allowed new katures such as sup port t(>r shared li braries :t nd rhre:tds to be more efticiently added into the prod ucr ofkri ng. The devel opment of:tn A tom -bJscd pixie tool solved the exten sibility problems that wert: being bced with the original \'ersion of pixie.
WRL. engineers a lso began
to
use Atom tor i nstru menting prt:-\ ersion
4.0
D i g it:tl U N IX kernels, de,·el op i ng speci
:t l tools for col l ecring kernel statistics.
Atom w:ts ex tended by D U D E engi neering as needed to support instrument:�tion :tnd analvsis of the kernel.
Di�iral Tcdmiol J ourn�l
Vol . il
No.
I
1996 29
The Atom roo! kit and example tools were shipped
With D 1gnal UNIX version 4.0. The pixie, h i p rof, and
Third Degree tools were shi pped with the Software
Development Environment subset of Digital
UNIX version 4.0. Research regarding usc of Atom for kernel instrumentation and analysis continues.
WRL
continues to share ideas and consults with D UDE on the future directions for the Atom technology.
Conclusions
Developing
OM
into a prod uct directly tl·om research proved to be chall enging. Problems and issues that needed to be addressed hrl.d to be hand led within the schedule constraints and pressures of a commi tted release plan .
In contrast, the ADK method used to deliver the
Atom product allowed the Atom developers to spend more time on prod uct development issues in an envi ronment relatively free from the pressures associated with daily schedules. The ADK mechanism, however, probably lim ited the exposu re of Atom technology at some customer sites.
The close cooperation of engineers from both research and development was necessary to accom pl ish the goals of the two projects. We believe that a colla borative development parad igm was key to suc cessfully bringi ng research to product.
Future Directions
This paper describes the evolution of the
OM and
Atom technologies through the release of the D igital
UNIX version 4.0 operating system. Digital plans ro investigate many new and improved capabilities, some intended for fi.Jture product releases. Plans are under way to
•
•
•
•
•
•
•
Provide support i n
OM t(x call-shared programs and shared libraries.
Support the use of Atom tools on programs opti mized with
O M .
I nvestigate provid ing an A P I to al low program mable, customized optimi zations to be delivered through O M .
Investigate reuse o f instrumented shared libraries by mul tiple call -shared programs that have been instrumented with the same Atom too l .
Research support for Atom tools that provide sys temwide and per-process analysis of shared li braries.
Extend Atom to improve ke rnel analysis.
Simplify the use of the profi ling-directed optimiza tion Facil ities of Atom and OM through an improved interface.
•
Extend the Atom tool kit to provide development support for thread-s:�fc program analysis tools.
In addition to enhancements to the Atom product, ongmal Atom- based tools are expected to become avail able through the development activities of students and educators at universities. I nternal Digital developers wiU con tinue to develop and share tools as wel l .
Acknowledgments
M:�ny people contributed to the development of the
O M and Atom products. The tollowing l ist gives recognition to those most actively involved. Amitabh
Srivastava led the research and development work at
WRL on
OM and Atom and mediated manv of the design d iscussions on the Atom design . Greg
L ueck of
D U DE designed and implemented the production version of Atom , compact relocations, and the Atom b:�sed p i x ie too l . Alan Eustace developed Atom exam ple tools, created the f-Irst Atom ADK, worked diligently with users, developed kernel tools, provided training and documentation on using Atom, and dis played eternal optimism. Russe l l Kao at
WRL con tributed the hi prof tool with thread support. Jeremy
D1on and Louis Monier at
WRL developed Third
Degree and an Atom-based code coverage tool called tracker. John WiJ liams and Chris Clark of DUDE com pleted the process of tu rning the hiprof, pixie and
Third Degree tools into prod ucts. Dick Butrlar pro
VH.lcd documentation on every component. Last but nor least, the authors wish to extend a fi nal thanks to
Jll the users who contri buted feedback to the
OM and
Atom development teJms.
References
I . F Ch ow, M. Himelst.:in, E. Killian, and L. Weber,
"Engi neeri ng a lUSC
Com piler System," Proceedini.!,S of' COJV/PCON San Francisco, Calif. ( M arch 1 9 86):
1 32 -1 37.
2.
VVestcrn
Research Laborarory, locned on the Web at http :/ jw-ww. research .digital .�om/wrl .
�.
R. Sites and R. Witek, Alpha AXPA rcbilec/ure
Rcfer
enu'
!Vfa nual, 2d ed . ( N ewron, Mass . : Digital Press,
1 99 S ) .
4. A. Srivastava and D . Wa l l , "A Practic<ll System ror
! n rcrmod ule Code Optimiz.ation at Link-rime," jour nal of' Progra mminl� languages. vol . 1 ( 1 99 3 ) :
1 - 1 8 . Also available <lS
( December 1992 ).
WRL
Research Report 9 2/6
S . A. Srj\'aStJ\':1\ '< Unrcach:�blc Proced ures in ()bjccr onenred Progra m m i ng,"
ACM f. OPf.AS. \'Ol.
I , no. 4
( Decem ber 1 992 ) : 355 -364. Also available
�s
WRL
Research Report 93/4 ( A u gust 1 993 ) .
30
Digital Tcchnictl Journal
Vol .
8 No. 1
1996
6. A. Eustace and A. Sri,·astc\\·a, "ATO M : A fl o i b k
I nterface
�or
B u i l d i n g High Performance Pmgr<\111
Analysis Tools," l'mceedin,f.4S of the Wlinter
1 995
CW:::YIX Conference. New
J
995
Orleans, La . (January
)
. AJso avail,lbk as WRL Technical Note T N - 44
(July
1 994 ) .
7.
A.
Srivastava and
A .
Eustace,
"ATO M : A
System for
B u ilding Custom ized Program Analysis Tools," Pro
ceedi118S of t be SIG'I'LAN 94 Conference un
Pro p,ramrn ing Lanp,uap,r:
Orlando, Fla.
Oes(r<n and !mplemr:ntation.
(J unc
1 994
). AJso ava ilabl e as
WRL
Research Report
94/2
( M arch
1 994 ).
8 . A. Srivastava and
D.
Wal l , "Link-Time Optimization of
Address Calculation on
;J
64-bit Architecture," Pro ceedings of the
S!G'PLAN 94
C
o n
f
e r e n c e on f'ro wwnm ing Languagr: /Jesip,n and
!mplemr:ntation.
Orla ndo, fla. ( J une
1 994).
AJso available as
WRL
Research Reporr 94/ 1 ( 1-'e bruarv 1 994).
9 . Digital
U;VIX
Ca//in/1, Standard for Alpha
5)•slems.
Order No.
AA PY8AC TE,
Digital U N I X version
4 . 0 or higher ( Maynard , Mass . : Digital Equ ipment Corpo ration,
1 996 ) .
1 0 .
Di{!,ital
UNIX Assemhlv Ictnguap,e Programmer s
Guide, Order No. AA- PS3 1 C-TE, Digital U N I X ver sion
4.0 or h igher ( !VL!ynard , l'vlass . : Digital Eq u i p ment Corporation, 1 996 ).
General Reference
} .
Larus and E. Sch narr, "EEL: Mach i ne- I nde pendent Exe cutable Editing,"
S!CI'LAN Conference on
Programm inp,
L a n g ua g e
Design and Implementation (June
1 995 ).
Biographies
Craig
A.
Neth
Craig eth is <\ princi pc1l software engi neer in the Digital
UNIX
Development Environment group, where he is the technical leader of link time tools. In prior positions at
Digital , Craig has worked on the OM object modi�ication tool and the VA X and
DEC
COBOL compilers, and led the de,·elopmenr of
D EC COBOL
''ersions l and 2 . Craig received a
B . S . in computer science from Purdue University in
1 984 and an
M .S . in (()mputer science �rom the
UniversitY of I l l i nois i n 1 9 86.
M ichael J. Rickabaugh
Michael Rickabaugh is a principal sofuvare engi neer in the Digital U N I X Devel opment Environmenr group.
He started his D igital career in 1 9 86 in the SEG/CAD
Engi neering group as a software engin ee r on the
DECSIM logic simul ation project. I n 1 99 1 , Michael transitioned to the DEC OSF I l AXP pro
j
ect ;�nd was a member of the original team responsi ble for del ive1·i ng the
U N I X development environment on the DEC
O S !-' I 1
AJ pha platform . He has si nce been a technica l contributor ro all aspects ofrhe Digital U
IX l ink rime tech nology as well as the creator of the A S
A)\
P assembler f()r the
Windows NT operating syste m . Michael received a B.S. i n elecrrical and computer engineering �l·om Carnegie
Mellon University in 1986.
Linda S. Wilson
As a principal software engineer in the Digi tal U N I X
Develop ment Environment group, Li nda Wilson leads the development of program analysis tools for the Digital
U N I X operating syste m. I n prior positions, she was respon sible f()r the del ivery oforhcr development environment components, including DEC:
FUSE, the dbx debugger, and run rime Jibraries on the U I .TRJ X and Digital
U N I X oper;Hing systems. Linda rccei,·ed <l B.S. i n computer sci wee from the Uni\'ersirv of N ebraska-Lincoln. Before joining Digital in 1 989, Linda held software e ngineering positions at Masscomp i n Westford , Massachusetts, and
Texas Instruments in Au sti n , Texas.
Digital T\:chni(:tl /ournal Vol . 8 No. I
1996
3 1
Download
Advertisement
Key features
High availability and scalability
Provides a single-system view
Supports large, highly available database systems
Offers advantages over large-scale parallel systems and heterogeneous distributed systems
Integration of multiple directory services
Object modification tools
Clusterwide virtual shared memory
High-performance interconnect
Industry-standard benchmark
Frequently asked questions
The TruCiuster system is a highly available and scalable multicomputer system for the UNIX environment. It provides a single-system view and is managed as a single system. Each cluster node may be a uniprocessor or a multiprocessor system executing the Digital UNIX operating system.
The TruCiuster system offers several advantages over large-scale parallel systems and heterogeneous distributed systems. They provide high availability, scalability, and performance, are built of standard building blocks, and have a low-cost interconnect. They are also more tolerant of failures due to looser coupling and offer better performance and availability compared to single-node systems.
The TruCiuster system is a collection of loosely coupled, general-purpose UNIX servers connected by a high-performance interconnect. It maintains a single security domain and is managed as a single system. Each cluster node may be a uniprocessor or a multiprocessor system executing the Digital UNIX operating system. Key components include the Distributed Remote Disk (DRD), Distributed Lock Manager (DLM), and DECsafe Available Server Environment (ASE).
eXcursion Version 2 is Windows-based X server software that allows the windows of a remote host running UNIX or OpenVMS to display on a desktop running the Microsoft Windows operating system. It has been rewritten to maximize graphics performance and support the full range of Windows platforms: Windows, Windows 95, and Windows NT.
The object modification tools OM and Atom are developed for the Digital UNIX environment (version 4.0) to maximize performance. They help software developers extract maximum performance from the system by providing program analysis and optimization capabilities. They are implemented as shared libraries in the Digital UNIX and OpenVMS environments.
Integrated Directory Services (IDS) is a network directory service that simplifies management by integrating multiple services into one directory-service-independent system. The IDS extensible, object-based framework provides a common interface for network management and reduces the complexity of managing multiple directory services.
Related