Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe6d343f53 | ||
|
|
a841d98075 | ||
|
|
80e4efaf43 | ||
|
|
e467a0a7e0 | ||
|
|
9a656ce36f |
4 changed files with 6 additions and 235 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -10,3 +10,4 @@
|
|||
/umr-1.0.8.tar.gz
|
||||
/umr-1.0.9.tar.gz
|
||||
/umr-1.0.10.tar.gz
|
||||
/umr-1.0.11.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,228 +0,0 @@
|
|||
From 56aaa3a997740dc223d01d3106cbab1640fe0e32 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
|
||||
Date: Fri, 31 Jan 2025 12:25:47 +0100
|
||||
Subject: [PATCH] Fix warnings treewide.
|
||||
|
||||
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
|
||||
Change-Id: Ic5f3611b3a8448e490c149785a4cad4916e3d7be
|
||||
---
|
||||
src/app/gui/commands.c | 2 +-
|
||||
src/app/server.c | 2 +-
|
||||
src/app/top.c | 3 ---
|
||||
src/app/vbios.c | 2 +-
|
||||
src/lib/lowlevel/linux/umr_clock.c | 7 ++++++-
|
||||
src/lib/rumr/rumr_serial_asic.c | 2 ++
|
||||
src/lib/testing_harness.c | 4 ++++
|
||||
src/test/test_server.c | 16 ++++++++--------
|
||||
8 files changed, 23 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/app/gui/commands.c b/src/app/gui/commands.c
|
||||
index 9477eee..ac32af8 100644
|
||||
--- a/src/app/gui/commands.c
|
||||
+++ b/src/app/gui/commands.c
|
||||
@@ -1584,7 +1584,7 @@ static void ring_done(struct umr_stream_decode_ui *ui) {
|
||||
struct umr_asic *asics[16] = {0};
|
||||
char *ip_discovery_dumps[16] = {0};
|
||||
|
||||
-void init_asics() {
|
||||
+void init_asics(void) {
|
||||
struct umr_options opt;
|
||||
char devname[512];
|
||||
int index = 0;
|
||||
diff --git a/src/app/server.c b/src/app/server.c
|
||||
index 6d8e6cd..d968d60 100644
|
||||
--- a/src/app/server.c
|
||||
+++ b/src/app/server.c
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "parson.h"
|
||||
|
||||
extern JSON_Value *umr_process_json_request(JSON_Object *request, void **raw_data, unsigned *raw_data_size);
|
||||
-extern void init_asics();
|
||||
+extern void init_asics(void);
|
||||
extern struct umr_asic *asics[16];
|
||||
|
||||
void run_server_loop(const char *url, struct umr_asic * asic)
|
||||
diff --git a/src/app/top.c b/src/app/top.c
|
||||
index a148599..9318085 100644
|
||||
--- a/src/app/top.c
|
||||
+++ b/src/app/top.c
|
||||
@@ -1127,7 +1127,6 @@ void umr_top(struct umr_asic *asic)
|
||||
struct timespec req;
|
||||
uint32_t rep;
|
||||
time_t tt;
|
||||
- uint64_t ts;
|
||||
char hostname[64] = { 0 };
|
||||
char fname[64], *e;
|
||||
pthread_t sensor_thread;
|
||||
@@ -1193,7 +1192,6 @@ void umr_top(struct umr_asic *asic)
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = 1000000000/rep; // 10ms
|
||||
|
||||
- ts = 0;
|
||||
while (!top_options.quit) {
|
||||
for (i = 0; stat_counters[i].name[0]; i++)
|
||||
memset(stat_counters[i].counts, 0, sizeof(stat_counters[i].counts[0])*32);
|
||||
@@ -1215,7 +1213,6 @@ void umr_top(struct umr_asic *asic)
|
||||
}
|
||||
}
|
||||
nanosleep(&req, NULL);
|
||||
- ts += (req.tv_nsec / 1000000);
|
||||
}
|
||||
move(0, 0);
|
||||
clear();
|
||||
diff --git a/src/app/vbios.c b/src/app/vbios.c
|
||||
index a05a5c5..bb3427e 100644
|
||||
--- a/src/app/vbios.c
|
||||
+++ b/src/app/vbios.c
|
||||
@@ -50,4 +50,4 @@ int umr_print_vbios_info(struct umr_asic *asic)
|
||||
|
||||
close(asic->fd.drm);
|
||||
return 0;
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
diff --git a/src/lib/lowlevel/linux/umr_clock.c b/src/lib/lowlevel/linux/umr_clock.c
|
||||
index a847f1e..70dcaab 100644
|
||||
--- a/src/lib/lowlevel/linux/umr_clock.c
|
||||
+++ b/src/lib/lowlevel/linux/umr_clock.c
|
||||
@@ -21,6 +21,7 @@
|
||||
*
|
||||
*/
|
||||
#include "umr.h"
|
||||
+#include <time.h>
|
||||
|
||||
/**
|
||||
* umr_read_clock - Read a clock information via sysfs
|
||||
@@ -67,13 +68,17 @@ int umr_set_clock(struct umr_asic *asic, const char* clock_name, void* value)
|
||||
int fd;
|
||||
int input_flag = 0;
|
||||
char input[8];
|
||||
+ struct timespec wait = { 0 };
|
||||
uint32_t input_len = strlen(value);
|
||||
int ret = -1;
|
||||
|
||||
umr_set_clock_performance(asic, "manual");
|
||||
strcpy(input, value);
|
||||
input[input_len] = ' ';
|
||||
- sleep(0.5);
|
||||
+
|
||||
+ wait.tv_nsec = 500 * 1000000; /* 500 ms */
|
||||
+ nanosleep(&wait, NULL);
|
||||
+
|
||||
snprintf(name, sizeof(name)-1, \
|
||||
"/sys/class/drm/card%d/device/pp_dpm_%s", asic->instance, clock_name);
|
||||
fd = open(name, O_RDWR);
|
||||
diff --git a/src/lib/rumr/rumr_serial_asic.c b/src/lib/rumr/rumr_serial_asic.c
|
||||
index 5f85c03..7c65b4d 100644
|
||||
--- a/src/lib/rumr/rumr_serial_asic.c
|
||||
+++ b/src/lib/rumr/rumr_serial_asic.c
|
||||
@@ -41,6 +41,8 @@ struct rumr_buffer *rumr_serialize_asic(struct umr_asic *asic)
|
||||
if (!buf)
|
||||
return NULL;
|
||||
|
||||
+ #pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
+
|
||||
// ASICNAME
|
||||
memset(tmpbuf, 0, sizeof tmpbuf);
|
||||
strcpy(tmpbuf, asic->asicname);
|
||||
diff --git a/src/lib/testing_harness.c b/src/lib/testing_harness.c
|
||||
index ddee028..f657c9d 100644
|
||||
--- a/src/lib/testing_harness.c
|
||||
+++ b/src/lib/testing_harness.c
|
||||
@@ -716,6 +716,8 @@ static int read_sgprs(struct umr_asic *asic, struct umr_wave_data *wd, uint32_t
|
||||
((uint64_t)umr_wave_data_get_bits(asic, wd, "ixSQ_WAVE_HW_ID", "WAVE_ID") << 36) |
|
||||
((uint64_t)umr_wave_data_get_bits(asic, wd, "ixSQ_WAVE_HW_ID", "SIMD_ID") << 44);
|
||||
nr = umr_wave_data_num_of_sgprs(asic, wd);
|
||||
+ } else {
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
// grab upto 'nr' words into dst[0..nr-1]
|
||||
@@ -784,6 +786,8 @@ static int read_vgprs(struct umr_asic *asic, struct umr_wave_data *wd, uint32_t
|
||||
((uint64_t)umr_wave_data_get_bits(asic, wd, "ixSQ_WAVE_HW_ID", "SIMD_ID") << 44) |
|
||||
((uint64_t)thread << 52);
|
||||
nr = (umr_wave_data_get_bits(asic, wd, "ixSQ_WAVE_GPR_ALLOC", "VGPR_SIZE") + 1) << granularity;
|
||||
+ } else {
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
// grab upto 'nr' words into dst[0..nr-1]
|
||||
diff --git a/src/test/test_server.c b/src/test/test_server.c
|
||||
index fae5623..bc44996 100644
|
||||
--- a/src/test/test_server.c
|
||||
+++ b/src/test/test_server.c
|
||||
@@ -9,7 +9,7 @@ extern JSON_Array *parse_kms_framebuffer_sysfs_file(struct umr_asic *asic, const
|
||||
extern JSON_Object *parse_kms_state_sysfs_file(const char *content);
|
||||
extern JSON_Object *parse_pp_features_sysfs_file(const char *content);
|
||||
|
||||
-enum TEST_RESULT test_parse_sysfs_clock_file()
|
||||
+static enum TEST_RESULT test_parse_sysfs_clock_file(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
char *content =
|
||||
"0: 500Mhz \n"
|
||||
@@ -23,7 +23,7 @@ enum TEST_RESULT test_parse_sysfs_clock_file()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_fence_info()
|
||||
+static enum TEST_RESULT test_parse_fence_info(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *before =
|
||||
"--- ring 0 (gfx_0.0.0) ---\n"
|
||||
@@ -71,7 +71,7 @@ enum TEST_RESULT test_parse_fence_info()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_vm_info()
|
||||
+static enum TEST_RESULT test_parse_vm_info(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"pid:0\tProcess: ----------\n"
|
||||
@@ -118,7 +118,7 @@ enum TEST_RESULT test_parse_vm_info()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_gem_info()
|
||||
+static enum TEST_RESULT test_parse_gem_info(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"pid 44961 command Xwayland:\n"
|
||||
@@ -148,7 +148,7 @@ enum TEST_RESULT test_parse_gem_info()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_sysfs_framebuffer()
|
||||
+static enum TEST_RESULT test_parse_sysfs_framebuffer(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"framebuffer[135]:\n"
|
||||
@@ -215,7 +215,7 @@ enum TEST_RESULT test_parse_sysfs_framebuffer()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_sysfs_state()
|
||||
+static enum TEST_RESULT test_parse_sysfs_state(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"plane[65]: plane-5\n"
|
||||
@@ -277,7 +277,7 @@ enum TEST_RESULT test_parse_sysfs_state()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_sysfs_pp_features()
|
||||
+static enum TEST_RESULT test_parse_sysfs_pp_features(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"features high: 0x00003763 low: 0xa37f7dff\n"
|
||||
@@ -383,7 +383,7 @@ enum TEST_RESULT test_parse_sysfs_pp_features()
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
-enum TEST_RESULT test_parse_sysfs_pp_features2()
|
||||
+static enum TEST_RESULT test_parse_sysfs_pp_features2(__attribute__((unused)) struct umr_asic* asic)
|
||||
{
|
||||
const char *content =
|
||||
"Current ppfeatures: 0x0000000019f0e3cf\n"
|
||||
--
|
||||
2.48.1
|
||||
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (umr-1.0.10.tar.gz) = 647f6ff4c700fb99279321a2543c9bffe9d7adabb07924bf4d19313765c8402a52666dfc83c9040a08d7fdc02e0cbbbd9508f557cfb2d82785d9f99d9ee1a3c8
|
||||
SHA512 (umr-1.0.11.tar.gz) = e3102d241f59cad2a91ad2a8e1fa3fd373c638f1c45a48ced2e33611bac2d4ed2a93a221d41d239d4021869cea655cd3f2449fd607cdfb7834d1a0da26dc245f
|
||||
|
|
|
|||
10
umr.spec
10
umr.spec
|
|
@ -3,16 +3,12 @@
|
|||
|
||||
Summary: AMDGPU Userspace Register Debugger
|
||||
Name: umr
|
||||
Version: 1.0.10
|
||||
Version: 1.0.11
|
||||
Release: %autorelease
|
||||
License: MIT
|
||||
URL: https://gitlab.freedesktop.org/tomstdenis/umr
|
||||
Source0: https://gitlab.freedesktop.org/tomstdenis/%{name}/-/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# Upstream fixes to newer GCC
|
||||
#https://gitlab.freedesktop.org/tomstdenis/umr/-/commit/511d5b9bebd91346ee208dfffed304ed05890d8d
|
||||
Patch0: 0001-Fix-warnings-treewide.patch
|
||||
|
||||
#Glibc is too old prior to EL7, enable rt linking to avoid compilation failure
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
%global enablert 1
|
||||
|
|
@ -43,7 +39,7 @@ BuildRequires: SDL2-devel
|
|||
BuildRequires: zlib-devel
|
||||
Requires: bash-completion
|
||||
#Disable unnecessary arches, as umr requires the amdgpu kernel module:
|
||||
ExclusiveArch: x86_64 aarch64 ppc64le
|
||||
ExclusiveArch: x86_64 aarch64 ppc64le riscv64
|
||||
|
||||
%description
|
||||
AMDGPU Userspace Register Debugger (UMR) is a tool to read and display, as well
|
||||
|
|
@ -72,6 +68,8 @@ as write to AMDGPU device MMIO, PCIE, SMC, and DIDT registers via userspace.
|
|||
%{_mandir}/man1/*
|
||||
%{_datadir}/%{name}
|
||||
%{_datadir}/bash-completion/completions/%{name}
|
||||
#Not including static libs right now
|
||||
%exclude %{_libdir}/lib*.a
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue