I don't have source code. Can I use Intel® Thread Checker?
Yes. For example: You are using an executable file from another vendor, so you don't have source code to it. But you are interested in diagnostics about a library (.dll or .so file) that is loaded by the vendor's executable file. You may not even have source code for the library that gets loaded. You can still use Thread Checker to see if any threading diagnostics are detected.Of course, if you really want to correct threading issues, you'll need source code.
DOS* Shell Redirection for Input (<) or Output (>)
My application uses DOS* command-shell redirection for input (<) or output (>). Can I still use Intel® Thread Checker? Yes. Use a .BAT file as the application. For example, create a myStart.bat file with this line:
myProgram.exe < myInputFile > myOutputFile
And then follow the steps:
- Specify myProgram.exe as the Application to launch with the Intel® Thread Checker Wizard.
- Enable (check) Modify default configuration when done with wizard.
- Select Advanced Activity Configuration » Application/Module profiles.
- Select your application, which would be myProgram in this example, and then press the Configure... button.
- Disable (un-check) Add to Modules of Interest List, and then change the Application to Launch Filename: from myProgram.exe to myStart.bat.
Collecting Thread Checker Diagnostics Outside of the VTune™ Environment
To collect diagnostics outside of the VTune™ environment, follow this process:
Keep in mind that when collecting data outside of the VTune environment, only software that has been source instrumented will be analyzed by Thread Checker. Therefore, threading errors in the not instrumented software may be missed. To ensure that all run-time code is instrumented, you must run from within the VTune environment or Microsoft .NET* Developer Environment.
- Compile your software using an Intel® Compiler and the /Qtcheck (on Microsoft Windows*) or -tcheck (on Linux*) switch. This option enables source instrumentation.
- Start your software as usual from the Windows*, DOS* or Linux* environment. For example, use Windows Explorer* to browse to your executable file and double-click on that file name.
- Run your software until it terminates normally. Don't forget to reduce your workload. Also because your software is instrumented, expect that it will run slower than usual.
- Exit (quit) your software, and a Thread Checker results ("*.thr") file is written to the working folder. If you are running on a Linux* system, transfer the .thr results file back to a Microsoft Windows* system (with Thread Checker installed) for viewing.
- To view the results file with Windows* Explorer, simply double-click the file. Alternatively you can start the VTune environment and open it with the File » Open File ... (NOT Open Project...) dialog. Important: Don't forget to set the file type to *.thr when using this dialog.
Note: Many third-party libraries, such as MFC* (Microsoft Foundation Class*) libraries, create and use threads. Therefore, software that uses MFC should always be run from within the VTune environment or Microsoft .NET* Developer Environment
Analyze Multiple Processes or Executables
Intel® Thread Checker only supports one process (executable) when run from within either the VTune™ environment or Microsoft .NET* Developer Environment. Furthermore, Thread Checker only supports finding diagnostics within one process; that is it will not produce diagnostics for synchronization objects shared between processes. However if your software launches another process, Thread Checker can still be used to find threading diagnostics within either process. To use Thread Checker for either process, use source instrumentation and run your software outside of the VTune™ environment.
Using Intel® Thread Checker with Applications That Have to be started Outside of VTune
- Start VTune™ Performance Analyzer.
- Start Intel® Thread Checker Wizard to create a new project.
- Uncheck (de-select) Launch an Application.
- Check (select) Modify default configuration when done with wizard, and then click Next.
- Fill in your Modules of Interest. This should be your application and the DLLs (that you have symbols for) that your application depends on as it runs.
- Click Finish.
- Click Configure button to setup the Thread Checker data collector, and the select the Module Instrumentation tab.
- In the row with YourApp.exe, set the Force Instrumentation column to Yes. If you click No in this column, a drop down menu will appear to let you set it to Yes.
Note: If you don't see the Force Instrumentation column, then you didn't Uncheck Launch an Application as described in step 3 above.
- Click OK for each of the two dialog boxes. Thread Checker will begin to instrument your software. Please be patient as this will take a while (usually several minutes).
- When Instrumentation has completed, Thread Checker will bring up a message box saying "It is time to run your application...". Click OK.
- Start your software in the usual manner from the Windows* desktop. Wait patiently for your software to complete and/or run your software until you have executed the code path(s) of interest. Execution speed will be much slower than normal as Thread Checker needs to collect a lot of data as it monitors all threads in your software; so don't forget to reduce your workload.
Please Note: If you must abnormally terminate your software, you should use Windows Task Manager* and not the VTune environment Activity » Stop menu.
- When your software has terminated, go to the VTune environment and use the Activity » Stop menu (or Shift-F5) to stop Thread Checker data collection. Thread Checker results will be loaded and displayed in the VTune environment.