Home

User Manual

image

Contents

1. 32 6 1 CallStackView 32 6 2 CallGraphView 34 6 3 SingleCallView 34 6 4 SearchView 35 Part Tutorials 37 7 1 Bug Erroneous Database Entry 37 7 2 Bug XML Content Written in Wrong Order 39 7 3 Feature Location Privacy Data in Google Chrome 43 2010 Software Diagnostics Experimental Features 5 Part Experimental Features Part IX Problems and Known Issues 47 49 2010 Softw are Diagnostics Part I Quickstart nue Aann uuo au am na A na EEE KARA HEHE Quickstart 7 1 1 1 Quickstart This chapter briefly describes the most important steps for using SD Dev Edition Software Diagnostics Developer Edition My Project Project Utils View Traces Thread 294 Thread 328 Thread 336 Thread 343 Thread 368 m void BuildingReconstructionByCellD void BuildingReconstructionByCel Search BuildingReconstructio n DetermineRoofShape void EuildingReconstructionByCellDecomposition DetermineRoofShape Cell EstimateParametersFromHeights 11 dSam ce 13 8 void Cell CreateParameterTableOptimized void Generate GenerateParameters HeightsForShedRoof E Generate orti found 80 functions and 0 probes ParameterEstimation EstimateSlope
2. 12 poe ig Ox00c nTagstack 30010 mbiaskids 2 walrrayine wostring data class g 7 oxoLcaf rao n 2 xes lsbfe http Jaudacity sourceforge net xml audacityproject 1 3 0 dtd NT ET ubrchrack o wavetradocrp tacchi wavelradh T ed e Open pere Staritsa Bul sa Projectiana NM NS M M E Hd TRUE OE AM OMM dedico de m teen text Hesderi EE 2 per arc31 betafec Conputatona 00 18 7 dges it Predecessors 2010 Software Diagnostics Tutorials 43 7 3 Feature Location Privacy Data in Google Chrome The source code of the open source web browser Google Chrome comprises approximately 4 million lines of code We were interested how Chrome collects privacy data on the user s usage behavior Hence this tutorial reflects a ty pical feature location task Find feature relevant code in weakly known code The trace data for this tutorial is part of the installer of SD Dev Edition You ll find it in the help menu Traced Feature Trace Chrome while the user enables the privacy data feature in the browser s options dialog Grundeinstellungen Privates Datenschutz
3. Probes 9 Trace over with normal Probes 9 Trace Over without Param Probes After TraceOver execution is stopped at the code line that was defined as tracing endpoint The Microsoft Visual Studio debugger is attached to the process and ready for further commands Edit View Project Build Debug Tools Test Window Help Eee Eh p Debug 219 Autos ER RR TEREE Dio ona ek 3 Process 2756 Audacity exe Thread 6404 Main Thread Ww Stack Frame Audacity exe AudacityProje fe 5 gt 9 Disassembly Project cpp ixer c wi 026 expat AudacityProject 3 AutoSavelfNeeded 9 09 filedialog 4276 A libflac 42778 void AudacityProject AutoSaveIfNeeded 8 09 libflac 4278 8 01 libid3tag 4279 if IsAutoSaveEnabled og liblrdf 4280 return user disabled auto save amp libmad i libnyquist 4282 double autoSaveMinutes 2 0 H 4283 gPrefs gt Read wxT Directories AutoSaveMinutes amp autoSaveMinutes 85 01 libogg 4284 8 a 4285 if mAutoSaveFileName IsEmpty A ple 4286 wxGetLocalTime gt mLastAutoSaveTime autoSaveMinutes 60 libsamplerate 4287 4 8 01 libscorealign 4288 We need to auto save so do it EEA libsndfile 4289 AutoSave 8 01 libvamp 4290 GA libvorbis gt 4291 EEA locale 4292 L E
4. Content Einstellungen Internetdaten l schen Google Chrome nutzt m glicherweise Web Services um Ihnen das Surfen im Internet zu erleichtern Sie k nnen diese Services auch deaktivieren Weitere Informationen Vorschl ge f r Navigationsfehler anzeigen Automatische Vorschl ge zur Vervollst ndigung der in die Adressleiste eingegebenen Suchanfragen und URLs DNS Vorabruf zur Verbesserung der Seitenladeleistung verwenden Phishing und Malware Schutz aktivieren Helfen Sie Google Chrome zu verbessern indem Sie automatisch Nutzungsstatistiken und Ausfallberichte an Google senden Netzwerk Richten Sie einen Proxy ein um eine Verbindung zum Netzwerk herzustellen Proxy Einstellungen ndern bersetzen V bersetzung f r fremdsprachige Seiten anbieten Downloads 52 Auf Standardeinstellungen zur cksetzen 2010 Softw are Diagnostics 44 SD Developer Edition Visual Analysis The trace reveals that there are different execution phases Below y ou see the internal workings when the options dialog is painted virtual rogt function ntdll dii 27119d6d tmainCRTStartup _WWinMain 16 int MainDllLoader Launch HINSTANCE union sandbox SandboxInterfaceInfo DIRE _ChromeMain al a O e Pos age Dispatch void views PaintTask Run void
5. 4 5 Probes Probes are tracing components that enrich control flow information sequence of function calls by information on the sy stem state 3 ty pes of probes are available DataProbes e MemAccessProbes ParamProbes 4 51 DataProbes A DataProbe is attached to a code line and a variable that is reachable from this line The DataProbe traces the value of the variable when the control flow passes the code line Hence DataProbes are an automated way ofthe usually tedious debugging cycle of setting a breakpoint breaking execution at a specific code line observing the variable s value and continuing execution until the breakpoint is hit again Another common technique to collect the data that DataProbes provide is to integrate cout or printf statements into the code With DataProbes y ou don t need to change the code and in particular y ou don t need to recompile it Just add a DataProbe where a variable is of interest Setting a DataProbe The prerequisite to setting a probe isthat y our application is not running In the Microsoft Visual Studio code view put the cursor on the code line where y ou want to trace a variable Right click and choose Add DataProbe You can only set DataProbes on code lines that are part of the executable that is currently set as StartUp Project y our Microsoft Visual Studio solution 2010 Softw are Diagnostics 22 SD Developer Edition src toolbars
6. Executable tslaudacitylaudacity src 1 3 11 beta win Debug Audacity exe Parameters i Attach to process Select a process to attach the debugger to Filter Start your application optionally with command line parameters After this the application is started and the SD Recorder pops up which is used to start and stop the tracing 4 3 SD Recorder The SD Recorder is used to start and stop tracing similar to a screen capturing tool SD Tracer Recorder 00 00 0 00 Bytes 0 00 Bytes s Enable Stack Walking 2 short traces almost all calls huge throughput large files You havethe option of defining a threshold value for the polluting functions mechanism 2010 Softw are Diagnostics 20 SD Developer Edition 4 4 Click record and then stop to create a trace You can create several traces without needing to restart y our application After y ou have stopped tracing the trace is automatically imported into SD Dev Edition and visualized Polluting Functions The polluting functions mechanism is a technique to cope with the vast amount of runtime data that is accumulated during long tracing times The mechanism enables y ou to trace for large timeranges up to 30 minutes The key idea is to apply a data mining technique during tracing that identifies polluting functions and to automatically disable the tracing technique for them The data mining technique
7. 1 i Res iew SetFo dView void views RootView PaintNow void Re us Sc nt void views WidgetWin PaintNow gfx Rect const 8 Fo ew Sc nt WidgetWin OnPaint views EnumChildProcForRedraw 11 S w Sc nt views RootView OnPaint void views WidgetWin OnPaint HDC SH ProcessPaint void views RootView OnPaint HWND__ Est ProcessPaint im void views RootView ProcessPaint gfx Canvas z K PaintChildren ui void views View ProcessPaint gfx Canvas ProcessPaint Wi void views View PaintChildren gfx Canvas PaintChildren void views View ProcessPaint gfx Canvas void views View PaintChildren gfx Canvas void views View ProcessPaint gfx Canvas PaintChildren gfx Canvas rocessPaint gfx Canvas 5 PaintChildren gfx Canvas BE void views View ProcessPaint gfx Canvas void views View PaintChildren gfx Canvas LI void views ProcessPaint gfx Canvas views View PaintChildren ProcessPaint ProcessPaint PaintChildren PaintChildren P t ProcessPaint P t Proc aint Pai ren D In the search view we privacy to find any function that is related to privacy data We obtain two results Via the context menu we jump to the point time where ButtonPressed is called Search privacy Found 2 functions and 0 probes 0 results listed Name Info Lo
8. Solutio Sg Class Vi gj Resourc FREIE IE Name de um Find all autosave Match case Subfolders Find Results 1 Ent v Audadity exe AudacityProject AutoSavelfNeeded Line 4291 ce d fs x Audacity exe AudacityProject PushState wxString desc wxString shortDesc bool consoli C _ E ET ET gt E Autos zz Locals iz Threads 24 Modules Watch 1 Find Results 1 Memory Call Stack Breakpoints Command Window Output ss Registers Ready Ln 4291 Coli Chi INS Visual Analysis 2010 Softw are Diagnostics 42 SD Developer Edition In the trace import dialog we do not exclude functions and import the complete trace 22 Import trace Importing C Users Public Documents SD Tracing logs Audacity exe 2010 04 06 10 42 14 profile 2756 sdt Trace Name Audacity exe 2010 04 06 10 42 14 Thread vj 0 Thread 0 Events 740 Short name Polluting Funcs Val File 3 xmlwriter cpp c projects audacity auds Write 2 xmlwriter cpp c projects audacity aude iterator 2 tags h c projects audacity audacity src GetDecimalSeparator 2 internat cpp c projects audacity audac XMLWriter 1 xmlwriter cpp c projects audacity audz D 740
9. 7 nn i invert E operator f pan Ui_ProjectDialog setupui Ui ProjectDialog retranslateUi ProjectDialog qt metacast ProjectDialog qt metacall PathTablewidget metaobject amp _Parameterwideet metaobiect u 9 Single Call View 8x ParameterEstimation EstimateSlope e Soter Function Probe Matrix Matrix e brec sd brec cga Matrix invert 1 c _ brec sd brec cga operator 5 c brec sd brec cga Matrix operator 8 c brec sd brec cga Tracing Methods There are three different waystotrace y our application All three methods are started by clicking the Tracing icon in the Visual Studiotoolbar The methods available are dependent on the state of the Visual Studio debugger 1 StartWithTracing You haven t started your app yet Click the Tracing icon Click Start Debugger The app starts in tracing mode Record a trace with the SD Recorder You always should start tracing with a low polluting functions threshold e g 10 2 Attach ToProcess Your app is running however not under control of the Visual Studio debugger For instance you have started it with Visual Studio s Ctrl F5 StartWithoutDebugging Click Tracing icon Choose the process ID of y our app Click Attach ToProcess With the SD Recorder y ou record a t
10. querystring in SD ANALYS INSERT OR REPLACE INTO directories id parent name location VALUES 7 1 processrunner c projects sd trunk build sd analysis externals processrunner f m 1 0 found 0 functions and 6 probes Qstring queryString unsigned short exeb25ef3a INSERT OR REPLACE INTO directories id parent name location 2010 Softw are Diagnostics Tutorials 39 VALUES 7 1 processrunner c projects sd trunk build sd analysis externals processrunner Right click on the DataProbe record and choose Jump totime e The CallStackView shows an unexpected and surprising fact the database entry is not inserted as part of importFunction as hy pothesized but much earlier in the execution The entry comes in when a PathAssignDialog checks include directories obviously the bug islocated here dEvents QObject int QThreadData dEvent QObject QEvent QMetaObject const SD ANALYSIS UI USECASE MANAGETRACES TraceDialog metaObject void const int SD ANALYSIS UI USECASE MANAGETRACES ImpottTraceDialog qt metacall QMetaObject Call int void void SD ANALYSIS UI USECASE MANAGETRACES ImportTraceDialog importEntire void void SD ANALYSIS UI USECASE MANAGETRACES ImportTraceDialog import bool void SD ANALYSIS UI USECASE MANAGETRACES ImportTraceDialog checkFold basic string char
11. 15 45 01 47 Audacity exe 2010 03 24 15 52 43 42 Audacity exe 2010 03 27 20 56 01 25 635 Audacity exe 2010 03 28 01 56 45 57 447 Audacity exe 2010 03 28 19 07 01 8 177 With it you can remove traces from your SD project that belongs to your current Visual Studio solution Furthermore you can manually add traces Traces are stored SD_TRACING logs app exe lt timestam p gt Choose sdt toimport 2010 Software Diagnostics Part VI Visual Analysis um nee Amas at ann man n na an sa HRR HAR HA 32 SD Developer Edition 6 1 Visual Analysis Imported traces are visualized by a set of synchronized views The main views are the CallStackView the CallGraphView and the SingleCallView Furthermore the Search View is helpful to quickly find entry points in the trace CallStackView eA eh PEEL ENN CO NA vs me v virtual function ntdll dil 77eb9d45 ntdil dil 77eb9d72 kernel32 dll 777f3677 _WinMainGRTStartup Dispatch void nsigned int unsigned int AButton OnMouseEvent wxMouseEvent 8 void AButton Click void void ControlToolBar OnRecord wxComm Add int AudioIO StartStredm WaveTrackArray WaveTrackArray i void AButton Click void diofOListener bool double double UpdatedEvent AudacityProject OnAudiolOStartRecording bool Aud
12. Autos zz Locals a Threa Mod gg Watc Ea Find Mem Lg Breakp 51 Com Output sx Regist Another solution is to detach Microsoft Visual Studio from the process and attach it again The SolutionPreparation Dialog says that y our Visual Studio Project Files are corrupt There are VS projects in your VS solution that refer to VS configurations e g Debug x64 that do not exist Please open lt MS_VS gt s configuration manager dialog in the build menu dialog and check that all projects refer to valid configurations Probes Issues 2010 Softw are Diagnostics 50 SD Developer Edition DataProbes or MemAccessProbes cannot be set You might try toset a Probe on a code line that is not part of the executable that is currently set as StartUp Project y our Microsoft Visual Studio solution Ensure that the correct StartUp Project is chosen Additionally DataProbes and MemAccessProbes are not supported for dynamically loaded DLLs at runtime e g with the LoadLibrary Windows function DataProbes or MemAccessProbes cannot be deleted Clicking on a Probe to delete it just toggles a usual breakpoint Close the respective file and open it again After this deletion should work as expected Visual Analysis Issues Mysterious Call Relations If C exceptions occurred during tracing the call stack is not guaranteed to be recorded in the correct order Hence you
13. might see mysterious call relations in the trace in these situations The CallStackView or the CallGraphView is gone You can move the line between the two views by dragging it with the mouse Moving the linetothe top fully hidesthe CallStackView Moving it tothe bottom hides the CallGraphView To make it visible again grab the line at the top or bottom respectively and move it tothe center again On some Microsoft Windows platforms the line is invisible due to Windows standard GUI style Thelabelsin the CallGraphView are distorted This is probably a problem of your graphics card driver Please download the latest driver from the homepage of your graphics card vendor and install it Another solution is to disable 3D graphics support in general or only for the executable sd tracer exe which is placed in the SD_HOME folder The option for disabling 3D graphics support is ty pically at the same dialog where y ou can change the screen resolution Call markers DataProbes and MemAccessProbes are not shown in the Microsoft Visual Studio code view Close the respectiv e source code file and open it again You may open it with Microsoft Visual Studio or via the context menu on the respective function or call in SD Dev Edition Thecontext menu entry for switching to Microsoft Visual Studio is missing in the CallStackView and the CallGraphView You have started SD Dev Edition as stand alone tool Close SD Dev Edition start M
14. std char traits char gt std allocator lt char gt gt const 8 int SD ANALYSIS UI USECASE MANAGETRACES PathAssignDialog exec void void SD ANALYSIS UI USECASE MANAGETRACES PathAssignDialog ok void Lok addindudeDirectorf addindudeDirectory addIndudeDirectory addInd rectory addExternalindudeDirs addExternalindudeDirs addExt deDirs EINIG CIC Nee in 1 813 Gw Te in ow IC B m icy Em 4 Bug Solution After that discovery the developer set a breakpoint intothe ok method of the PathAssignDialog and continued usual debugging with Microsoft Visual Studio He quickly identified the erroneous logic and fixed the bug 7 2 Bug XML Content Written in Wrong Order The open source audio tool Audacity comprises approximately 200 000 lines of code When recording wave data it triggers an autosave function that automatically stores the current project settings The settings are written into an XML file However the XML content was written in wrong order SD Dev Edition was applied to analyze the autosav e function 2010 Softw are Diagnostics 40 SD Developer Edition A The trace data for this tutorial is part of the installer of SD Dev Edition You ll find it in the help menu File Edit View Transport Tracks Generate Effect Analyze E L RI
15. y ou are interested in performance 2010 Softw are Diagnostics 34 SD Developer Edition 6 2 CallGraphView Jsrc audioio cpp s Isrcjprojatt cpp Jtoolbarsimetertoolbar cpp AudacityProject MayStartMonitoririg 3 2 udacit Projects GetMete ToolBar ER Cor trol ToolBar ClearCutPreview Tracks AudiolO StopStrear m MeterToolBar Clea ControlToolBar SetRe 0 0 T E 0 2 4 fsreftoolbars This view shows call relations between functions Functions are embedded into their module structure i e files and directories Edges are annotated with information on the relative call costs and the call count Optionally the call graph can be restricted to a specific time range For this use the context menu in the CallStackView Toremove a time constraint click on the button that appears in the upper right corner of the CallGraphView Double clicking on a function extends the graph by all called functions with the shift key pressed extends the graph by the functions that call the function that is clicked 6 3 SingleCallView 9 Single call view AudacityProject AutoSave 11 to caller Function Probe Info 99 CreateUniqueName 8 n projects audacity audacity src 1 3 11 beta src project cpp FileNames AutoSaveDir 2 n projects audacity audacity src 1 3 11 beta src filenames cpp xMLFilewriter XMLFil
16. your current task Hence the goal is to doa TraceOver of a reasonably small number of function calls e g 10 000 and trace them with full detail e g with detailed Param Probes Find a good place for a breakpoint Start your app without Visual Studio debugging support Ctrl F5 Do the necessary interactions with y our app Do Attach ToProcess Choose a low polluting functions threshold e g 10 Click Record in SD Recorder Interact with y our app Click Stop Analyze the trace Identify the interesting part of execution i e the responsible call that triggers this part of the execution Switch to Visual Studio s code view via the context menu of the call and place breakpoint Click the Software Diagnostics Stop icon in the Visual Studio toolbar and switch the process to the Visual Studio debugger Click run in Visual Studio and interact with your app such that the control flow hits the breakpoint Do TraceOver If you don t know how many calls are triggered by TraceOver try a polluting functions threshold of 50 100 and do not use Param Probes With Param Probes the polluting functions mechanism won t find many of these functions Analyze the trace and find an even more detailed part of the execution that is of interest Do TraceOver again If you are sure that you trace less than 10 000 calls use DetailedParam Probes to record not only the calls but also all parameter values that are passed into the functions Analyze the tr
17. 010 Softw are Diagnostics art IX Problems and Known Issues uan Problems and Known Issues 49 9 Problems and Known Issues Please send us an email if you have a feature request or any other idea to improve SD Dev Edition service softwarediagnostics com Possible Interferences with Other Development Tools Ifyou are using IncrediBuild Xoreax Ltd you might need to disable its distributed linking feature Tracing Issues Tracing stops immediately after starting There might be the error message that y our application crashed Open folder SD_TRACING logs lt y our app gt Delete all cmd files Your app hangs and cannot be killed Kill all cdb processes After TraceOver Microsoft Visual Studio does not display the call stack and the threads correctly Double click on another thread and than on the original back The call stack and thread window is now as usual Threads I X CallStack 2 10 Categ Name Location Priorit Suspe Name Lanc gt 0 000 Main Thread main Normal 0 0 0 000 Wot Win32 Thread 7742fd31 Highes 0 0 000 Wor Win32 Thread 774300fd Normal 0 E 0x000C Wot Win32 Thread 7742f871 Normal 0 0 000 Wor Win32 Thread 77424871 Normal 0 OtCore4 dll 5bc16f68 0x000C Woi Win32 Thread 77431ee6 Normal 0 gt QtGUI exe main int 0 00000001 char argv 0 C E DIIT axal maimONTCisrtun Lime COS 1 AxiThutan omni
18. 64 operating sy stems environment variable SD HOME sd vsaddin 2008 dll is the Microsoft Visual Studio addin component of SD Dev Edition and is placed in My Documents Visual Studio 2008 Addins e SD Recorder is the trace recording com ponent It is installed into My Documents Traces environment variable SD TRACING All tracesand other documents while using the SD Dev Edition are stored in the location My Documents Traces environment variable SD TRACING e The installer creates the environment variables SD HOME and SD TRACING If y ou encounter problems look at the Problems and Known Issues chapter 2010 Software Diagnostics Part Prepare Your Software System eee nun 12 SD Developer Edition 3 1 Prepare Your Software System Before y ou can use SD Dev Edition toanalyze the dy namics of y our software sy stem y ou need to perform an initial preparation step Initial Preparation SD Dev Edition uses dy namic analysis techniques to create a trace of your system s internal behavior To enable y our system y ou need to perform an initial automated preparation step This step induces complete rebuild of y our code However y ou only need to do this once After this you can develop y our code as usual there is no increased build time or performance overhead at runtime Open your solution y our code in Microsoft Visual Studio Click the prepar
19. 86 3331 microsoft visual studio 9 0 3331 m 1797 Selecton FunctionSelector Dialog 8 Click Apply Selection As you see in the FunctionSelector Dialog y ou can select parts of 3rd party libraries However note that the 3rd party libraries only appear in the dialog because their header files contain compilable code e g due to inlined code or to template usage You will ty pically deactivate tracing for these functions because they implement low level utility functionality For instance the STL internals as part of the microsoft visual studio 9 0 folder in the figure above ty pically won t be of interest Unfortunately interesting API calls to 3rd party libraries are not traceable if you don t have the source code and y ou don t integrate their Microsoft Visual Studio projects into y our application s Microsoft Visual Studio solution A workaround could be to encapsulate a specific API function of interest with a wrapper function that is part of your application This way the call to the wrapper function is traced which provide equivalent information than directly tracing the call tothe original API function 2010 Softw are Diagnostics art IV Trace Your System s Behavior nun na an sa HRR HR Trace Y our System s Behavior 15 4 Trace Your System s Behavior With SD Dev Edition y ou are able to see
20. ControlToolBar cpp at line 1001 Pt Track gt track2 Track 4 trackl Track mList TrackList TrackListNode mindex Int4B mY Int4B mHeight Int4B mName wxString npos Uint4B mDefaultName wxString mSelected Bool mLinked Bool mMinimized Bool vrulerSize wxSize mChannel Int4B mOffset Float mMute Bool mSolo Bool mDirManager DirManager TrackKindEnum Track lt unnamed type TrackKindEnum gt TrackListlterator ControlToolBar double double double Search global variables Add data probe for selected variable s Local Variables You can recursively crawl through all variables that are accessible at the code line Choose a top level or nested variable Global Variables ex perimental Alternatively ty pe a search pattern to search for a global variable Don t start with if you have a large code base Retrieving all matching global 2010 Softw are Diagnostics Trace Y our System s Behavior 23 variables may take a considerable amount of time It s better to start with choosing a more restricted pattern To cancel the operation if it takes toolong click the SD tray icon in Window s menu bar located near Window s clock icon Select variable s to monitor in c projects audacity audacity src 1 3 11 beta src toolbars ControlToolBar cpp at line 1001 Name Type Audacity EffectAutoDuckDialog sm_eventTableEntries wxEventTableEntry 10 Audacity Effect sDefaultGenerateLen
21. H a F 5 1 60 void PaUtil InitializeCpuLoadMeasurer PaUtilCpuLoadMeasurer meas a EH filedialc 6111 8 libflac 62 assert sampleRate gt 0 H A libflac 63 8 GA libid3ta 64 measurer gt samplingPeriod 1 sampleRate E cH liblrdf 65 measurer gt averageLoad 0 H EA libmad 66 H libnyqe 67i L 7 m een void PaUtil ResetCpuLoadMeasurer PaUtilCpuLoadMeasurer measurer m Output Code Definition Window 23 Browser Find Results 1 Item s Saved Ln 64 4 5 3 ParamProbes Param Probes record the parameter values that are passed into the function for each function call Param Probes are not attached to individual code lines such as DataProbes Param Probes are activated globally in the TraceOver dialog Two ty pes of Param Probes exist e ParamProbes This is the light weight approach For each function call the plain 2010 Softw are Diagnostics 26 SD Developer Edition parameter values are recorded If an object pointer is passed into a function for instance only the memory address is recorded For primitive data ty pes such as int float char the real values are recorded MM ADT 5 t eii ve jen ov Hem sE rns mmm Parameters prv local class AudacityProject this Oxaa9ea8d7 prv param char tag 0x04d5ff44 projects prv param char att
22. IAL IVINS bd 247 212 0 2 12 0 9 h x Audio Track 1 0 Selection Start End Length Audio Position 00 00 00 m00 s7 Tracing Audacity is started within the Microsoft Visual Studio debugger F5 As we know where the autosav e function is triggered we set a breakpoint the respective code line File Edit View Project Build Debug Tools Test Window Help Debug m Autos m JAFAR rE EEE ETTA EET Di ER e iE 9 3 E Process 2756 Audacity exe Thread 6404 Main Thread r Y stack Frame Audacity exe AudacityProjet _ ce View city Project cpp 9 22 Audacity c expat Cf filedialog 4276 4 libflac 4277 void AudacityProject AutoSavelfNeeded 9 01 libflac 4278 Cf libid3tag 3 4279 if IsAutoSaveEnabled Cfi liblrdf S 4280 return user disabled auto save E libnyquist Cfi libogg librdf libresample i libsamplerate EF libscorealign g AutoSavelfNeeded double autoSaveMinutes 2 0 gPrefs gt Read Directories AutoSaveMinutes amp autoSaveMinutes if mAutoSaveFileName IsEmpty wxGetLocalTime gt mLastAutoSaveTime autoSaveMinutes 60 We need to auto save so do it 89 01 libsndfile i AutoSave libvamp i lib
23. OListener bool double double It Autosave void void AudacityProject WriteXML XMLWriter 8 B VO AUdSctyProject WANNE SAE RMS 5 G Write Write Write Write Write Write Write St ag WriteAttr X writeattr M writeAttr WW WriteAttr 7 writeattr Lf Lf Df a 7 4 Git Jm JS JS a Ju da pi Aen 4 WriteAttr pente pente 400440042401 n Wavetrack h dirmanager cpp tags cpp Brela cop _ wavetr ck cpp Get ame EE 0 6 1 0 9 1 First Next 0 7 a ll project cpp Visualization V Modules Successors less V Eunctions V Edges g Predecessors Je If Probes are recorded they are shown in the CallStackView too DataProbes and Param Probes are attached to the calls as blue dots Mem AccessProbes appear on top with the arrow symbol you can navigate tothe points in the execution where the Mem AccessProbe was hit This view highlights all occurrences of a function that the mouse is pointing to Right clicking on a function offers y ou a context menu with options to navigate in the CallStackView to create a call graph in the CallGraphView to show the call in the SingleCallView or to jump to Visual Studio s code view Execution time is not shown linearly That is you should use a different view if
24. Ww aay a amp P E Software Diagnostics Developer Edition 1 0 2010 Software Diagnostics SD Developer Edition NA User Guide for Software Diagnostics Developer Edition 1 0 by Software Diagnostics This document describes the features of SD DevEdition and provides quickstart tutorials to enable you to apply the tool right away Throughout the manual the abbreviation SD DevEdition is used to refer to Software Diagnostics Developer Edition Thank you for using Software Diagnostics Developer Edition SD Developer Edition O 2010 Software Diagnostics All rights reserved No parts ofthis work may be reproduced in any form or by any means graphic electronic or mechanical including photocopying recording taping or information storage and retrieval systems without the written permission ofthe publisher Products that are referred to in this document may be either trademarks and or registered trademarks ofthe respective owners The publisher and the author make no claim to these trademarks While every precaution has been taken in the preparation ofthis document the publisher and the author assume no responsibility for errors or omissions or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it In no event shall the publisher and the author be liable for any loss of profit or any oth
25. ace A The search view also searches Param Probes which lets you search for suspicious parameter values 2010 Software Diagnostics Operational Requirements and Installation uan na Wan na HRR HR 10 SD Developer Edition 2 1 2 2 Operational Requirements and Installation This chapter outlines the operational requirements of SD Dev Edition and guides y ou through the installation process Operational Requirements SD Dev Edition depends on software packages of other vendors You need to have installed at least Microsoft Windows XP Microsoft Windows Vista or Microsoft Windows 7 Microsoft Visual Studio 2008 x86 compatible environment on x64 it runsas an x86 application NET Framework 3 5 latest updates Microsoft Debugging Tools for Windows x86 tested with 6 11 1 404 SD Dev Edition requires minimal hardware support Graphics Card with OpenGL 1 4 support Installation If you have a previous version of SD Dev Edition please uninstall this version first before installing the new version The uninstall executable is found in the start menu To install SD Dev Edition run the installer executable The following components installed SD Dev Edition the main application is installed to Program Files Software Diagnostics Developer Edition Program Files x86 Software Diagnostics Dev eloper Edition on x
26. ad 22 4 Audacity exe 2010 03 22_17 21 45 Thread 0 Thread 19 Thread 32 4 Audacity exe 2010 03 22 17 47 46 Thread 0 4 Audacity exe 2010 03 22 23 21 15 Thread 0 Thread 19 Thread 23 Thread 25 4 Audacity exe 2010 03 22_23 31 02 Thread 0 2010 03 11_17 12 58 2010 03 15_13 22 48 Visual Analysis 33 this mAutoSaving int 842203135 Local variables prv local class AudacityProject this 0x03aeb3c8 prv param class XMLWriter xmlFile 0x01 caef98 prv local class Track t prv local class wxString project class wxString prv local class wxString projName class wxString prv local class TrackListiterator iter class TrackListiterator prv local class WaveTrack pWaveTrack prv local unsigned int ndx Call stack class XMLWriter xmlFile 0x01caef98 Single Call View ready Traces Search ityProject WriteXML c projects audacity audacity src 1 3 11 beta src project cpp 2839 LL unsigned int unsigned unsigned int int int unsigned int Bvent wxEvent amp wxEvtHandler IfTableEntryBase const amp wxEvtHandler wxEvent 8 lEvent wxMouseEvent 8 23Click void Event wxEvent 8 wxEvtHandler ableEntryBase const amp wxEvtHandler wxEvent 8 kord wxCommandEvent 8 lack double double double Audiol
27. ations use TraceOver Click a for the TraceOver dialog 2010 Softw are Diagnostics 16 SD Developer Edition mBatch Enable Polluting functions threshold 103 mBatch PopUp short traces almost all calis huge throughput large files void ControlToolBar OnRecord wxCommandEvent t rare irregular calls light throughput small files long traces number of calls to a function per 1 000 000 ticks threshold V Enable stack walking implications if evt GetInt 1 used when called by keyboard shortcut Defi mRecord gt SetShift true if evt GetInt 2 mRecord gt SetShift false lal more less 9 Trace over with detailed Param Probes 9 Trace over with normal Param Probes 9 Trace Over without Param Probes Setting the Code Range Now define the code range totrace The last line of the selection defines a stop tracing breakpoint Hence it defines when tracing is finished Be sure that control passes the last code line of the selected range If this is not the case TraceOver will not stop automatically You then have to stop it manually by clicking the stop icon in the Microsoft Visual Studio SDAddin Toolbar Polluting Function Threshold The polluting function mechanism permits tracing with different tracing granularities For a detailed description see the polluting functions section 2010 Software Diagnostics Trace Y
28. ay choose which loaded dlls to trace Additionally you may exclude functions Visual Studio Debugging After a TraceOver operation the Visual Studio s stop button does not kill the app anymore In contrast Visual Studio detaches itself and keeps the app running 2010 Softw are Diagnostics 18 SD Developer Edition 4 2 2 AttachToProcess AttachToProcess is available via clicking on Gi in the Microsoft Visual Studio SDA ddin Toolbar if y ou started y our application as a freely running process i e without being under the control of the Microsoft Visual Studiodebugger If y ou started your app with the Microsoft Visual Studiodebugger simply detach the Microsoft Visual Studiodebugger Executable ts audacity audacity src 1 3 11 beta win Debug Audacity exe Parameters Start Attach to process Select a process to attach the debugger to Filter Choose the process ID that corresponds to your application You can use the filter text field to quickly find the process Optionally choose select modules to define the loaded dlls and the functions to trace After attaching the tracing engine tothe process the SD Recorder pops up It is used to start and stop the tracing 4 2 3 StartWithTracing StartWithTracing is available via clicking on a in the Microsoft Visual Studio SDAddin Toolbar if y our application is not started y et 2010 Software Diagnostics Trace Y our System s Behavior 19
29. cation namespace PrivacySection ButtonPressed called 1 time s c projects i Call Graph View namespace PrivacySection ResolveMetricsReportingEnabled called 1 time s c projects i Show call graph of selected function anced contents view cc lvanced contents view cc Add selected function to set of start nodes void views View Proct Call Stack View Jump to fe activi of selected function Views View Jump to last activity of selected function ProcessPaint DaintChildran We quickly identify that the class MetricsService is responsible for collecting usage behavior This service is started when the user enables the privacy data feature 2010 Software Diagnostics Tutorials 45 int MainDill s Ni ChromeMain views PaintTask Run Il I views RootView PaintNow 00001 1 11 views WidgetWin PaintNow bool NC bool views AcceleratorHandler Dispatch tagMSG const amp NativeCheckboxWin ProcessMessage unsigned int unsigned int long long iews NativeButtonWin ProcessMessage unsigned int unsigned int long long void views NativeButton ButtonPressed void void Button NotifyClick views Event const amp void anon namespace racySection ButtonPressed views Button views Event const amp 4 void lymous namespace PrivacySection ResolveMetricsReportingEnabled
30. double Audacity EffectAutoDuckPanel sm_eventTableEntries wxEventTableEntry 7 Audacity EffectEqualization curvey float 13 28 Audacity EffectEqualization curveNames i char 13 Audacity EffectEqualization curvex float 28 Audacity EffectAutoDuckDialog sm_eventTable wxEventTable Audacity EffectAutoDuckDialog sm_eventHashTable wxEventHashTable Audacity EffectAutoDuckPanel sm_eventTable wxEventTable Audacity EffectAutoDuckPanel sm_eventHashTable wxEventHashTable Audacity EffectSBSMS blnit bool Audacity Effect Add data probe for selected variable s Deleting a DataProbe After setting a DataProbe a marker is shown at the corresponding line in the Microsoft Visual Studio code view To delete the DataProbe simply click on the marker 2010 Softw are Diagnostics 24 SD Developer Edition File Edit View Project Build Debug Tools Test Window Solution Expl 3 x iS 2 E A 9 ControlToolBar v 2 SetupCutPreviewTracks double v Solution audacii 7 pr p e 995 tracki t d 996 track2 t GetLink t expat i break H CH filedialog EA libflac H A libflac 9 libid3tag if tracki 3 a liblrdf orded no values for Char trackl gt mName m pchData J A libmad 4 5 2 MemaAccessProbes experimental Mem AccessProbes are used to observe read and write ope
31. e solution icon in the Microsoft Visual Studio SDAddin Toolbar stethoscope symbol Microsoft Visual Studio SDAddin Toolbar Choose the configuration that you work with e g Debug and check all projects You have the option to repeat this for other configurations EXPERIMENTAL Tracing optimized code which is typically done in the Release configuration is an experimental feature at the moment Click Patch projects Perform a full build of y our code Click the function selection icon in the Microsoft Visual Studio SDAddin Toolbar f symbol 20 s Microsoft Visual Studio SDAddin Toolbar 7 Check all projects exe dll and uncheck all directories that y ou do not want totrace You typically do not want totrace compiler generated functions and functions from 2010 Software Diagnostics Prepare Your Software System 13 the standard template library STL microsoft visual studio 9 0 SD Developer Edition Function Selector Refine selection of projects and functions you would like to trace Use the Project Selection to specify exdude indude projects The Function Selection shows all available functions of the selected projects and allows more detailed exclude indude Project Selection Function Selection Audacity c 14600 pe gt jects 11269 mod script pipe gt V projects 1 en program files x
32. er commercial damage caused or alleged to have been caused directly or indirectly by this document Author and Company Informations Software Diagnostics August Bebel Stra e 26 53 D 14482 Potsdam Germany CEO Marc Hildebrandt Johannes Bohnet Amtsgericht Potsdam HRB 22123 P Finanzamt Potsdam Stadt Phone 49 331 7062340 Fax 49 331 7062341 EMail mail softwarediagnostics com Internet http www softwarediagnostics com Printed Mai 2010 in Potsdam Germany Version SD Developer Edition 1 0 5400 4 SD Developer Edition Table of Contents Part I Quickstart 11 Tracing Methods 7 12 Tracing Strategies 8 Part II Operational Requirements and Installation 10 2 1 Operational Requirements 10 2 2 Installation 10 Part Prepare Your Software System 12 31 Initial Preparation 12 Part Trace Your System s Behavior 15 4 1 Optional Preparation Step 15 4 2 Start Tracing 15 4 2 1 TraceOver 15 4 2 2 AttachToProcess 18 4 2 3 StartWithTracing 18 4 3 SD Recorder 19 4 4 Polluting Functions 20 4 5 Probes 21 4 5 1 DataProbes 21 4 5 2 MemaAccessProbes experimental 24 4 5 3 ParamProbes 25 Part Import Traces 28 5 1 Create Project Dialog 28 5 2 Import Dialog 28 5 3 Manage and Delete Traces 29 Part VI Visual Analysis
33. ethod The table is filled with several hundred entries Hence the database is accessed frequently when the table is populated Approach with SD DevEdition 1 Set breakpoint in method import Microsoft Visual Studio 2 Open the FunctionSelector Dialog and ensure that the suspicious functions are activated for tracing 3 Add a DataProbe to record the SQL commands that are passed tothe database and open the class that encapsulates the database communication in Microsoft Visual Studio void SQLiteImpl execQuery OSqlQuery amp query const QString amp queryString query exec queryString lastInsertId query lastInsertId toULongLong 4 On the code line query exec right click toadd DataProbe 5 In the dialog choose to observe the variable queryString 2010 Softw are Diagnostics 38 SD Developer Edition 6 Start the application in the usual debugging mode of Microsoft Visual Studio Menu gt Debug Start Debugging 7 Interact with the application such that the import trace feature is activated 8 If the breakpoint is hit the application stops in method import 9 Perform a TraceOver Thereby move the stop breakpoint to the end of the import method 10 Trace without Param Probes 11 Analyze the resulting trace 740 000 calls and 1000 DataProbes were recorded im on im on SD ANALYSIS FACTS mpl importFunction SD ANALYSIS FA Impl in
34. ewriter 1 n projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp XMLFilewriter Open 8 n projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp VarSetter VarSetter 0 n i projects audacity audacity src 1 3 11 beta src project cpp AudacityProject WriteXMLHeader 10 AudacityProject WriteXML 16 n projects audacity audacity src 1 3 11 beta src project cpp n projects audacity audacity src 1 3 11 beta src project cpp n VarSetter VarSetter 8 projects audacity audacity src 1 3 11 beta src project cpp gt xMLFilewriter ClosewithoutEndingTags 8 n projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp AudacityProject DeleteCurrentAutoSaveFile n projects audacity audacity src 1 3 11 beta src project cpp XMLFilewriter xXMLFilewriter 1 n projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp m D use the context menu for more options This view shows all calls for a call foo that are triggered by it in chronological order 2010 Softw are Diagnostics Visual Analysis 35 Hence this is a condensed visualization of the code with all loop structures enrolled by their sequential execution order Cursor enter and backspace keys permit y ou to navigate to subcall or parent calls respectively Right clicking on a function offers y ou a context menu wi
35. icrosoft 2010 Software Diagnostics Problems and Known Issues 51 Visual Studio and start SD Dev Edition again by clicking the respective icon in the toolbar 2010 Softw are Diagnostics 5 software diagnostics O 2010 Software Diagnostics
36. iolO StartPortAudioStream gned int unsigned int sampleFormat OnTrackListUpdated void AudacityPrpject AutoSave void double AudiolO GetBestRate bool bool double ge ex _ OnTrac esized E Tem AudatityProject WritexML AudiolO GetSupportedCaptureRates UpdateVRuler W L WriteXML Upd ler Upd ler Ge ze Up te This view shows the trace in its temporal order the upper overview part the complete trace is depicted You can identify the different phases in the execution The lower part displays a time range in detail For orientation this time range is marked in the overview Time is display ed horizontally from left to right Bars are function calls They are stacked which represents the call stack In contrast to usual debuggers this view permitsthe call stack to be analyzed not for a single point in time but for a full time range Using the mouse wheel you can seamlessly adjust the time range shown 2010 Software Diagnostics Traces 4 Audacity exe Thread 0 4 Audacity exe Thread 0 4 Audacity exe Thread 0 4 Audacity exe 2010 03 18 11 57 56 2010 03 15 13 28 34 4 Audacity exe 2010 03 18 19 09 41 Thread 0 4 Audacity exe 2010 03 19 13 46 52 Thread 0 4 Audacity exe 2010 03 22 10 32 51 Thread 0 Thread 19 Thread 22 4 Audacity exe 2010 03 22_10 44 16 Thread 0 4 Audacity exe 2010 03 22_17 20 15 Thread 0 Thread 19 Thre
37. is steered by a threshold value the polluting functions threshold You should adjust the threshold value according tothe tracing timethat y ou expect A lower threshold value means that fewer functions are contained in the trace However the ones that give you a broad picture of the behavior are guaranteed to remain in the trace There is a trade off Trace for a long time period but receive a coarse grained picture of the behavior only or trace for a short time period and get full details Examples Expected tracing time 10 minutes Threshold value 2 Expected tracing time 1 minute Threshold value 20 Expected tracing time 0 1 seconds Threshold value max The data mining technique is to some degree sensitive tothe algorithmsthat are implemented in y our code Hence y ou need to choose the threshold value that is appropriate for your code and y our problem at hand AN A good strategy isto first use SD Recorder and trace with a low threshold value e g 10 to get an overview of the execution then analyze the trace and identify a key call that triggersthe functionality that is of interest Second set a breakpoint tothe corresponding function and use Microsoft Visual Studio Debugger to navigate tothis point in the execution Third apply TraceOver to obtain a highly detailed trace that only coversthe part ofthe execution that is of interest 2010 Software Diagnostics Trace Y our System s Behavior 21
38. of 740 events remain in this thread after excluding functions Polluting functions threshold to exclude functions 250 no filtering 740 of 740 events remain in all selected threads after excluding functions TT Next we analyze in the CallStackView and the CallGraphView how the XML file is written By pointing on the blue Param Probes circles we understand the order in which the strings are written intothe file As we are in particular interested to understand the context of writing the http audacity sourceforge net string we search for it in the SearchView find the ParamProbe that containsthe string and jump tothe point in time where the ParamProbe was recorded via the context menu on the search result m Par CITIES EE TEE RS mr na DT ps WELL e eE void AcdactyProjektsAutoSave vod I m 1 1 ein 1 I 1 Qa a 3 e ie e inte Von GeDstsFlesDr Do gu gt UMEN Awe wie wie or Navman E Ele this cless XiLrilchr ter oxscbao74e 1 44 40x028 m fp ESH 2 n mane 2 wxString exo VFN table 2272
39. our System s Behavior 17 Param Probes Clicking TraceOver without Param Probes traces function calls Additionally DataProbes and MemAccessProbes are traced if they have been set After tracing the trace is automatically imported into SD Dev Edition and visualized If you want totrace the parameter valuesthat are passed intothe functions click either TraceOver with normal Param Probes or TraceOver with detailed Param Probes Both tracing ty pes slow down execution significantly Hence apply them only if you are sure that less than approx 50 000 function calls are executed in the selected code range Be aware that due to the slow down the polluting function mechanisms will most likely not identify a single function as polluting Hence you trace every call which in turn might increase the number of traced calls TraceOver with normal Param Probes For all function calls the parameter values traced For simple data ty pes such as int char float etc thistracing technique isthe appropriate choice Passed objects however are not resolved Only the pointer value is shown with detailed Param Probes In contrast to normal Param Probes the nested structure of a parameter is resolved Object pointers e g a this pointer are not just pointer values but all their attribute values are resolved This technique is significantly slower than normal Param Probes Select Modules You m
40. race You always should start tracing with small polluting functions threshold e g 10 3 Your app is currently debugged by the Visual Studio debugger and it isin break mode You 2010 Softw are Diagnostics 8 SD Developer Edition 1 2 are probably performing StepInto and StepOver operations to navigate through the execution If you are at a point in the execution where you are not sure if StepIntois a waste of time or if StepOver skips an important part of the execution then use TraceOver Click the Tracing icon Choose the point in the code where tracing should be stopped by clicking the more and less buttons Choose one of the TraceOver options Be sure that the control flow passes the code line where the blue region ends If the control flow misses this point in the code TraceOver won t stop You may be concerned when TraceOver takes a long time and nothing happens In this case use the Stop icon in the Visual Studiotoolbar to interrupt tracing Prepare Your Software System After preparing your software sy stem y ou should at least exclude compiler generated functions and functions of the Standard Template Library STL from being traced Otherwise y ou get huge traces with lots of information on compiler and STL internals For details read the respective chapter Tracing Strategies The main strategy istoidentify the core part of execution that is of interest for
41. rations on memory locations They are in particular helpful to answer questions in situations like this Why does variable X contain an erroneous value e know that the value was still OK when it was accessed at a previous execution point via variable Y When and why did the erroneous value come in To use MemAccessProbes y ou define thecode line where the MemAccessProbe is activ ated thecondition when the MemAccessProbe is activated and thevariable whose memory location is observ ed In the screenshots the MemAccessProbe gets activated when control passes code line 64 of file 2010 Softw are Diagnostics Vi Trace Your System s Behavior 25 pa_cpuload c and the variable sampleRate is equal to 44000 After this every access on the memory location is recorded where the value of the variable measurer gt averageLoad is stored Name measurer gt averageLoad Type Float Size 42 Byte s Useoperator amp write only Condition Activate the Probe when the following expression evaluates to true soolfitee 000 i File Edit View Project Build Debug Tools Test Window Help edo Ep aa Debug Win32 Rh Solutio 2 X _ pa cpuload c win wmme c Keyboard cpp CommandManager cpp Mete 7 Solution a i Audaci cal
42. rs 0x04d5fea0 e DetailedParam Probes This is the heavy weight approach For each function call the parameter value and all further referenced variable values are recorded If an object pointer is passed into a function for instance the memory address and all attributes of the object are recorded This is especially useful as one can look intothis pointer Recording ov erhead for DetailedParam Probes is approximately 10 timeslarger than for normal Param Probes SSS 2010 Software Diagnostics Part V Import Traces um no ZITO CA Aana n ue A na EEE KARA HEHE 28 SD Developer Edition 5 1 5 2 Import Traces After tracing y our application see Trace Your System s Behavior SD Dev Edition starts automatically If this is the first trace you need to create an SD project for your current Visual Studio solution For each recorded trace the Im portDialog of SD Dev Edition automatically pops up which imports the trace into the SD Dev Edition database and prepares it for visual analy sis A are many DLLs used by your application it might take a while until the debug information is loaded and the trace import begins The next trace import will be much faster however when the corresponding pdb files are cached by the operating sy stem s disk caching mechanism Create Project Dialog When importing the very first trace for your current Vis
43. sertfile n DICANO HERES HI id 11 if i n im on impo tion im on impor ction Analysis results Some of the importFunction calls indirectly trigger insertDirectory as hy pothesized e Search for processrunner to find the DataProbe records that are related to the wrong database entry this gives us 6 DataProbe records the last entry shows how the erroneous database entry is inserted processrunner find Name Info string querystring unsigned short exeads 76a querystring in SD ANALYS INSERT INTO files id directory name location VALUES 263 22 processrunnerinput h c projects sd trunk sd analysis externals processrunner processrunnerinput h pal Qstring querystring unsigned short exeaecsi4a querystring in SD ANALYS SELECT id FROM directories WHERE location c projects sd trunk sd analysis externals processrunner QString querystring unsigned short exeaecsi4a querystring in SD ANALYS_ SELECT id FROM files WHERE location c projects sd trunk sd analysis externals processrunner processrunnerinput h m Qstring querystring unsigned short exeb25ef3a querystring in SD ANALYS_ INSERT OR REPLACE INTO directories id parent name location VALUES 22 1 processrunner c projects sd trunk sd analysis externals processrunner string querystring unsigned short exebasef3a
44. th options to navigate in the CallStackView to create a call graph in the CallGraph View to show the call in the CallStackView or tojump to Visual Studio s code view 6 4 SearchView Search data Nane Info Location class wxString exeicaedds name wxstring 00400000 5 c projects audacity audacity src 1 3 11 beta src xml xnlwriter cpp 52 exeee m pchData 004435724 projects class wxString exeicaedee data wxstring ee2eeeee npos exgesaad c projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp 334 exeee m pchData xB4d33194 projects class wxString exeicaedsc name wxstring 00400008 exsesadd c projects audacity audacity src 1 3 11 beta src xnl xmlwriter cpp 103 exeee m pchData xe4d363d4 xmlns class wxString exeicaedee value wxstring 00400000 exgesaad c projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp 103 0x000 m pchData 118 http audacity sourceforge net xml 9 name m pchoata Char cose c projects audacity audacity src 1 3 11 beta src xml XMLWriter cpp 106 a char xe3af118c NONE 5 5 value gt m pchDete char E 7reagacity sourceforge net enl c projects audacity audacity src 1 3 11 beta src xml XMLwriter cpp 106 class wxstring exeicaedeo 5 wxstring 00400000 exsesaad c projects audacity audacity src 1 3 11 beta src xml xmlwriter cpp 247 This view enables
45. the inner workings of y our software sy stem at runtime The behavior is first captured as a trace and then visualized This chapter explains how to create a trace 4 1 X Optional Preparation Step As an optional step you may want torestrict the functions whose calls are captured in a trace To do so follow the instructions given in the preparation chapter 4 2 Start Tracing Click the StartTracing icon a in the Microsoft Visual Studio SDAddin Toolbar Depending on the state of Microsoft Visual Studio y ou have 3 different tracing options 1 TraceOver 2 AttachToProcess 3 StartWithTracing Be aware that tracing refers to the current StartUp Project in your Visual Studio solution Hence assure that the StartUp Project is set correctly before applying tracing 4 2 4 use TraceOver you need to run your application with the Microsoft Visual Studio Debugger Just debug as usual and stop y our application at a breakpoint You have the option of performing the usual Microsoft Visual Studio step over or step into operations to move forward within the execution Debugging ty pically meansthat you have to decide whether to follow a call step into or to skip it step ov At some point this decision is difficult Step into would probably involve wasting time because y ou dive intotoo detailed an execution whereas step over probably moves y ou over important parts of the execution In these situ
46. the quick navigation within the execution to points of interest All data contained in a trace is searched including function names file names and probes Right clicking on a function or probes permits y ou to focus other views on the selected function or probe m 2010 Softw are Diagnostics Tutorials n na an sa HRR HAR HA Tutorials 37 7 Tutorials This chapter shows several case studies in the form of short tutorials toillustrate how SD Dev Edition can be applied to y our development process 7 1 Bug Erroneous Database Entry Bug Description Software Diagnostics Developer Edition is applied during its own development One of our dev elopers noticed that the hierarchical structuring of directories in the call graph view was wrong Hence he checked the database entry for the respective directory processrunner and saw that the entry 1 in the parent row was not correct see screenshot Table directories Y Q New Record Delete Record id parent name location 4 7 1 c projects sd trunk build sd analysis externals processrunner Question and Hypothesis Where in the code when and why is this database entry set During the import of a trace import there is a method importFunctions that indirectly also im ports directory information The developer s first guess was that the bug is located in this m
47. ual Studio solution the Create Project Dialog pops up Ty pically y ou should keep the default values for Name and Project Folder The Source Folder might be shortened to the root folder of y our source code In the case shown below one would remove the win for instance set project name and directories Please enter the name of the project the project directory and the source code directory into the fields below Project Name audacity Project Folder C Users Public Documents SD Tracing Projects audacity Project folder does not exist will be created Source Folder C projects audacity audacity src 1 3 11 beta win Import Dialog After recording a trace the Import Dialog pops up The dialog is used to choose the threads to import and to reduce the size of the trace SD Dev Edition currently supports traces with a maximum size of 200 000 calls Hence you have to eliminate the functions with an extraordinary high call count or polluting function value in the Import Dialog 2010 Software Diagnostics Import Traces 29 First choose the threads to import Second choose for every thread which functions to eliminate from the trace until each thread has a reasonably small number of calls There are three waysto eliminate functions Eliminate functions with polluting function values above a certain threshold For this adjust the threshold value Eliminate functions
48. void Show eBox bool OptionsUtil ResolveMetricsReportingEnabled bool void MetricsService Start void Mess View Init void MetricsService SetRecording bool E E A Add void MetricsService Start void Wa e HUS 21 z m The CallGraphView helps to understand how the control flow is passed from the button click tothe start of the MetricsService Ichromium chromium src ome browser fehromium src News iem cc contrals button chedibox ce 2010 Softw are Diagnostics Part VIII Experimental Features Annn unnt Aann nun n na an sa HRR HAR HA Experimental Features 47 8 Experimental Features Some ofthe features of SD Dev Edition are experimental Tracing optimized code Tracing your application in the Release configuration might crash y our application in specific circumstances To avoid this trace your application in the Debug configuration MemAccessProbes The size of the memory location that is observed by a MemAccessProbe cannot be resolv ed automatically in specific circumstances Setting a wrong size might cause SD Dev Edition to ignore the MemAccessProbe DataProbes on Global Variables Obtaining the list of global variables in the DataProbe dialog might take a long time 2
49. vorbis locale Solutio 9 Class Vi Resourc Find Results 1 8 X Name E Find all autosave Match case Subfolders Find Results 1 Ent 4 Audacity exe AudacityProject AutoSavelfNeeded Line 4282 1 I m x Audacity exe AudacityProject PushState wxString desc wxString shortDesc bool consoli C _ tari A gt z xa eel Autos zz Locals Threads 4 Modules 3 Watch 1 Find Results 1 2 Memory 1 Call Stack Lj Breakpoints Command Window Output 54 Registers Ready Ln 4282 Coll Chi INS When the execution hits the breakpoint we press the Tracing icon in the Microsoft Visual Studio SDAddin Toolbar In the TraceOver dialog we define the tracing endpoint line 4291 2010 Software Diagnostics Tutorials 41 As we know that autosave triggers less than 5 000 calls we press TraceOver with Detailed Param Probes Settings Polluting functions threshold 250 void AudacityProject AutoSavelfNeeded short traces almost calls if IsAutoSaveEnabled huge throughput large files return user disabled auto save rare irregular calls light throughput small files long traces polluting functions 9 Trace over with detailed
50. with high call counts For this sort thelist mark a function hold the shift key mark another function and deselect the functions by pressing the space key Deselect individual functions Importing C Users Public Documents SD Tracing logs Audacity exe 2010 04 02__01 34 23 profile_5888 sdt Trace Name Audacity exe 2010 04 02 01 34 23 Thread Function Executions Thread 0 v 0 21 542 Init lal Short name UpdatedEvent TP_DisplayStatusMessage SetCursorAndTipWhenSelectTool SelertinnHandleDran 28 track cpp c projects audacity audacity 28 track cpp c projects audacity audacity 22 project cpp c projects audacity audacit 22 trackpanel cpp c projects audacity aud 22 tracknanel cnn c nrniect audacitv aud 7 8752 of 21542 function executions remain in this thread after excluding functions Exdude functions if their frequency exceeds 40 executions per million ticks 8 752 of 21 542 function executions remain in all selected threads after excluding functions 5 3 Manage and Delete Traces In the menu of SD Dev Edition y ou will find the Manage Traces Dialog 2010 Softw are Diagnostics 30 SD Developer Edition Calls Audacity exe 2010 03 23 14 02 25 22 751 Audacity exe 2010 03 23 14 25 24 11175 Audacity exe 2010 03 23 16 07 38 20 597 Audacity exe 2010 03 24

Download Pdf Manuals

image

Related Search

Related Contents

Steam Jacketed Kettle, Model DH(CE)  Bedienungsanleitung  UM10120 Volume 1: LPC213x User Manual  A user's manual for shortran  atterrissage train principal non verrouillé. Cause identifiée    Esempio di dichiarazione impianto di riscaldamento  Miele T 1339 C Clothes Dryer User Manual  12v thermoelectric cooler/warmer refroidisseur / réchauffeur  Eglo MARATEA 1  

Copyright © All rights reserved.
Failed to retrieve file