enable follow_ib by default now
PATCH 1/2 enable follow_ib by default now
Signed-off-by Tom St Denis <[email protected]>
--- doc/sphinx/source/basic.rst | 66 ++++++++++++++++++++++----------------------- doc/sphinx/source/ring.rst | 17 ------------ doc/umr.1 | 4 +-- src/app/main.c | 7 ++--- 4 files changed, 39 insertions(+), 55 deletions(-)
doc/sphinx/source/basic.rst +33 -33
@@ -104,39 +104,39 @@ comma separator. The options available are: -+-------------+------------------------------------------------------------------------------+ -| **Option** | **Description** | -+-------------+------------------------------------------------------------------------------+ -| quiet | Disable various informative outputs that are not required for functionality. | -+-------------+------------------------------------------------------------------------------+ -| read_smc | Enable scanning of SMC registers when issuing a --scan command | -+-------------+------------------------------------------------------------------------------+ -| bits | Enables the display of bitfields when registers are presented | -+-------------+------------------------------------------------------------------------------+ -| bitsfull | When printing bits use the full path to the bitfield | -+-------------+------------------------------------------------------------------------------+ -| empty_log | Empty MMIO tracer after reading it | -+-------------+------------------------------------------------------------------------------+ -| follow | Tells --logscan to continually read the MMIO tracer | -+-------------+------------------------------------------------------------------------------+ -| follow_ib | Instructs the --ring command to follow IBs pointed to by the ring | -+-------------+------------------------------------------------------------------------------+ -| named | Tells --read to print out the register name along with the value | -+-------------+------------------------------------------------------------------------------+ -| many | Allows matching of register names openly. Used with --read and implies the | -| | *named* option. For instance: '\*.dce100.CRTC' will match any register that | -| | contains the fragment 'CRTC' in it. | -+-------------+------------------------------------------------------------------------------+ -| use_pci | Enables direct PCI access bypassing the kernels debugfs entries. | -+-------------+------------------------------------------------------------------------------+ -| use_colour | Enables colourful output in various commands. Also accepts use_color | -+-------------+------------------------------------------------------------------------------+ -| no_kernel | Attempts to avoid kernel access methods. Implies *use_pci*. | -+-------------+------------------------------------------------------------------------------+ -| verbose | Enables verbose output, for instance in VM decoding | -+-------------+------------------------------------------------------------------------------+ -| halt_waves | Halt active waves while reading wave status data | -+-------------+------------------------------------------------------------------------------+ ++--------------+------------------------------------------------------------------------------+ +| **Option** | **Description** | ++--------------+------------------------------------------------------------------------------+ +| quiet | Disable various informative outputs that are not required for functionality. | ++--------------+------------------------------------------------------------------------------+ +| read_smc | Enable scanning of SMC registers when issuing a --scan command | ++--------------+------------------------------------------------------------------------------+ +| bits | Enables the display of bitfields when registers are presented | ++--------------+------------------------------------------------------------------------------+ +| bitsfull | When printing bits use the full path to the bitfield | ++--------------+------------------------------------------------------------------------------+ +| empty_log | Empty MMIO tracer after reading it | ++--------------+------------------------------------------------------------------------------+ +| follow | Tells --logscan to continually read the MMIO tracer | ++--------------+------------------------------------------------------------------------------+ +| no_follow_ib | Instructs the --ring command to not follow IBs pointed to by the ring | ++--------------+------------------------------------------------------------------------------+ +| named | Tells --read to print out the register name along with the value | ++--------------+------------------------------------------------------------------------------+ +| many | Allows matching of register names openly. Used with --read and implies the | +| | *named* option. For instance: '\*.dce100.CRTC' will match any register that | +| | contains the fragment 'CRTC' in it. | ++--------------+------------------------------------------------------------------------------+ +| use_pci | Enables direct PCI access bypassing the kernels debugfs entries. | ++--------------+------------------------------------------------------------------------------+ +| use_colour | Enables colourful output in various commands. Also accepts use_color | ++--------------+------------------------------------------------------------------------------+ +| no_kernel | Attempts to avoid kernel access methods. Implies *use_pci*. | ++--------------+------------------------------------------------------------------------------+ +| verbose | Enables verbose output, for instance in VM decoding | ++--------------+------------------------------------------------------------------------------+ +| halt_waves | Halt active waves while reading wave status data | ++--------------+------------------------------------------------------------------------------+ ------------------ Device Information
doc/sphinx/source/ring.rst +0 -17
@@ -120,20 +120,3 @@ Bitfield Decoding The ring decoders also support decoding bitfields when register writes are detected. This is enabled with the 'bits' option. - -------------------- -Following IB chains -------------------- - -By default, IB pointers are not followed when detected in packets. -Typically, this will require some sort of access to system memory -since often IBs are stored in system memory. Following IB chains can -be enabled with the 'follow_ib' option, for instance: - -:: - - umr -O follow_ib --ring gfx[.] - -Note that this is particularly only useful for hung GPUs as the virtual -addresses will quickly expire on live systems. -
doc/umr.1 +2 -2
@@ -137,8 +137,8 @@ separated strings. Options should be specified before --update or --force comma Causes the --logscan command to repeatedly produce output without exiting. -.B follow_ib - Instruct the --ring command to attempt to follow IBs pointed to by the packets +.B no_follow_ib + Instruct the --ring command to not attempt to follow IBs pointed to by the packets in the ring. .B named
src/app/main.c +4 -3
@@ -105,8 +105,8 @@ static void parse_options(char *str) options.read_smc =1 ; }else if (!strcmp (option,"quiet" )) { options.quiet =1 ; - }else if (!strcmp (option,"follow_ib" )) { - options.follow_ib =1 ; + }else if (!strcmp (option,"no_follow_ib" )) { + options.follow_ib =0 ; }else if (!strcmp (option,"verbose" )) { options.verbose =1 ; }else if (!strcmp (option,"halt_waves" )) {
@@ -136,6 +136,7 @@ int main(int argc, char **argv) options.need_scan =1 ; options.forcedid =-1 ; options.scanblock ="" ; + options.follow_ib =1 ;for (i =1 ; i < argc; i++) {if (!strcmp (argv[i],"--instance" ) || !strcmp (argv[i],"-i" )) {
@@ -539,7 +540,7 @@ int main(int argc, char **argv)"\n\t\tdecodings.\n" "\n\t--vm-write, -vw [<vmid>@]<address> <size>" "\n\t\tWrite 'size' bytes (in hex) to a given address (in hex) from stdin.\n" -"\n\t--option -O <string>[,<string>,...]\n\t\tEnable various flags: bits, bitsfull, empty_log, follow, follow_ib, named, many," +"\n\t--option -O <string>[,<string>,...]\n\t\tEnable various flags: bits, bitsfull, empty_log, follow, no_follow_ib, named, many," "\n\t\tuse_pci, use_colour, read_smc, quiet, no_kernel, verbose, halt_waves.\n" "\n\n", UMR_BUILD_VER, UMR_BUILD_REV);exit (EXIT_SUCCESS );
Signature · 6 lines
2.14.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 Simplify the ability to read multiple registers at once
Previously the "many" option would be needed to read related registers at once. This adds the ability to simply using a trailing star on the name, for instance,
$ umr -r *.vcn10.ADDR* vcn10.mmUVD_JPEG_ADDR_CONFIG => 0x22010010 vcn10.mmUVD_JPEG_UV_ADDR_CONFIG => 0x22010010 vcn10.mmUVD_SEMA_ADDR_LOW => 0x00000000 vcn10.mmUVD_SEMA_ADDR_HIGH => 0x00000000 vcn10.mmUVD_UDEC_DBW_UV_ADDR_CONFIG => 0x22010010 ...<snip>...
Signed-off-by Tom St Denis <[email protected]>
--- doc/sphinx/source/register_access.rst | 9 +++++++++ doc/umr.1 | 7 ++++++- src/app/main.c | 4 +++- src/app/scan.c | 18 +++++++++++++----- 4 files changed, 31 insertions(+), 7 deletions(-)
doc/sphinx/source/register_access.rst +9 -0
@@ -63,6 +63,15 @@ example: Will read and print out any register with the word 'GATE' contained in the register name in the uvd6 IP block. +This can also be accomplished by using a '*' at the end of the register +name. For example: + +:: + + umr --read *.uvd6.GATE* + +would accomplish the same as the previous example. + -------------------------- Reading an entire IP block --------------------------
doc/umr.1 +6 -1
@@ -56,7 +56,12 @@ This command uses the same syntax as the .B --write command but also allows .B * -for the regname field. +for the regname field to read an entire block. Additionally, +a +.B * +can be appended to a register name to read any register that contains +a partial match. For instance, "*.vcn10.ADDR*" would read any register +from the 'VCN10' block which contains 'ADDR' in the name. .IP "--scan, -s <string>" Scan and print an IP block by name, for example, .B uvd6
src/app/main.c +3 -1
@@ -512,7 +512,9 @@ int main(int argc, char **argv)"\n\t--writebit, -wb <string> <number>\n\t\tWrite a value in hex to a register bitfield specified as in --write but" "\n\t\tthe addition of the bitfield name. For instance: \"*.gfx80.mmRLC_PG_CNTL.PG_OVERRIDE\"\n" "\n\t--read, -r <string>\n\t\tRead a value from a register and print it to stdout. This command" -"\n\t\tuses the same path notation as --write. It also accepts * for regname.\n" +"\n\t\tuses the same path notation as --write. It also accepts * for regname." +"\n\t\tA trailing * on a regname will read any register that has a name that contains the" +"\n\t\tremainder of the name specified.\n" "\n\t--scan, -s <string>\n\t\tScan and print an ip block by name, e.g. \"uvd6\" or \"carrizo.uvd6\"." "\n\t\tCan be used multiple times.\n" "\n\t--ring, -R <string>([from:to])\n\t\tRead the contents of a ring named by the string without the amdgpu_ring_ prefix. "
src/app/scan.c +13 -5
@@ -26,10 +26,18 @@int umr_scan_asic (struct umr_asic *asic,char *asicname,char *ipname,char *regname) { -int r, fd; -int first, i, j, k; +int r, fd, many = asic->options.many, named = asic->options.named, + first, i, j, k;uint64_t addr, scale; -char buf[256 ]; +char buf[256 ], regname_copy[256 ]; + +// does the register name contain a trailing star? +strcpy (regname_copy, regname); +if (strlen (regname) >1 &&strstr (regname,"*" )) { + many =1 ; + named =1 ; + regname_copy[strlen (regname_copy)-1 ] =0 ; + }/* scan them all in order */ if (!asicname[0 ] || !strcmp (asicname,"*" ) || !strcmp (asicname, asic->asicname)) {
@@ -38,7 +46,7 @@ int umr_scan_asic(struct umr_asic *asic, char *asicname, char *ipname, char *reg first =1 ;for (j =0 ; j < asic->blocks[i]->no_regs; j++) {if (!regname[0 ] || !strcmp (regname,"*" ) || !strcmp (regname, asic->blocks[i]->regs[j].regname) || - (asic->options.many &&strstr (asic->blocks[i]->regs[j].regname, regname))) { + (many &&strstr (asic->blocks[i]->regs[j].regname, regname_copy))) {// only grant if any regspec matches otherwise it's a waste if (first && asic->blocks[i]->grant) { first =0 ;
@@ -91,7 +99,7 @@ int umr_scan_asic(struct umr_asic *asic, char *asicname, char *ipname, char *regumr_grbm_select_index (asic,0xFFFFFFFF ,0xFFFFFFFF ,0xFFFFFFFF ); }if (regname[0 ]) { -if (asic->options.named) +if (named)printf ("%s%s.%s%s => " ,CYAN , asic->blocks[i]->ipname, asic->blocks[i]->regs[j].regname,RST );printf ("%s0x%08lx%s\n" ,YELLOW , (unsigned long )asic->blocks[i]->regs[j].value,RST );if (asic->options.bitfields)
Signature · 6 lines
2.14.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx