[PATCH] D110793: [llvm-porfgen] Allow perf data as input

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 17:49:10 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:287
+        convertPerfDataToTrace(Binary, PerfInputFile);
+    // Let commoand opt own the string for converted perf trace file name
+    PerfTraceFilename = ConvertedPerfScript;
----------------
wlei wrote:
> Nit : command
fixed, thanks.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:867
+  // for ` perf script  --show-mmap-events  -i ...`
+  return Line.find("PERF_RECORD_MMAP2") != StringRef::npos;
+}
----------------
wlei wrote:
> Before we use "TraceIt.getCurrentLine().startswith("PERF_RECORD_MMAP2"))" for the check, why here changed to `find`? it seems like our regex match only supports for leading "PERF_RECORD_MMAP2"
This is because if we want to get mmap events only, we need to use `perf script --show-mmap-events -F comm,pid -i ...`. However with that, the mmap shows up in the following format. I have a comment above.

> systemd     0 [000]     0.000000: PERF_RECORD_MMAP2 1/1: [0x7ff989ee1000(0x7d000) @ 0 00:1c 4615 6072345749617000736]: r-xp /usr/lib64/libgcrypt.so.11.8.2

The regex handles this today as it's not pinned to the beginning of the line (no `^`). 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110793



More information about the llvm-commits mailing list