############################ begin_copyright_notice ############################
### Copyright (C) 2015-2024 Intel Corporation
### 
### SPDX-License-Identifier: MIT
############################ end_copyright_notice ##############################

GTPin Tool Examples

GTPin provides the sources of its tools under '<gtpin_kit>\examples' folder.
Tools' dll's are also provided in 'examples\ia32' (for 32-bit) and 'examples\intel64' (for 64-bit).
A user can extend given tools or create new ones (with appropriate changes in 'examples\CMakeLists.txt' file).
To build extended/new tools, please follow this guideline:

BUILDING GTPin Tool
-----------------------
** Step 1: Add new tool to 'examples\CMakeLists.txt' (only necessary if you created a new tool)
** Within the 'CMakeLists.txt' file, add your tool's name to the "Examples" lists:
  > set ( EXAMPLES          funtime ... <YOUR_TOOL_NAME>)
** Add your tool to the "add_library" section:
  > add_library( <TOOL_NAME> SHARED <TOOL_NAME>.cpp )
** Step 2: Generate examples solution
** Within 'examples' folder, in a command line window:
> mkdir build
> cd build
* on Windows,
  > cmake .. -G <cmake's generator> -DARCH=<arch> -DGTPIN_KIT=<gtpin_kit>
  * cmake's generator = "Visual Studio 15" (for 32-bit) / "Visual Studio 15 Win64" (for 64-bit) - to verify the build works as expected
  * arch = ia32 (for 32-bit) / intel64 (for 64-bit)
  * gtpin_kit = absolute path to your GTPin kit
  E.g. "cmake .. -G "Visual Studio 15 Win64" -DARCH=intel64 -DGTPIN_KIT=C:\GTPin\Profilers"
* on Linux,
  > cmake .. -DCMAKE_BUILD_TYPE=<config> -DARCH=<arch> -DGTPIN_KIT=<gtpin_kit>
  * config = Release/Debug
  * arch = ia32/intel64
  * gtpin_kit = absolute path to your GTPin kit

** Step 3: Build examples solution generated in previous step
* to build on Windows, you can use the GTPin_Example.sln OR run
  > cmake --build . --config <config> --target install
  * config = Release/Debug
* to build on Linux:
  > make -j 8 install

RUNNING GTPin Tool
-----------------------
> <gtpin_kit>/Bin/gtpin.exe -t <gtpin_tool> [GTPin args] -- <app> [App args]
* gtpin_kit = path to your GTPin kit
* if you want to run tool provided with GTPin kit:
  * gtpin_tool = name of tool, e.g. 'funtime'
* if you want to run extended/new tool of your own that was built with aforecited guideline:
  * gtpin_tool = <gtpin_kit>\examples\build\<Release/Debug>\<tool_name>.dll (path to your tool's dll)
  E.g. C:\GTPin\Profilers\examples\build\Release\funtime.dll
* GTPin args = see arguments specifications on gtpin.exe --help

* more info about running gtpin tool on http://goto/gtpin