[PATCH] D130187: [Symbolizer] Implement data symbolizer markup element.

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 15:05:45 PDT 2022


mysterymath added inline comments.


================
Comment at: llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp:462-469
   // A debuginfod lookup could succeed if a HTTP client is available and at
   // least one backing URL is configured.
   bool ShouldUseDebuginfodByDefault =
       HTTPClient::isAvailable() &&
       !ExitOnErr(getDefaultDebuginfodUrls()).empty();
   if (Args.hasFlag(OPT_debuginfod, OPT_no_debuginfod,
                    ShouldUseDebuginfodByDefault))
----------------
phosek wrote:
> This should be moved as well so we can use debuginfod with the symbolizer filter.
Ah, good catch. Done.


================
Comment at: llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp:471-477
   std::unique_ptr<DIPrinter> Printer;
   if (Style == OutputStyle::GNU)
     Printer = std::make_unique<GNUPrinter>(outs(), errs(), Config);
   else if (Style == OutputStyle::JSON)
     Printer = std::make_unique<JSONPrinter>(outs(), Config);
   else
     Printer = std::make_unique<LLVMPrinter>(outs(), errs(), Config);
----------------
phosek wrote:
> This is not something that needs to be addressed in this change, but I think it would be valuable to support different output styles with the symbolizer filter as well, ideally by extending and using the existing printers. The JSON output in particular would be useful for consumption from other tools and scripts.
The use case makes sense, but it would be a somewhat odd way of interpreting the symbolizer markup. For the output to make sense as (e.g.) JSON, you'd need to have the filter ignore any text and SGR nodes present in the log, or you'd need to expect that the input is only markup and whitespace.

Maybe we could support an auxiliary output for this. When the log symbolizer encounters a presentation element, it could also tee the results to the auxiliary in one of these existing formats. This would keep the semantics of the main log symbolization pipeline simple and consistent, while still allowing machine processing of the referenced symbols, perhaps in concert with the filtered markup output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130187



More information about the llvm-commits mailing list