Граф коммитов

6 Коммитов

Автор SHA1 Сообщение Дата
Jonathan R. Madsen 086218c2eb Fixes licensing in files (#206)
* Update LICENSE

- fix inconsistencies

* Revert lib/rocprofiler/counters/parser/scanner.cpp

* Update lib/rocprofiler/counters/tests/dimension.cpp

- revert ending curly brace

* Revert missing curly braces

- missing curly braces when file did not end with a new line
2023-11-14 10:58:33 -06:00
Jonathan R. Madsen 7f631de401 Separate agent cache from queue controller (#145)
* Update lib/rocprofiler/agent.{hpp,cpp}

- get_agents() function for internal access to agent pointers

* Update AgentCache

- make member variables and member functions distinguish b/t hsa agent and rocprofiler agent clear

* Change ctor of AgentCache

* Update lib/rocprofiler/hsa/queue_controller.cpp

- QueueController::init uses agent::get_agent_cache

* Update lib/rocprofiler/hsa/agent_cache.*

- member function to get index
- operator== for rocprofiler_agent_t and hsa_agent_t
- removed hsa_iterate_agents from ctor (now in agent.cpp)

* Update lib/rocprofiler/agent.*

- construct_agent_cache function
- functions for rocprofiler agent <-> HSA agent
- functions for getting agent cache

* Update lib/rocprofiler/registration.cpp

- invoke construct_agent_cache when HSA table is receieved

* Update lib/rocprofiler/agent.cpp

- loosen failure conditions
- handle spurious duplicate entry warning

* Update lib/rocprofiler/agent.cpp

- improve read_map diagnostics

* Update lib/rocprofiler/agent.cpp

- avoid infinite loop in read_map

* Update lib/rocprofiler/agent.cpp

- handle empty kfd node properties file

* Update lib/rocprofiler/agent.cpp

- check for permissions to read a node properties file

* Update lib/rocprofiler/agent.cpp

- more checks on file readability

* Update lib/rocprofiler/tests/agent.cpp

- print virtual kfd topology

* Update lib/rocprofiler/tests/agent.cpp

- verify id.handle == hsa_agent internal node id

* Update lib/rocprofiler/tests/agent.cpp

- check node_id
- check location id
- check device id
- update abi test

* Update include/rocprofiler/agent.h

- add node_id field
- add reserved0 field to ensure new field increases struct size

* Update lib/rocprofiler/agent.cpp

- node_id instead of id.handle

* Update lib/rocprofiler/agent_cache.cpp

- node_id instead of id.handle

* Update samples/pc_sampling

- node_id for agent instead of id.handle

* Update lib/rocprofiler/buffer.cpp

- remove debug prints
2023-10-19 19:04:02 -05:00
Jonathan R. Madsen d1518c65b2 Miscellaneous Updates (const-correctness, logic fixes, etc.) (#126)
* Update lib/rocprofiler/hsa/hsa.cpp

- fix logic for constructing callback_contexts and buffered_contexts arrays

* Update include/rocprofiler/{agent,fwd,pc_sampling}.h

- remove rocprofiler_pc_sampling_config_array_t due to const problems
- update rocprofiler_agent_t to use arrays to const data
- remove redundant rocprofiler_query_pc_sampling_agent_configurations
  - this implementation is quite literally looking up info in the agent struct that was passed

* Update lib/rocprofiler/pc_sampling.cpp

- remove rocprofiler_query_pc_sampling_agent_configurations

* update lib/rocprofiler/agent.cpp

- handle const fields
- make mi200_pc_sampling_config variable static

* Update lib/rocprofiler/tests/agent.cpp

- tweak to pc_sampling_configs offset

* Update samples/pc_sampling

- Update sample to reflect minor tweaks to pc_sampling_configs in rocprofiler_agent_t

* Update CI workflow

- remove 'if: ${{ always() }}'
  - I suspect this is why the jobs do not cancel in progress correctly
2023-10-17 00:39:41 -05:00
Jonathan R. Madsen a798a26227 Agent information w/o using hsa-runtime (#100)
* Agent information w/o using hsa-runtime

- remove lib/rocprofiler/hsa/agent.{hpp,cpp}
- update include/rocprofiler/agent.h
  - basically all possible info from /sys/class/kfd/kfd/topology/nodes/*

* Print topology in rocprofiler_lib.agent test

- hack to help diagnose errors

* Update lib/rocprofiler/tests/details/agent.cpp

- use LOG_IF(WARNING, ...) instead of LOG_IF(FATAL, ...)

* Update lib/rocprofiler/tests/agent.cpp

- print rocminfo at beginning of test
- fix comparison of agent handle
- misc other checks

* Updte lib/rocprofiler/agent.cpp

- handle unreadable /sys/class/kfd/kfd/topology/nodes/<N>/properties file

* Update lib/tests/buffering/CMakeLists.txt

- increase timeout to 120
  - buffering.parallel will timeout when thread sanitizing is enabled

* Update cmake: rocprofiler-drm

- find drm headers and libraries

* Update include/rocprofiler/agent.h

- add family_id field

* Update lib/rocprofiler/agent.cpp

- parse /proc/cpuinfo for name, family, apicid, etc.
- read_topology uses unique pointers to cleanup memory allocations
- implement name and gfxip

* Update lib/rocprofiler/tests/agent.cpp

- improved failure message
- check name/gfxip
- remove check against hsa_agent_t.handle
  - this value is dependent on the address of C++ class

* Update lib/rocprofiler/tests/details/agent.cpp

- tweak gfxip_ variable which is broken for CPU

* Update lib/rocprofiler/agent.cpp

- update string handling for name and gfxip

* Update lib/rocprofiler/tests/agent.cpp

- minor output tweak

* Update lib/rocprofiler/registration.{hpp,cpp}

- registration::init_logging() function

* Update lib/rocprofiler/agent.cpp

- fix hex handling of GFX step version

* Update lib/rocprofiler/tests/details/agent.cpp

- fix format string when nearest CPUs not found

* Update lib/rocprofiler/tests/CMakeLists.txt

- exclude details/agent.cpp from being parsed for gtest tests

* Update include/rocprofiler/fwd.h

- add ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_ABI status

* Update lib/rocprofiler/tests/details/agent.{hpp,cpp}

- replace with slightly modified implementation of rocminfo
  - primary change was not printing

* Update lib/rocprofiler/tests/agent.cpp

- update test to use rocminfo data

* Update lib/rocprofiler/agent.cpp

- add pc_sampling_configs
- return error on incompatible ABI

* Update counters and counters tests

- rename test names for consistency
- fixed incorrect spelling of derived

* Add lib/rocprofiler/tests/{timestamp,version}.cpp

- add timestamp and version tests for rocprofiler_get_timestamp and rocprofiler_get_version, respectively

* Update lib/rocprofiler/tests/agent

- fix double free of name_str from isa_info_t

* Update include/rocprofiler/agent.h

- comments for rocprofiler_agent_mem_bank_t
- add rocprofiler_dim3_t
- comments for rocprofiler_agent_t
- add new fields to rocprofiler_agent_t
    - cu_count
    - workgroup_max_size
    - workgroup_max_dim
    - grid_max_size
    - grid_max_dim
    - vendor_name
    - product_name
- change prototype of rocprofiler_available_agents_cb_t to be const agent**

* Update lib/rocprofiler/agent.cpp

- set size field
- implement:
  - product_name
  - vendor_name
  - workgroup_max_size
  - workgroup_max_dim
  - grid_max_size
  - grid_max_dim
  - cu_count

* Update lib/rocprofiler/tests/agent.cpp

- changes for const agent*

* Update samples/pc_sampling

- updates for const agent*

* Update lib/rocprofiler/agent.cpp

- fix ABI compatibility check
  - return incompatible if tool agent is larger than our agent

* Update include/rocprofiler/agent.h

- doxygen comments
- make size field of rocprofiler_agent_t uint64_t for consistency
- add gpu_id via /sys/class/kfd/kfd/.../<idx>/gpu_id
- add model_name via /sys/class/kfd/kfd/.../<idx>/name

* Update lib/rocprofiler/agent.cpp

- add read_file function (vector of strings)
- support enum in read_property
- assign model_name and gpu_id fields
- remove unique_id

* Update lib/rocprofiler/tests/details/agent.*

- support family id, ucode_version, sdma_ucode_version

* Update lib/rocprofiler/tests/agent.cpp

- Add rocprofiler_lib.agent_abi test
- Verify family_id, ucode_version, sdma_ucode_version
2023-10-10 18:10:23 -05:00
Jonathan R. Madsen 34505943b2 Linting workflow and clang-tidy fixes (#72)
* Update source/{bin,lib/{common,rocprofiler}}/CMakeLists.txt

- activate clang-tidy

* Update PTL submodule

- clang-tidy fixes

* Update .clang-tidy

- ignore performance-enum-size

* Update CI workflow

- update paths-ignore

* Add linting workflow

- runs clang-tidy

* Update cmake/rocprofiler_build_settings.cmake

- minor modification of flags not recognized by clang-tidy

* Update samples (all of them)

- rocprofiler-samples-build-flags target with -W -Wall -Wextra -Wshadow [-Werror]
- Link samples targets to rocprofiler-samples-build-flags if target exists
- Remove unused variable in main.cpp of api_{buffered,callback}_tracing
- Update samples/pc_sampling
  - single-user-multiple-agents.cpp ends up with unused function find_first_gpu_agent() error
  - change find_first_gpu_agent to return std::optional<rocprofiler_agent_t>
  - change usage after call to find_first_gpu_agent()
  - use find_first_gpu_agent() in single-user-multiple-agents.cpp to determine if there are any GPUs

* Update linting workflow

- fix path to run-ci.py script

* Update linting workflow

- install cmake

* Update common/container/stable_vector.hpp

- fix clang-tidy warning for readability-container-size-empty
2023-09-21 14:35:20 -05:00
vlaindic 76717efa64 PC sampling examples: single user, multiple agents (#31)
* PC sampling examples: single user, multiple agents

The example assumes that a single user activates PC sampling service
on multiple agents. Preferably, the user chooses stochastic sampling
over host-trap sampling.

* cmake formatting (cmake-format) (#33)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* source formatting (clang-format v11) (#32)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* pc sampling samples: anynomus namespace and string_view

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>
2023-08-30 17:08:48 -05:00