diff options
author | 2024-12-18 16:07:31 +0000 | |
---|---|---|
committer | 2025-01-05 10:59:15 +0000 | |
commit | 40c1735233e4346abb6802d990d3d99f313d8954 (patch) | |
tree | 3f56f22dfc61d229571dfdad3d479a68e113ca14 /resources/libraries/python/TelemetryUtil.py | |
parent | 6a7b3bab2ca79b728f11d0e82cbcea621d45c8d0 (diff) |
fix(telemetry): fix perfmon issues on Arm
To enable perfmon plugin on AArch64, users have to set
kernel/perf_user_access to 1 to allow userspace applications to directly
access PMU counters. Additionally, replace bundle cache-hierarchy with
bundle cache-data as it is the correct bundle name on AArch64.
Signed-off-by: Jay Wang <jay.wang2@arm.com>
Change-Id: I67b86e255c8e62d3672a8f52db88eed3daf6ff59
Diffstat (limited to 'resources/libraries/python/TelemetryUtil.py')
-rw-r--r-- | resources/libraries/python/TelemetryUtil.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/libraries/python/TelemetryUtil.py b/resources/libraries/python/TelemetryUtil.py index 63d0bf60a7..1dbb2d45a3 100644 --- a/resources/libraries/python/TelemetryUtil.py +++ b/resources/libraries/python/TelemetryUtil.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Cisco and/or its affiliates. +# Copyright (c) 2025 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -16,7 +16,8 @@ from resources.libraries.python.model.ExportResult import append_telemetry from resources.libraries.python.Constants import Constants from resources.libraries.python.ssh import exec_cmd_no_error -from resources.libraries.python.topology import NodeType +from resources.libraries.python.topology import Topology, NodeType +from resources.libraries.python.SysctlUtil import SysctlUtil __all__ = ["TelemetryUtil"] @@ -51,6 +52,10 @@ class TelemetryUtil: cd_cmd += f"sh -c \"cd {Constants.REMOTE_FW_DIR}/" cd_cmd += f"{Constants.RESOURCES_TOOLS}" + # Allow userspace to directly access perf counters on aarch64 + if Topology.get_node_arch(node) == u"aarch64": + SysctlUtil.set_sysctl_value(node, u"kernel/perf_user_access", 1) + if spath: bin_cmd = f"python3 -m telemetry --config {config} --hook {spath}\"" else: |