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

ctf: add trace with empty sequence field & uint32_t length type #3

Conversation

christophebedard
Copy link
Member

@christophebedard christophebedard commented Apr 11, 2024

Test trace for eclipse-tracecompass/org.eclipse.tracecompass#58.

Event definition:

TRACEPOINT_EVENT(
  my_provider,
  my_sequence_tp,
  TP_ARGS(
    const int64_t *, arr_arg,
    const uint32_t, count_arg
  ),
  TP_FIELDS(
    ctf_sequence(int64_t, seq, arr_arg, uint32_t, count_arg)
  )
)

Tracepoint trigger:

tracepoint(my_provider, my_sequence_tp, NULL, 0U);

Opening this trace in Trace Compass leads to this error:

!ENTRY org.eclipse.tracecompass.tmf.ctf.core 4 0 2024-04-11 11:10:28.243
!MESSAGE Trace read error channel0_6
!STACK 0
org.eclipse.tracecompass.ctf.core.CTFException: Trace read error channel0_6
	at org.eclipse.tracecompass.ctf.core.trace.CTFStreamInputReader.readNextEvent(CTFStreamInputReader.java:320)
	at org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader.advance(CTFTraceReader.java:366)
	at org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator.CtfIterator.advance(CtfIterator.java:255)
	at org.eclipse.tracecompass.tmf.ctf.core.context.CtfTmfContext.advance(CtfTmfContext.java:142)
	at org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace.getNext(CtfTmfTrace.java:465)
	at org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace.getNext(CtfTmfTrace.java:1)
	at org.eclipse.tracecompass.internal.tmf.core.component.TmfEventThread.run(TmfEventThread.java:204)
	at org.eclipse.tracecompass.internal.tmf.core.request.TmfRequestExecutor$1.run(TmfRequestExecutor.java:152)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.eclipse.tracecompass.ctf.core.CTFException: Cannot read the integer, the buffer does not have enough remaining space. Requested:32 Available:0
	at org.eclipse.tracecompass.ctf.core.event.io.BitBuffer.getInt(BitBuffer.java:221)
	at org.eclipse.tracecompass.ctf.core.event.io.BitBuffer.get(BitBuffer.java:171)
	at org.eclipse.tracecompass.ctf.core.event.types.IntegerDeclaration.read(IntegerDeclaration.java:553)
	at org.eclipse.tracecompass.ctf.core.event.types.IntegerDeclaration.createDefinition(IntegerDeclaration.java:481)
	at org.eclipse.tracecompass.ctf.core.event.types.IntegerDeclaration.createDefinition(IntegerDeclaration.java:1)
	at org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration.fillStruct(StructDeclaration.java:220)
	at org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration.createDefinition(StructDeclaration.java:159)
	at org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration.createDefinition(StructDeclaration.java:1)
	at org.eclipse.tracecompass.ctf.core.event.types.VariantDeclaration.createDefinition(VariantDeclaration.java:139)
	at org.eclipse.tracecompass.ctf.core.event.types.VariantDeclaration.createDefinition(VariantDeclaration.java:1)
	at org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration.fillStruct(StructDeclaration.java:220)
	at org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration.createDefinition(StructDeclaration.java:186)
	at org.eclipse.tracecompass.internal.ctf.core.trace.CTFPacketReader.readNextEvent(CTFPacketReader.java:149)
	at org.eclipse.tracecompass.internal.ctf.core.trace.CTFPacketReader.readNextEvent(CTFPacketReader.java:1)
	at org.eclipse.tracecompass.ctf.core.trace.CTFStreamInputReader.readNextEvent(CTFStreamInputReader.java:314)
	... 10 more

@christophebedard christophebedard force-pushed the christophebedard/add-ctf-test-trace-empty-sequence branch 2 times, most recently from 086e310 to 6fa8511 Compare April 11, 2024 18:11
@MatthewKhouzam
Copy link
Contributor

great catch

Copy link
Contributor

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The build failure is unrelated to the PR and caused by the Jenkins setup. I ran the build on my computer, and it works fine.

@bhufmann bhufmann merged commit 3f1dca1 into eclipse-tracecompass:master Apr 12, 2024
1 of 2 checks passed
@christophebedard christophebedard deleted the christophebedard/add-ctf-test-trace-empty-sequence branch April 12, 2024 17:53
@christophebedard
Copy link
Member Author

I believe that a new release needs to be manually triggered (https://www.eclipse.org/lists/tracecompass-dev/msg01803.html).

christophebedard added a commit to christophebedard/tracecompass-test-traces that referenced this pull request Apr 12, 2024
Follow-up to eclipse-tracecompass#3.

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
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

Successfully merging this pull request may close these issues.

None yet

3 participants