Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to open trace file with trace_processor_shell on Mac(M1 Pro) #1038

Open
jinwencan opened this issue Mar 14, 2025 · 5 comments
Open

Failed to open trace file with trace_processor_shell on Mac(M1 Pro) #1038

jinwencan opened this issue Mar 14, 2025 · 5 comments

Comments

@jinwencan
Copy link

I have download trace_processor_shell from [https://commondatastorage.googleapis.com/perfetto-luci-artifacts/v49.0/mac-arm64/trace_processor_shell], but when i run 'trace_processor_shell --httpd filePath',i got error like [721.298] d_trace_internal.cc:100 Cannot use mmap on this system. Falling back on read()
Could not read trace file (path: /xxx/skia/skia/platform_tools/android/apps/skottie/out/trace_lottie_hw_0_star): Could not open trace file (path: /xxx/skia/platform_tools/android/apps/skottie/out/trace_lottie_hw_0_star)
, I am sure that the file is exist and is readable.Can anyone help ,I will be very thankful

@aMayzner
Copy link
Contributor

The error "Could not open trace file" happens due to one of the following cases:

  • The trace does not exist at the path
  • The user the trace processor is running as does not have permissions to access the trace (for example, if the file is owned by root but you are running as your own user)
  • The trace is corrupt.

The mmap error is harmless and is a red herring, the second error is all that matters.

Likely it's some ACL-related permission.
Maybe you are generating a trace running some tool as root, and then are trying to pass it to Trace Processor and it fails to open it.
Try chmod-ing it (chmod 644 /xxx/skia/platform_tools/android/apps/skottie/out/trace_lottie_hw_0_star)

@jinwencan
Copy link
Author

jinwencan commented Mar 17, 2025

The error "Could not open trace file" happens due to one of the following cases:

  • The trace does not exist at the path
  • The user the trace processor is running as does not have permissions to access the trace (for example, if the file is owned by root but you are running as your own user)
  • The trace is corrupt.

The mmap error is harmless and is a red herring, the second error is all that matters.

Likely it's some ACL-related permission. Maybe you are generating a trace running some tool as root, and then are trying to pass it to Trace Processor and it fails to open it. Try chmod-ing it (chmod 644 /xxx/skia/platform_tools/android/apps/skottie/out/trace_lottie_hw_0_star)

@aMayzner Thanks for reply, but I am sure the trace file is exist and readable.

Image
Is there something i missed?

@aMayzner aMayzner reopened this Mar 17, 2025
@aMayzner
Copy link
Contributor

Can you please check if running shell without httpd flag works?

@jinwencan
Copy link
Author

Can you please check if running shell without httpd flag works?

@aMayzner The situation is the same.

Image

@LalitMaganti
Copy link
Collaborator

LalitMaganti commented Mar 18, 2025

So this is a super super mysterious error from our perspective. The code to open/read files is trivially simple. It's just an open + read. On your machine for whatever reason, even the open is failing (that's what the error message is saying).

I wonder if macOS is blocking us from accessing the file. Can you go to system settings on macOS and verify that your terminal/trace_processor_shell have access to the file? My theory is that macOS has some toggle preventing acceess.

FWIW I cannot repro this on my M1 macOS machine which is why I'm struggling to figure out how to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants