symbolizer: Fix symlink handling

It turns out that the symbolizer used fts_open() for a reason:
base::ListFilesRecursive doesn't handle symlinks. Turns out that
handling symlinks is non-trivial because we have to prevent infinite
loops. fts_open() does all that for us. This commit:

* Reverts a bunch of commits:
  * ee90928bb222("Move GetFileSize() from symbolizer to base/file_utils.h")
  * ad3da2777b62("Revert "Link against libfts when compiling against musl"")
  * 2abbc726fa5a("Avoid using fts_open and fts_read")
* Cherrypicks a fix from base::ListFilesRecursive from commit
  63ad74ac51b7 ("Do not use ScopedResource for FindFirstFile handle")
* Adds unittests with symlinks.

Tested by:
* Building and running unittests on windows
* Building and running unintests on Linux
* Building in CI android musl:
  https://android-build.googleplex.com/builds/abtd/run/L35900000958749217

Bug: 261712935
Change-Id: Ibdf87f05394f1922430dd5513e5d53848096d7d7
11 files changed
tree: 6fb5b68e559f58928dbd004b983873b7e4f99c24
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. python/
  13. src/
  14. test/
  15. tools/
  16. ui/
  17. .clang-format
  18. .clang-tidy
  19. .git-blame-ignore-revs
  20. .gitattributes
  21. .gitignore
  22. .gn
  23. .style.yapf
  24. Android.bp
  25. Android.bp.extras
  26. BUILD
  27. BUILD.extras
  28. BUILD.gn
  29. CHANGELOG
  30. codereview.settings
  31. DIR_METADATA
  32. heapprofd.rc
  33. LICENSE
  34. meson.build
  35. METADATA
  36. MODULE_LICENSE_APACHE2
  37. OWNERS
  38. perfetto.rc
  39. PerfettoIntegrationTests.xml
  40. PRESUBMIT.py
  41. README.chromium
  42. README.md
  43. TEST_MAPPING
  44. traced_perf.rc
  45. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.