How to Run and Get Task detail - How to Run and Get Task detail - 57368

uProf User Guide

Document ID
57368
Release Date
2025-06-09
Revision
5.1 English

You start with a source code, where some code snippets to be defined as tasks and then using profiling with proper configuration, you get defined task details (time information etc.) in the report.csv. Presently, it is supported in CLI mode profiling only and no GUI is supported.

  1. Have your buildable source code to be profiled with Task APIs.
  2. Instrument the source code with task APIs.
    1. Include the header AMDProfileController.h in the source file where you want to create a task. Path of this header is:
      <Installation Directory>/include/AMDProfileController.h
      Example:
      ~/Foo/Bar/AMDuProf_Linux_x64_5.0.775/include/AMDProfileController.h
      Hence that folder must be in the include path, while building the instrumented application.
    2. Create domain and get domain handle using amdDomainCreate(…).
    3. Create string handle, using amdStringHandleCreate(…), which is used to name a task.
    4. Using domain handle and string handle create a task and mark the start of the task – both are done with single call amdTaskBegin(…) and then your code (which is part of the task) comes.
    5. Call amdTaskEnd(…) to mark the end of the task.
    6. Can add more than one tasks in similar way.
  3. For linking, the library user must include the library path of libAMDProfileController.so whose path is: <Installation Directory>/lib/x64/shared/libAMDProfileController.so.
  4. Build the instrumented application.
  5. Run the application under CLI profiler:
    $ AMDuProfCLI collect --config tbp -o <outputFolderPath> <applicationNameToBeProfiled>
  6. Generate the report: (i)
    $ AMDuProfCLI report –i < outputFolderPath > or (ii) detailed report: AMDuProfCLI report –i < outputFolderPath > --detail
    1. Summary report:
       $ AMDuProfCLI report –i < outputFolderPath >
    2. Detailed report:
      $AMDuProfCLI report –i < outputFolderPath > --detail

Examples codes are given for different use cases in the following directories:

  1. C++: <Installation Directory>/Examples/ClassicDomainTaskAPI
  2. Python: <Installation Directory>/Examples/ClassicDomainTaskAPI/python