[PATCH] D59311: [ELF] Print symbols ordered by profiled guided section layout with verbose.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 11:34:08 PDT 2019


ruiu added inline comments.


================
Comment at: lld/ELF/CallGraphSort.cpp:236
+      for (int SecIndex : C.Sections)
+        outs() << Sections[SecIndex]->Name << "\n";
+    outs() << "**********************************************************\n";
----------------
tcwang wrote:
> ruiu wrote:
> > Are you sure that all input sections have a name?
> Not sure... But if the section doesn't, should I print an empty line, or just skip it?
I don't think printing out a blank line is useful, but what I wanted to ask is if it is ever possible to be unnamed. We shouldn't guard it against an empty name "just in case".


================
Comment at: lld/test/ELF/cgprofile-print.s:8
+# RUN: echo "D B 10" >> %t.call_graph
+# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2 --verbose | FileCheck %s --check-prefix=VERBOSE
+# RUN: llvm-readobj -symbols %t2 | FileCheck %s
----------------
tcwang wrote:
> ruiu wrote:
> > This does not seem to test the feature that you want to use.  Don't you want to print out the sorting order as a result of parsing .llvm.call-graph-profile sections, do you?
> I am sorry that I think I am not sure I understand the comment completely. I was trying to add --verbose to LLD while passing in a call graph file and check the standard print with the expected ordering. (And I have removed the checks in the object file, since this check should be done in another test already.) Should I test something else instead?
I thought that you wanted to print a result of a compiler-generated callgraph data stored into .llvm.call-graph-profile sections (there's such feature in lld and LLVM). If that's not the case, never mind.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59311





More information about the llvm-commits mailing list