[PATCH] D80810: AMDGPU: Add URI definition to AMDGPUUsage

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 09:13:04 PDT 2020


kzhuravl created this revision.
kzhuravl added a reviewer: t-tye.
Herald added subscribers: kerbowa, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely.
Herald added a project: LLVM.

https://reviews.llvm.org/D80810

Files:
  llvm/docs/AMDGPUUsage.rst


Index: llvm/docs/AMDGPUUsage.rst
===================================================================
--- llvm/docs/AMDGPUUsage.rst
+++ llvm/docs/AMDGPUUsage.rst
@@ -1095,6 +1095,48 @@
 There is no current OS loader support for 32-bit programs and so
 ``R_AMDGPU_ABS32`` is not used.
 
+.. _amdgpu-uniform-resource-identifier:
+
+Uniform Resource Identifier
+---------------------------
+
+Code object's uniform resource identifier (URI) name syntax is defined by the
+following BNF syntax:
+
+  code_object_uri ::== file_uri | memory_uri
+  file_uri        ::== "file://" file_path [ range_specifier ]
+  memory_uri      ::== "memory://" process_id range_specifier
+  range_specifier ::== [ "#" | "?" ] "offset=" number "&" "size=" number
+  file_path       ::== URI_ENCODED_OS_FILE_PATH
+  process_id      ::== DECIMAL_NUMBER
+  number          ::== HEX_NUMBER | DECIMAL_NUMBER | OCTAL_NUMBER
+
+**number** is a C integral literal where hexadecimal values are prefixed by
+"0x" or "0X", and octal values by "0".
+
+**file_path** is the file's path specified as a URI encoded UTF-8 string.
+In URI encoding, every character that is not in the regular expression
+``[a-zA-Z0-9/_.~-]`` is encoded as two uppercase hexidecimal digits
+proceeded by "%".  Directories in the path are separated by "/".
+
+**offset** is a 0-based byte offset to the start of the code object.  For a
+file URI, it is from the start of the file specified by the ``file_path``,
+and if omitted defaults to 0. For a memory URI, it is the memory address
+and is required.
+
+**size** is the number of bytes in the code object.  For a file URI, if
+omitted it defaults to the size of the file.  It is required for a memory
+URI.
+
+**process_id** is the identity of the process owning the memory.  For Linux
+it is the C unsigned integral decimal literal for the process ID (PID).
+
+For example:
+
+    file:///dir1/dir2/file1
+    file:///dir3/dir4/file2#offset=0x2000&size=3000
+    memory://1234#offset=0x20000&size=3000
+
 .. _amdgpu-dwarf-debug-information:
 
 DWARF Debug Information


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80810.267261.patch
Type: text/x-patch
Size: 2062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/7eeed10f/attachment.bin>


More information about the llvm-commits mailing list