[PATCH] D81894: [llvm-readobj][COFF] add .llvm.call-graph-profile section dump

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 03:14:30 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/COFF/call-graph-profile.test:33
+    Alignment:       1
+    SectionData:     0400000008000000200000000000000009000000040000000B0000000000000005000000060000001400000000000000
+symbols:
----------------
zequanwu wrote:
> grimar wrote:
> > You should probably put a comment about how to recreate this bytes.
> > (e.g. a piece of asm)
> This is generated from a child patch (D81775) and I reduced it by only keeping symbols referred in `SectionData`. Those bytes represent the symbol indexes (which are not stable) and weight. 
> 
> Or I could use the previous version of the test, which includes all symbols and sections generated.
> 
> I don't if there is a better way to write the test. In `tools/llvm-readobj/ELF/call-graph-profile.test`, `yaml2obj` could generate the `SectionData` from `Entryies` for ELF.  For COFF, it lacks the functionalities. 
Ok. Lets leave it as is for now then. I am not sure it is reasonable to reference the functionality of D81775 until it is not landed.


================
Comment at: llvm/test/tools/llvm-readobj/COFF/malformed-call-graph-profile.test:16
+    Alignment:       1
+    SectionData:     00
+symbols:
----------------
Isn't it a truncated section for which llvm-readobj should report a warning/error?


================
Comment at: llvm/test/tools/llvm-readobj/COFF/malformed-call-graph-profile.test:36
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
\ No newline at end of file

----------------
No new line at EOF.


================
Comment at: llvm/tools/llvm-readobj/COFFDumper.cpp:1987
+    if (Error Err = Reader.readInteger(Count))
+      reportError(std::move(Err), Obj->getFileName());
+
----------------
> By error paths, do you mean the error path of reportError inside printCGProfile

Yeah, this ones. You should be able to test them in the same test file (`call-graph-profile.test`).
You can use the `--docnum=x` option of yaml2obj to have multiple YAML descriptions in a file. (See other llvm-readobj tests).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81894/new/

https://reviews.llvm.org/D81894





More information about the llvm-commits mailing list