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

Content of multiple record sessions via Start Recording gets accumulated #37

Closed
danielfriederich opened this issue Jun 23, 2020 · 2 comments

Comments

@danielfriederich
Copy link

When I collect multiple record sessions via Start Recording (WebUSB) the trace gets accumulated. Say I collect 10 seconds, then wait a minute and collect another 10 seconds (with possibly different settings), then the trace covers 80 seconds. And trace_to_text shows that it contains the content of both sessions. I only see this when using the socket connection (AdbSocketConsumerPort), not when using AdbConsumerPort or when collecting via command line. Is this known behavior or a bug (well or both?). This is with a custom device, but nothing customized in this area.

Was discussed on discord:
https://discord.com/channels/629013440635207702/629013441096450058/725016433481744504

The issue appears to be that we reuse the traceProtoWriter (a protobuf.Writer) in adb_socket_controller.ts, AdbSocketConsumerPort class.

@danielfriederich
Copy link
Author

danielfriederich commented Jun 23, 2020

The fix proposed on discord by eseckler does fix the issue for me

sendReadBufferResponse() {
this.sendMessage(this.generateChunkReadResponse(
this.traceProtoWriter.finish(), /* last */ true));

  • this.traceProtoWriter = protobuf.Writer.create();
    }

primiano pushed a commit that referenced this issue Jul 23, 2020
This was causing a bug where traces from multiple consecutive
ADB tracing sessions were inadvertently concatenated together,
usually with a huge time gap between them.

Bug: 161917570, #37
Change-Id: Ie3a8ed8f3b8a1599a09da750869f5c35686e4093
@LalitMaganti
Copy link
Collaborator

I think the above CL should fix this.

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

2 participants