ToCedarImplementorsDateOctober20,1983FromJohnMaxwellLocationPARC/CSLSubjectTheCedarSpyDocumentationfortheCedarSpyAttributes:userinterface,Viewers,sub-classing,menusDraft:[Indigo]Documentation>SpyDoc.tiogaLasteditedby:JohnMaxwellonDecember12,198311:37amAbstract:TheCedarSpyisatoolformonitoringtheperformanceofprograms.Itcanmeasureseveraldifferentaspectsofperformance:CPUusage,pagefaults,allocations,orprocesstime.HopefullyaprogrammerwillfindthattheSpyistheonlytoolheneedsforthebulkofhisperformanceanalysis.XEROXXeroxCorporationPaloAltoResearchCenter3333CoyoteHillRoadPaloAlto,California94304DRAFTForInternalXeroxUseOnlyDRAFTp _/q1_/p(_/q3C_/8:p [Sq1[Sp([Sq3C[Sr7[S8[Sp Wwq1Ww !s O3 z#(70p H rH  2 ( p FrF)p EG VrmEG"n$t+-U04Zt BqBB`"$ ,1. 68?AuD! A$q W "&0*G-1 8:Y?!C  ?}  ` !$M'g*4,%02C479; Cu v(-0 (,I/X5(@,14( ,I/ 6gw JCY ',014.xTVm$-2Introduction.TheCedarSpyisdesignedtobethemaintoolforanalyzingtheperformanceofprogramsinCedar.Itconsistsofofanarrayofmeansforviewingtheexecutionofaprogramallpresentedinasingle,consistentform.WiththeSpy,theprogrammercanseewhichproceduresareconsumingCPUcycles,whicharecausingpagefaults,whichareusingtheallocator,orwhicharecallingaparticularprocedure.Whentheprogrammernarrowshisfocustojustoneprocess,theSpywilltellhimwherethatprocessisspendingitstime,whereitiswaitingonpagefaults,whereitiswaitingonmonitorlocks,whereitiswaitingonconditionvariables,andwhenitispreemptedbyotherprocesses.Inaddition,theprogrammercanmeasurepreciselywhatheisinterestedinsincetheSpyprovidesafacilityforsettingbreakpointstodeterminewheretheSpyshouldstartandstopitsmeasurements.HopefullyaprogrammerwillfindthattheSpyistheonlytoolheneedsforthebulkofhisperformanceanalysis.ThemainparadigmoftheSpyistorecordthecallstackofaninterestingprocess.Thedefinitionof"interesting"variesaccordingtowhattheSpyismeasuring.IftheSpyismeasuringpagefaults,itrecordsthestackoftheprocessthatjustpagefaulted.IftheSpyismeasuringCPUusage,itrecordsthestackofthetop-mostactiveprocessatregularintervals.Theonlythingsrecordedaretheproceduresinthecallstack;parametersandlocalvariablesarenotrecorded.AllofthefunctionalityprovidedbytheSpyviewercanalsobeaccessedprogrammaticallythroughtheinterface"SpyClient".Fordocumentation,seethatinterface.ObtainingtheSpy.TheSpycanbeobtainedbybringingovertheappropriatefilesandloading"Spy.bcd".Tobringoverthefiles,typeBringover/a/p[Indigo]Top>Spy.dftotheuserexecutive.Typing"RunSpy"willcauseaSpyviewertoappearatthebottomofthescreen.(TheSpyviewerlookslikeamagnifyingglasslayingontopoftheword"Spy").IfyoudestroytheSpyviewer,youcanobtainanotheronebytyping"Spy"totheUserExec.PreparingtheSpyforitsMission.TheSpyprovidestheprogrammerwithanumberofparameterstospecifywhatitwillmeasure.TheseparametersallowtheprogrammertotailortheSpysomewhattohisparticularneeds.Theparametersarechangedbyclickingthemwiththemouse;repeatedclickingswillcycleaparameterthroughallofthepossiblevalues.Mostpeoplewillfindthatthedefaultparametersprovideagoodstartingpoint.Watching:{CPU,processnumber,breakProcess,pagefaults,wordsAllocated,allocations,userbreaks}The"Watching"parameterdetermineswhattheSpyshouldmeasure.*If"CPU"ischosen,theSpywillwakeup80timesasecond(10onaDolphin)andrecordthecallstackoftheprocessthatiscurrentlyrunning.*If"processnumber:"ischosen,theSpywillmonitortheprocessgivenbytheuser.Itwillkeeptrackofwhattheprocesswasdoing:whetheritwascurrentlyrunning,currentlypre-emptedbyanotherprocess,waitingonaconditionvariable,waitingonamonitorlock,orwaitingonapagefault.*If"breakProcess"ischosen,theSpywillmonitorthefirstprocessthatcausesastartbreak.Thisisusefulwhentheuserdoesn'tknowwhichprocessisgoingtorun.Otherwise,thisisjustlikethepreviousvHDg/x ^ q [x7C #&)G+v13 ;=zCE Y cv" e"'*0249;B-CEK XX Q< A (2*--1I 8^:AE? V H0t "&( .046;Z< B U b Cx#H$'*A/l14779BFH# Q  "#%A, -1m 8 9?jA P r1 $x&!)+.415V9<@q G NlC%!$') 3:; CF L H!`#%)-*- 5 JI;d /!#Z'*,0(13 :@dCD H ,#X%(* 13H58:@DH9 FE #&,.03c4;?CRD ES =KT2!#($ .g104;8E=@7B C  q w/!u'0)+ A1& /!#%h(/,/(139lDW ? K : &)L, x :wq 7Ee$X') 1[4W7< CE 5 e2N  /   h ,#&;)+ -2$38J9<3@BD -X 6M "&* ,.0>26;<?DtF +`0;!&'*J+.Xx &wO2q #l5 "%'9,.] 57Q< ?@C !5 r $B&8*,/68u: AlF  (W $'*y/5S;#>AC  vAO% G#(+O.Z1F38 ?DF y  '} .97 >Aq 21 " %)(*-2$  = h1 $q&(v,&-V14T6`7=@HDG  _wK b ; ` C !#w&L) .]059|;=ACF=  ]oH %'@)/5Q;, BD :"')*03_5#9;='@m E 8 U "%*-=047<=3@HEH#  u"#')8,.1 8;1<?AD TVm$3mode.*If"pagefaults"ischosen,theSpywillrecordthecallstackoftheprocessthatpagefaulted.*Thedifferencebetween"allocations"and"wordsAllocated"isthatintheformer1countisrecordedforeachallocationandinthesecond1countisrecordedforeachwordallocated,whichwouldbethesamearecordingncountsfortheallocation,wherenisthenumberofwordsallocated.*If"userbreaks"ischosen,theSpywillrecorddataeachtimeitencountersabreakpointsetusing"SetUserBreak!".SetUserBreak!ClearUserBreaks!ThesetwocommandsallowtheusertospecifybreakpointsthatwillcausetheSpytologdata.ThebreaksareonlyenabledwhiletheSpyisrunningandthe"Watching"modeis"user-defined".Thereareanumberofwaysofspecifyingabreakpoint:*SelectioninanImplmodule.Theselectiondoesnothavetobeaprocedurename,itcanbeanywhereinthecode(justliketheInterpreter).*Selectionofaropeoftheform"FooImpl.Proc".Theselectioncanbeanywhere,eventheSpy'soutput.YoushouldknowthattheSpywillnotbeabletosetabreakpointifa)themodulehasnotbeenloadedyet,orb)thesymbolsarenotonthedisk.If"ClearUserBreaks!"isbugged,ALLofthebreakpointswillgoaway.SetTrace!Wheneveratracebreakpointisencountered,theSpywillputanentryinitslogsayingwhenandwhereitwas.ThetracesareonlyenabledwhiletheSpyisrunningandthe"Watching"modeis"user-defined".Tracebreaksaresetjustlikeuserbreaks.Theyareclearedwith`ClearUserBreaks!'.StartingandStoppingtheSpy.TherearetwomainwaysofstartingandstoppingtheSpy:bybugging"Spy:{on}"and"Spy:{off}",orbysettingbreakpointsthatdetermineprogrammaticallywheretheSpyistostartandstop.StartandStopbreakpointsaresetinexactlythesamemannerasgivenaboveforuserbreakpoints.TheonlydifferenceisthatifaStopbreakpointissetonathebeginningprocedure,thebreakwilloccurattheexitoftheprocedureratherthanitsentry.SettingaStartorStopbreakpointdoesnotactuallyenabletheSpytorun.Instead,the"Spy:{off}"switchwillbechangedtosay"Break:{off}".TheStartandStopbreaksareonlyenabledwhentheprogrammerhassettheswitchto"Break:{on}".ThisallowstheprogrammertospecifyallofthebreakshewantsbeforetheSpystartsmeasuring.Changingtheswitchto"Break:{off}"doesn'tremovethebreaks,itjustdisablesthem.Thustheusercanreusethebreakshehasalreadyset.ThebreakpointfacilityisdesignedsothattheSpyisrecordingdataaslongasthenumberofStartbreaksexceedsthenumberofStopbreaks.Thisallowsbreakstobesetinrecursiveprocedures.When"ClearBreaks!"isbugged,alloftheStartandStopbreaksareremovedandtheon/offswitchischangedtosay"Spy:{off}".DisplayingtheData.Clicking"DisplayData!"willcausethedatatobedisplayedinanewtypescript.ItwillalsoautomaticallyturnofftheSpyifitisrunning."DisplayData!"doesnotdestroythedatastored.IfsomevHDg/q _/ ] ) D!#(*a,0_24w9K< [  ` "%02468=j>BlC Z9 9yzZ9*Z9qZ9hZ9G!X"&'-0y3XZ94@Z96q;Z9@BF LX&^"2#(+.2 59;>E KU ? iOd ! WI d #),/3478]?CZDG H!.u; .F_ [A +.47Y9g@CsE D C f;"#&(*+ 2357<?RAE Ah Qu  ? n+c!#w% -K/1y CF 7{<x &.*,/1Q69q -T(R3$F'%,/p24:n>BE +' !(H3M7:<>m@:ChF> *? 8  %*'*/15Q9K;>t F ( <l $&(?*L+}-4V ;8=A|D/G &y K& &q&& " $uCZKt !R$o&+0(2t5$6: ?%ArEK "Ah"'s*f-038t:>C_G/ !& %q2#>( +/)1u 9D:?gADBE5  NF $+E-2 39=]B1G/ '"$'+(-136G; \ xl"(#&)+-L3w6}8,;F<?UDF< FQ%(",P02X4I6f8= : 1y :!k:q":#d:$U&),/46\<>@EU  Xux  q Lk m]#W%)E+8-m3572:e BCF QGkq  i&_ 0315:]<?DE TVm$4ofthesymbolsweremissing,theusercanfetchthemandclick"DisplayData!"again.Thesecondinvocationwilltakeadvantageofthenewsymbols.Totheleftofthe"DisplayData!"buttonisabuttoncalled"cutoff".The"cutoff"buttonletsyouspecifyhowmuchinformationyouwanttobedisplayed.Thenumberafterthecutoffisthepercentageoftimesaproceduremustbeinthecallstackinordertobedisplayed.Ifaprocedureisinthecallstackfewertimesthanthis,thenitwillnotbedisplayed.InterpretingtheResults.TheSpy'soutputisdividedintothreemainparts:aheader,abreakdownoftheprocesses,andabreakdownoftheprocedures.TheheadergivesoverallstatisticsabouttheexecutionoftheSpywhilethetwobreakdownsectionsarefocussedondetaileddata.Thethreesectionsareseparatedbydoublerowsoftildas(~~~).==================================CedarSpyof:29-Apr-829:19:41.Executedat:29-Apr-829:20:15....Theheaderisprettymuchself-evident.Atthetopitrecordstheparametersthattheprogrammerspecifiedforthisparticularrun:whatwasbeingmeasured,wherebreakswereset,etc.BelowthisitgivesoverallstatisticssuchashowlongtheSpyran,howmanywakeupswererecorded,whatprioritiesdidthingsrunat,howmanypagefaultsoccurredoverall,andsoon.Atthebottomisasectioncalled"StatisticsontheexecutionoftheSpy"whichgivessomedataabouttherunningoftheSpyitself.Thisisonlyfordebuggingpurposes.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Breakdownofinterestingprocesses.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Thesecondsectiongivesalistoftheinterestingprocessesthatranandsomedataaboutthem.Atypicalentrymightlooklikethis:Process220Brunningatpriority[normal,pagefaultLow](39pagefaults)=609(32.6%).BBStart.EvalBase=608(32.5%).CachedRegionImplB=1(0.1%).Thefirstlinesaysthatprocess220Branattwodifferentpriorities(normalandpagefaultLow)andthat39pagefaultsoccurredasanimmediateconsequenceofitswork.Italsosaysthat609countswererecordedforthisprocess,andthatthisaccountedfor32.6%ofthetime.Thesecondandthirdlinessaysthatofthese609counts,608countswereinBBStart.EvalBaseand1countwasinCachedRegionImplB.Thesecountscorrespondedto32.5%and0.1%ofallofthecountsrespectively.Process220Bhastwoentriesbecauseitwassharedbymorethanonelogicalprocess.Mostprocesseswillonlyhaveoneentryunlessalotofprocessesarebeingforked.vHDg/q _/ hjz"%b),/3 = AD ] E?o # [ C !&$'(-A1?7:m?DQF YeS "$&s -c055\8:>@OB W }X!#'H),.0 79j:AEBDG V _)o"$& x Q! q MJLT!>$(j,]-23:<?3 EHe L+G C ($(:, 2=6+8>@C E J X:g#d%w*.150:]<BD H 2z D"q C  Ak?>R?@E 3\ ;9o"2&7)-,0)46[;=:?BMFu 1 Xqh -. +)  *D. & >5S1 '2-$/2O48;z?PCE %N w< !G~ # ,.2*6d8I: X?  p0#W%'w*-/ 5:= F  B% -/L1#5r69<?VAF> lj8!(]*.0I2 %R }#Q%(+=/26:L<F I D!%)h 137:>=?6A"BE4  'u9(#3$r'+V-;036[:@ C  7Z "N(L*.jpTVm$5~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Breakdownofinterestingprocedures.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Thelastsectiongivesalistofmodulesandproceduresindentedsoastoindicateprecedencerelationships.(ModuleinformationisonlyprintedwhentheSpyisunabletoobtainthesymbolsnecessarytoprintouttheprocedures.)Eachmoduleorprocedurethatoccursinmorethan3.0%ofthecallstackswillbeprintedexactlyoncesomewhereinthissection.Atypicalentrymightlooklikethis:ProcedureStackSpy.AddSon(2refs)=93,2794(2.9%)(92.6%).(20154)StackSpy.AddProcedure=1946(62.4%).(20277)RTPrefAllocImpl.NewPrefixedObject=78(2.5%).(20348)StackSpy.AddProcedure=632(20.2%).(20398)RTPrefAllocImpl.NewPrefixedObject=60(1.9%).(20444)waiting.pagefault=59(1.9%).ThefirstlineindicatesthattheprocedureStackSpy.AddSonwascalledfromtwoplaces(2refs)andwasinthecallstackatotalof92.6%ofthetime.This92.6%ofthetimewasdividedinto93countswhentheCPUwasexecutingcodeintheprocedureitself,and2794countswhentheCPUwasexecutingcodeinprocedurescalledfromAddSon.The2.9%isonlytherebecausethenumberofcountsthatwereintheprocedureitselfwasgreatenough(>1.0%)toforceittoprintapercentageforjustthosecounts.Notethatpercentagesarealwaysfortheamountoftimethataprocedureisinthecallstack.Thismeansthatpercentagesmayadduptomorethan100%sincemostcallstackshavemorethanoneprocedure.Themeaningsofthesenumbersareprintedintheheaderoftheoutputforeasyreference.Thenumberofrefstoaprocedureisnotthesameasthenumberofcalls;itindicatesthenumberofdifferentplacesthatacalltothisprocedureoccursinthestatictextofthecode.Inthiscase,AddSonwascalledfromtwodifferentplacesintheprocedureStackSpy.EnterStack.ThenextfivelinesgivethelistofproceduresthatoccurinthecallstackunderAddSonmorethan1.0%.ThesearethesignificantproceduresthatAddSoncalls.TheyaresortedbyPC,andsotheyarelistedintheorderthattheyappearinthecodelistings.Thenumbersinparenthesisatthebeginningarethesourceindexesforthecalls.Selectingoneofthenumbersandclicking"Position"inthefileStackSpy.mesawillshowyouwherethecallwasmade.Ifaprocedureiscalledfrommorethanoneplace(asStackSpy.AddProcedureis)thenitwillappearinthelistmorethanonce.SincetheSpydoesnotprintproceduresthatarecalledlessthan1.0%,thesumofthecountsfortheprocedureslisted(1946+78+632+60+59=>2775)maybelessthatthetotalnumberofcallsgivenintheprocedureheader(2794).ThecountthatappearsaftereachprocedurelistedisthenumberoftimesthatthatprocedurewasinthecallstackunderAddSon.Thepercentageistheratioofthatcounttothetotalnumberofcounts.Thelastentry,waiting.pagefault,isanentrythatonlyappearswhenexactlyoneprocessisbeingobserved.ItsaysthatAddSonwaswaitingonapagefaultfor1.9%ofthetime.(Other"waiting"proceduresareML(monitorlock),CV(conditionvariable)andpreempted.Preemptedmeansthattheprocesswasreadytorun,butanotherprocessgottoruninstead.)InterpretingIndentation.Theproceduresasawholeareindentedaccordingtothefollowingrule:Aprocedureisindentedimmediatelyunderthedeepestprocedurethatcompletelycontainsallofthecallstoit.Usuallythisjustmeansthataprocedureisindentedundertheprocedurethatcallsit,butitmeanssomethingdifferentifaprocedureiscalledfrommorethanoneplace.Indentationcanbeusedtoeliminatewholesub-treesoftheprintout.Ifyouaren'tinterestedinaprocedure,youcanignorealloftheproceduresindentedbelowit.vHDg/q _. ])  \W. Yj !&) 179;<Bf X5 N5 !"&+/146e;-=ADB V { "*%*,U259;?B9EzG/ T wn {!(*-824=8BCF E0 p KS!^#,%),125G8;B@MC:E4 C F7 #')-A/3!7m;=d@Ce A $ #!%)!*~-168i=?1C~F> @:  F#=(3)-y.04 5D <7>A0D > |  !q#)&+.O1C29:y:>;.><?AqD>Fu> <bc 5!d#D' *b.215f8#^@D+ 5z H `"$n* 2Lu ! (+/c13q59o=rBFi 1W%  $'j,04^6:<?BYD$G; / h ;!$l'-a0K6 7 ?@C# .  Z?N !A'8)+.M46< BDG% ,a J #,%(-e/0D68e E 'k3 #2%A'*-^057:>@C  %s #IpH\!(i,-/516:=@WF !  n ')+o.0T368:>C+D   $_'*/279>f?Cf S o]7]< M!')-%.1U5m9@) G;  U %( 07,_-4H75<>@/F= ]0  t!H"&),58t>?zADE [ AZ8!$L%'M-1 269;s=A?BDm Z1 [ ;W 8#,$&) 13U5:;>B X "#i!A%)*-$3B6;P>j@E6G V G*O"K%'),1469<>@ F U; Ir. %c&()-/57g: R r"R%'U .06e9?;=B Q To # *,/[579/;= Ek Oq =Bt* %'8)+.14\68p< CDG M w `;$ +.47=?BEK L" F  "% '(, 37F<?BD J{ " nQ $+ 1359S>-@9B} H   FX //!#&!)l+-a03%699; =B-D- D um~ %(+y2Z 9>BAD.F C  S "f$V'[) . 68?9i=ax > q :d1 @!X${'/),V0m6s93 @BB 9 kW#!%). 4-58T<>ABoFHe 7v  ~M [".$'Y+4.t0247j:i AS 5  3SG"I#'X*,:014o58H;=@C 1A #*&|(*- 58:B<>EK 0 cD! * -A %( / 8:m>B + !#t$'g*13[59 @"CFS *;m $'3*n 16':?<?xCNDG/ ( Zj  #&3*, &[[(? %)/ 0I685;?B^FIHe $q | #.),p/ 1n 8=1@OBF " `C!#&*x  q D  "%)/049 ACZ  oA0j"(+o.035:<> F 6 W{"W%*. 356=7wu #%(s*-3d5X; ?CG [ 6"!"&n)=,O.027<>@CEH. Z9 m\!%(,*.$/3K5U6; ACE X dP#(w+J 46]9<<=BEEF VQ  "&(*-M2! Te\Vp"#(+O-095O;5?-E G R <F$'\)/}1w7:>@DB2Gg Q 0o@$i'*,0-25: @3BENG/ Oo m !%e',/47 =?C F M^x#z%P&+7/x047;;.=?BE L vi%(+/26 9s?MB}H# Jy   a#"%A GU1!G&$',-23I68=?B?F> FL ;K4!#C%(+c.138G9=?sBE D TU2 %}&(E,)0/ 68:A-BEK Bn% $D')| @xx$k)+$-.<05 <7? ADjG > >#"b$&]*,.2478<=9 D =*r\LL $&X(*-2[4&6:; C=H# ; ;5y ;;q;R;"$% ,149G; =|A.FH9 9 uv 7V U? #&(+/256:<?YBEG 5/2!'/),T.26,8;f?AEG/ 4 D,p4k4q44 #%H(a+,/247 ;ADGF 2` IT'_$F&I+D,/L4S9;G?B'F 0 PIS"$ &c+[,/M24I7 ?WAE^F /5,Bp-/./q1?/1/3 -jp -j R-jq-j"-j}> %6' .04:O>BE + CI TVm$8Appendix:SpyCommands.nameSpy:{off,on}descriptionClickingthe'Spy'buttontogglesthecurrentstateoftheSpy.IftheSpyisoff,thenclickingthebuttonwillturniton.IftheSpyison,thenclickingthebuttonwillturnitoff.TheSpyisinitializedusingtheparametersshownintheviewerwhenthebuttonisclicked.examplesSupposeyouwanttoknowwhyopeningaviewertakessolong.OpentheSpyandtogglethe'Watching'buttonuntilitsays'CPU'andthenclickthe'Spy'buttonsothatitsays'{on}'.Thenopenaviewer.Finallyclick'DisplayData!'toseetheresults.('DisplayData!'turnstheSpyoffautomatically.)contactJohnMaxwellkeywordhintsspying,performance,measurementkeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameBreak:{off,on}descriptionClickingthe'Break'buttonenables/disablesthestartandstopbreakssetbytheuser.examplesSupposeyouonlywanttomeasuretheperformanceofthegarbagecollector,andaren'tinterestedintakingmeasurementswhenitisn'trunning.ThenyoucouldsetstartandstopbreaksonthegarbagecollectorsothattheSpywouldonlytakemeasurementswhilethegarbagecollectorisrunning.Use'SetStartBreak!'and'SetStopBreak!'tosetbreaksonthetop-levelprocedure.Clickingeitherofthesewillchangethe'Spy'buttonintoa'Break'button.Whenyouhaveallofthebreaksset,thenclick'Break'toenablethem.(Havinga'Break'buttonallowsthebreakstobeenabledatomically).stop/undoClick'ClearBreaks'tochangethe'Break'buttonbackintoa'Spy'button.contactJohnMaxwellkeywordhintsvHDg/x ^Ky [t[[:^y XX q U _&) %G(s*&,01368 :=BE Sa W!').035/8V;;> ? E Q K RO #&(*,y Nkq K^Kx"#(+-31479468;y &q #kd m" + ,/`4 :=yAx G !1 ? x%),M002c58Y;i?ADn r'!b$} -1k39.>@lF u a"%$W(*-W3 :@5D7F  ?< %W*/-2 5u79i;@mCFS &A Y$)(,/(3507!]CR".(TheSpyprintsoutthesourceindexforyouwheneveryousetabreak.)examplesYouhaveruntheSpywatchingtheCPU,andareinterestedinfindingoutmoreaboutaprocedurethatappearsintheoutput.Soyouselectthenameoftheprocedureandclick'SetStartBreak!'and'SetStopBreak!'.Thenyouset'Watching'to'breakprocess'andruntheexperimentagain.Whentheexperimentisdoneyoucanclick'DisplayData!'toseetheresults.warningsTheSpywon'tbeabletosetabreakpointifthemodulehasn'tbeenstartedyetortheirarenosymbolsforit.stop/undoClick'ClearBreaks!'.contactJohnMaxwellkeywordhintsspying,performance,measurement,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameSetStopBreak!descriptionvHDg/q _/  y [q X  vb A" *-%.13y U@tU@U@ y Q q NZ8!+~-M/047:=@7D LjtP#&',~1L5R7:\=?zEFH KR}Y %Y&(.V/`346:" I M]K "P$&y,.1G7<?BnE2G H @c$n&+-0 D ~p$&'*.u0509:=%ADGR C 0',A1F59"< @BE? Ae y >q : 0#&a( .05T7;L?%@FF 9PWo#&Q*j,|/469 <F 7xB1 $$%*/T247* >jC G/ 5 ?{ ')7+-y 2q /1 L:2! $%n',04%8:<?B>DB - )y *:q & y #q L Ty Dq    y ]q    vb A" *-%.13y t y n -TVm$f10Selectacodelocationandthenclick'SetStopBreak!'tosetabreakthatwillstoptheSpy.Clicking'SetStopBreak!'willturnthe'Spy'buttonintoa'Break'button.Therearetwowaysofselectingacodelocation:byselectingapositioninthesource,orbyselectinganameoftheform'ModuleImpl.Procedure'.Thelatterwillcauseabreaktobesetattheendoftheproceduregiven.TheSpywillrunaslongasthenumberofstartbreaksexceedsthenumberofstopbreaks.Astopbreakcanbesetfromacommandfileifyouknowthesourceindexofthebreak.Justcall"_SpyClient.SetStopBreak[NIL,"FooImpl.mesa",]CR".(TheSpyprintsoutthesourceindexforyouwheneveryousetabreak.)warningsTheSpywon'tbeabletosetabreakpointifthemodulehasn'tbeenstartedyetortheirarenosymbolsforit.stop/undoClick'ClearBreaks!'.contactJohnMaxwellkeywordhintsspying,performance,measurement,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameClearBreaks!descriptionClicking'ClearBreaks!'clearsthestartandstopbreaksthathavealreadybeenset.examplesSupposeyouhavesetanumberofstartandstopbreaks,andthenfindthatyousetabreakinthewrongplace.Clicking'ClearBreaks!'willclearallofthebreaksandallowyoutostartagain.(Thereisnowaytoclearjustonebreak.)stop/undoImpossible.contactJohnMaxwellkeywordhintsvG~g/q _/_#F!+|-M/047:=@2D ]WbA#&',s1C5K7:V=?xEFH [}Y %Y&(.V/`346:" Z9 q(!#y%Z9&Z9q(Z9)GZ9*Q,3L7:=@^CDG X Kx1A"'2(+ UC ] x$&'*.l05)8:= ADGR S' ,11859<@BE? Q y Nq KV L:2! $%n',04%8:<?B>DB I )y F`q C y ?q CTDF ^ 9y q  y qq # Ty DTVm$L11spying,performance,measurement,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameDisplayData!descriptionClicking'DisplayData!'turnstheSpyoffandproducesatypescriptofthedatagatheredsincetheSpywasturnedon.Thedataisdisplayedinacomplicatedtreestructurewhichisexplainedinthesectionabovecalled'InterpretingtheResults'.Ifyouholddownthecontrolkeywhileclicking'DisplayData!',thentheSpywillmonitoritselfwhileitisdisplayingitsdata.Whenthefirsttypescriptisfinished,asecondonewillappearwiththedatafortheSpy.warningsIftheSpycannotfindthesymbolsforamodule,thenitwillprintPCrangesinsteadofprocedurenames.Youcangetanewtypescriptbybringingoverthecorrectsymbolsandclicking'DisplayData!'again(youdonothavetoruntheexperimenttwice).Thenewtypescriptwillusethelatestsymbols.stop/undoYoucanstoptheoutputbydestroyingthetypescriptviewerorbyclickingcontrolDEL.(ItmaytakeseveraltriesbeforeitrespondstothecontrolDEL.)contactJohnMaxwellkeywordhintsspying,performance,measurementkeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenamecutoff:{n}descriptionThecutoffparameterdetermineshowmuchofthedatawillbedisplayed.Theparametermeasuresthepercentageoftimethataprocedureisinthecallstack.Iftheprocedureisinthecallstacklesstimethanthecutoffspecifies,thenitgetsprunedfromtheoutput.Youcandisplaythedatausingseveraldifferentcutoffparametersjustbychangingthecutoffandclicking'DisplayData!'again.Left-clicking'cutoff'incrementstheparameter,right-clickingdecrementsit.Middle-clicking'cutoff'setsittothedefaultvalue,3.vG~g/q _/   y [q X  vb A" *-%.13y UBtUB(UB y Q q Nr $!b#&g,S- 358;+@D_F L !!#k$ ,Y/'49 :@BD KV  > H n$U~1"z'046z9<;A(DH9 F_ e r!W ')).047_:>AD@GR D Ky Aiq > Y P!:"O'*+.y14 8D<>D y 7|q 4-   "E$ +/v1D3K8k=(ACF 2}& %y /7q + Ty (Dq %J  y !q   vb A" *-%.13y ]t]]yy  q  J Q!U%,&)E,J.0 7:A=G/   "#&G(-V.1\79n;/=@=CFi q # *!%)[+1<4\6;>-ACD  =8%'t+w./3D q Q Ty NDq KO  y Gq D  vb A" *-%.13y A`tA`uA`y > q :  #&&)*.05 >#? G/ 9 _"  $ +-Q/16.@!DElG/ 7r H 4"  "$&g)/O179l<>s@D 2{ X5Gb $)+G.L/6:y /+q +OSk#&,A0 2|89?ArCvG/ *4 "3%'+a,03q69CF ( Dx$).37B &y #q F 33!"$')c/146^9#? G/ I _"  $ +-Q/16.@!DElG/ H H D fTS$&+-/13l5;<?)DF C =p $),-.246y9?cBG/ Af]K#.'()s,!0124D89>A D ? -N)">#k',18w:?zABE >1F!# $I*hy :q 7zb!$ /359(>@@ G 5[B "% /3i6/9dADHe 4+ Q, #&^(+f..0 :t>BDFi 2T!g#C&j+?-~/3'59;=n@EjG 0 Ky -q *? e!&( ,/2z58d=DB|GF (a!"$)+0 2r5-7:=(?Db & 4kn!]%'N).0 68;m=CE %Ig";'g . y !q   "Py \q   Ty Dq o   &+]/25Qy  q   vb A" *-%.13UTVm$14nameWatching:{breakprocess}descriptionThe'Watching'buttondetermineswhattheSpyisgoingtowatch.Left-clickingitenumeratesthepossibilitiesinonedirection,right-clickingenumeratesitintheother.Middle-clickingresetsittothemostcommonchoice:'CPU'.Whenwatchingaparticularprocess,theSpywakesupatfixedintervalsandsamplestheprocesstoseewhatitiscurrentlydoing.Therearefivethingsthatitcouldbedoing:executing,waitingforpermisiontousetheCPU(becauseahigherpriorityprocesspreemptedit),waitingonapagefault,waitingonamonitorlock,orwaitingonaconditionvariable.Thefirststartbreakencounteredwilldeterminewhichprocessedwillbewatched.examplesSupposeyouhaveaprocedureFooImpl.Foothatyouthinkisspendingtoomuchtimewaitingonmonitorlocks.Select"FooImpl.Foo"andthenclick'SetStartBreak!'and'SetStopBreak!'.Thenset'Watching'to'breakprocess'andclick'Break'toenablethestartandstopbreaks.Thensay'_FooImpl.Foo[...]'totheinterpreter.Whenitreturns,click'DisplayData!'toseetheresults.stop/undoClick'Spy'/'Break'or'DisplayData!'tostop.contactJohnMaxwellkeywordhintsspying,performance,measurement,processeskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameWatching:{pagefaults}descriptionThe'Watching'buttondetermineswhattheSpyisgoingtowatch.Left-clickingitenumeratesthepossibilitiesinonedirection,right-clickingenumeratesitintheother.Middle-clickingresetsittothemostcommonchoice:'CPU'.Everytimeapagefaultisencountered,anentryisloggedintheSpy.Theoutputwilldistinguishbetweenpagefaultsthatoccurbecausecodehadtobeswappedin(pagefault.code)andpagefaultsthatoccurbecausedatahadtobeswappedin(pagefault.data)Proceduresthathadpagefaultsinthemainbodyofthecodewillbeprintedinbold.(Non-boldproceduresonlyhadpagefaultsinproceduresfurtherdowninthestack.)stop/undovG~g/y _,t_,u_,<y [ q X  #&&)*.05 >#? G/ V _"  $ +-Q/16.@!DElG/ U@ H Q C s"%)+-]06f9 >O@EG; PI C~z #w'*Q+/f1P5 < @C$ N (M$N)/0!2V769H:=ArFRHe L$l'"%(%*-04 %#(w+58CGr Ag #(n*e/158;UAEG ? w !%'6,A/| 8:8<>y #? G/  _"  $ +-Q/16.@!DElG/   H sy "&X',-/3|6D:=@ D    Z#B%!'C-.94< BE o dP) 036e <>@D]G  D'%A ,@/R2 8}:$ A#E    y qTVm$15Click'Spy'/'Break'or'DisplayData!'tostop.contactJohnMaxwellkeywordhintsspying,performance,measurement,pagefaultskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameWatching:{allocations}descriptionThe'Watching'buttondetermineswhattheSpyisgoingtowatch.Left-clickingitenumeratesthepossibilitiesinonedirection,right-clickingenumeratesitintheother.Middle-clickingresetsittothemostcommonchoice:'CPU'.Wheneveranallocationoccurs,theSpylogsoneentry.Ifyouwanttomonitorthetotalwordsallocatedratherthantheallocations,use'Watching:{wordsAllocated}'.warningsTheSpyonlymeasureswordsallocatedfromsafestorage,itdoesnotmeasurewordsallocatedfromanuncountedheap.stop/undoClick'Spy'/'Break'or'DisplayData!'tostop.contactJohnMaxwellkeywordhintsspying,performance,measurement,allocationskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameWatching:{wordsAllocated}descriptionThe'Watching'buttondetermineswhattheSpyisgoingtowatch.Left-clickingitenumeratesthepossibilitiesinonedirection,right-clickingenumeratesitintheother.Middle-clickingresetsittothevG~g/q _/  "Py [q X Ty UBDq Q   y Nq KU  vb A" *-%.13y HtHuH y D q Ai  #&&)*.05 >#? G/ ? _"  $ +-Q/16.@!DElG/ > H :z` (~"6%',-y0&3x5:T<?C 9$    $y 5q 2 "%(-/02f4:T>fD2G 0y -q *A  "Py &q # Ty TDq    y q g  vb A" *-%.13y tuy  q z  #&&)*.05 >#? G/ _"  $ +-Q/16.@!DElG/(TVm$16mostcommonchoice:'CPU'.Wheneveranallocationoccurs,theSpylogsanentryforeachwordallocated.Ifyouwanttomonitortheallocationsratherthanthetotalwordsallocated,use'Watching:{allocations}'.warningsTheSpyonlymeasureswordsallocatedfromsafestorage,itdoesnotmeasurewordsallocatedfromanuncountedheap.stop/undoClick'Spy'/'Break'or'DisplayData!'tostop.contactJohnMaxwellkeywordhintsspying,performance,measurementkeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameWatching:{userbreaks}descriptionThe'Watching'buttondetermineswhattheSpyisgoingtowatch.Left-clickingitenumeratesthepossibilitiesinonedirection,right-clickingenumeratesitintheother.Middle-clickingresetsittothemostcommonchoice:'CPU'.Aentryisloggedeachtimeauser-specifiedbreakisencountered.Userscansetandclearbreakswith`SetUserBreak!'and`ClearUserBreaks!'.examplesSupposeyouwanttoknowwhoissendingpacketsoutontheEthernet.Thenyoushouldsetauserbreakontheprocedurethatsendspackets,andclick'Spy'toturniton.(Settingauserbreakautomaticallysetsthe'Watching'parameterto'userbreaks').Letthingsrunforawhileandthenclick'DisplayData!'toseewhathappened.stop/undoClick'Spy'/'Break'or'DisplayData!'tostop.contactJohnMaxwellvG~g/q _/ H [ u"%'+-e041 :fD2G Qy Nq KR  "Py Hq D Ty AcDq >  y :q 7t  vb A" *-%.13y 4$t4$u4$jy 0 q -  #&&)*.05 >#? G/ + _"  $ +-Q/16.@!DElG/ *6 H & @m %P).* 3e7C9;>BFt %?ky !q Xk %9*0,.1S8;>CETF  ~Z#m%),c-0149:=kA Q  F!?'?)-0b237s:'=I@   Ky Zq    "Py q k TTVm$17keywordhintsspying,performance,measurementkeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameSetUserBreak!descriptionSelectacodelocationandthenclick'SetUserBreak!'tosetauserbreakintheSpy.(See'Watching:{userbreaks}'formoreinformation.)Therearetwowaysofselectingacodelocation:byselectingapositioninthesource,orbyselectinganameoftheform'ModuleImpl.Procedure'.Thelatterwillcauseabreaktobesetatthebeginningoftheproceduregiven.Auserbreakcanbesetfromacommandfileifyouknowthesourceindexofthebreak.Justcall"_SpyClient.SetUserBreak[NIL,"FooImpl.mesa",]CR".(TheSpyprintsoutthesourceindexforyouwheneveryousetabreak.)stop/undoClick`ClearUserBreaks!'.contactJohnMaxwellkeywordhintsspying,performance,measurement,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameSetTrace!descriptionSelectacodelocationandthenclick'SetTrace!'tosetatracebreakintheSpy.Wheneverthetracebreakisencountered,atracewillbeloggedintheSpy'slog.ThetracetellswhenandwheretheSpywas.Therearetwowaysofselectingacodelocation:byselectingapositioninthesource,orbyselectinganameoftheform'ModuleImpl.Procedure'.Thelatterwillcauseabreaktobesetatthebeginningoftheproceduregiven.Atracebreakcanbesetfromacommandfileifyouknowthesourceindexofthebreak.Justcall"_SpyClient.SetTrace[NIL,"FooImpl.mesa",]CR".(TheSpyprintsoutthesourceindexforyouwheneveryousetabreak.)examplesvG~g/y _,Dq [  y Xq U?  vb A" *-%.13y QtQQ y N q KSE!K+*,/"0b3q7]9";?bB I !r " &6(+^.06J7:@BHe H!hW "%'b)-<?C;E F] @  ##) C \ w$&'*.l05)8:= ADGR Af/',@1E59!< @BE? ? y AdE   )y lTVm$18Supposeyouaretinkeringwithamulti-processsystemthatdoesspurtsofworkatsporadicintervals.ThenormalSpydoesn'thelp,becausethereistoolittlegoingontomeasure.Soinsteadyousettracebreaksatalloftheinterestingpoints.Whatyougetasoutputisalogofthetracesencountered,givingthebreaklocation,theabsolutetimeofthetrace,andthedeltasincethelasttrace.Examiningthislogcarefullymaygiveyoucluesastowhatisgoingon.stop/undoClick'ClearUserBreaks!'.contactJohnMaxwellkeywordhintsspying,performance,measurement,tracing,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturenameClearUserBreaks!descriptionClicking'ClearUserBreaks!'clearsanyuserbreaksortracebreaksthathavebeenset.examplesSupposeyouhavesetanumberofuserbreaksortracebreaks,andthenfindthatyousetabreakinthewrongplace.Clicking'ClearUserBreaks!'willclearallofthebreaksandallowyoutostartagain.(Thereisnowaytoclearjustonebreak.)stop/undoImpossible.contactJohnMaxwellkeywordhintsspying,performance,measurement,breakpointskeywordstobesuppliedbytheIndexCzarattheappropriatetimeinthefuturevG~g/q _/gX ',/r268C ] `(!%c&)K,0Y2i4!:~<AKD F2 [D !%N(*J+0f125I79^== El Z9 N& "n$(+B-1469h=DG< X:[ "f#'y UCq Q y Nq KW Ty HDq D  $ y Akq >  vb A" *-%.13y :t::y 7 q 40e!|$u(*-2K58_;y 0q -iVka"R&(_+0^3 6+9;>@AEG/ +\#P%)'+,.3=59x<=@E *D X ^66y &q # y Xq   Ty Dq l   y q   vb A" *-%.13 TVm$ GACHA TIMESROMAN TIMESROMANY HELVETICA HELVETICALOGO TIMESROMAN HELVETICALAUREL TIMESROMAN TIMESROMAN  W2 O, ?8 BHMZRfX|^el5pu{j/x SpyDoc.tioga"Monday, December 12, 1983 11:41 am