summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-03-23 21:54:48 -0500
committerDave Airlie <airlied@redhat.com>2010-03-24 13:16:09 +1000
commit0ca903d67e92af0eb0323ca850e55ecf564591e8 (patch)
tree986d0d17b1d0d3bb4c34364224196870a03cb1a4
parent51a87cf04e1aaca1efd938dcf37ba973f1d27350 (diff)
radeontool regmatch: print name before reading each register
Register reads might take a long time or lock up the system. Let the user know which register before such an event occurs. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--radeontool.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/radeontool.c b/radeontool.c
index 10b9266..4aefb72 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -734,9 +734,15 @@ void radeon_reg_match(const char *pattern)
else {
for (i = 0; i < sizeof(reg_list) / sizeof(reg_list[0]); i++) {
if (fnmatch(pattern, reg_list[i].name, 0) == 0) {
+ printf("%s (%s%04x)\t", reg_list[i].name,
+ reg_list[i].type, reg_list[i].address);
+
+ /* Force output in case the register read locks up. */
+ fflush(stdout);
+ fsync(STDOUT_FILENO);
+
value = reg_list[i].get(reg_list[i].address, reg_list[i].name);
- printf("%s (%s%04x)\t0x%08x (%d)\n", reg_list[i].name,
- reg_list[i].type, reg_list[i].address, value, value);
+ printf("0x%08x (%d)\n", value, value);
}
}
for (i = 0; i < 0x2f; i++) {