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

atrace file failed to load #49

Closed
barnett-yuxiang opened this issue Jul 12, 2020 · 5 comments
Closed

atrace file failed to load #49

barnett-yuxiang opened this issue Jul 12, 2020 · 5 comments
Labels
good first issue Good for newcomers

Comments

@barnett-yuxiang
Copy link

barnett-yuxiang commented Jul 12, 2020

Has been around for a while,perfetto can not load file captured by atrace cmd:

adb shell atrace freq idle disk memory network -o /sdcard/atrace.data
adb pull /sdcard/atrace.data .

https://ui.perfetto.dev/#!/ => open file

atrace.data.zip

image

I debug it, seems like something wrong with zlib

:shipit:

@barnett-yuxiang
Copy link
Author

@willnorris @mspang @nico @fmayer

Hi, can anyone help me?

@chromy
Copy link
Contributor

chromy commented Jul 20, 2020

Your file begins as follows:

TRACE:
# tracer: nop
#
# entries-in-buffer/entries-written: 41390/41390   #P:8
#
#                                      _-----=> irqs-off
#                                     / _----=> need-resched
#                                    | / _---=> hardirq/softirq
#                                    || / _--=> preempt-depth
#                                    ||| /     delay
#           TASK-PID    TGID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |        |      |   ||||       |         |
          <idle>-0     (-----) [002] .n.1 223230.807255: cpu_idle: state=4294967295 cpu_id=2
          <idle>-0     (-----) [004] ...1 223230.807282: cpu_idle: state=4294967295 cpu_id=4
          <idle>-0     (-----) [004] d..1 223230.807289: cpu_idle: state=3 cpu_id=4
          <idle>-0     (-----) [002] d..1 223230.807329: cpu_idle: state=3 cpu_id=2
          <idle>-0     (-----) [003] .n.1 223230.807422: cpu_idle: state=4294967295 cpu_id=3
          <idle>-0     (-----) [003] d..1 223230.807476: cpu_idle: state=3 cpu_id=3
          <idle>-0     (-----) [000] d..1 223230.807481: cpu_idle: state=0 cpu_id=0

The issue is the first line:

TRACE:

If you delete this the trace works fine.

The line that causes the issue is here:

if (start.find("TRACE:") != std::string::npos)

When we see TRACE: we expect the file to be in .ctrace format, which is to say a .zip file. In fact your trace is not compressed so we should instead use the kSystraceTraceType parser. This can happen if someone manually uses atrace without the compression option -z. We should amend the trace detection logic to take this situation into account.

@chromy chromy added the good first issue Good for newcomers label Jul 20, 2020
@barnett-yuxiang
Copy link
Author

@chromy Many many thx~

@LalitMaganti
Copy link
Collaborator

Reopening to track the auto-detection in trace processor

primiano pushed a commit that referenced this issue Aug 4, 2020
Bug: #49
Change-Id: I8cfedda00636deee929e1550c3cd7db24af74356
@LalitMaganti
Copy link
Collaborator

This should now be fixed for real!

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

No branches or pull requests

3 participants