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

Trace trigger hit when triggers with other action also fire #115

Open
AoteJin opened this issue Jun 7, 2024 · 15 comments
Open

Trace trigger hit when triggers with other action also fire #115

AoteJin opened this issue Jun 7, 2024 · 15 comments

Comments

@AoteJin
Copy link

AoteJin commented Jun 7, 2024

The debug spec says:
"What happens with trace actions when triggers with different actions are also firing is left to the trace specification."

But I didn't find any related description in the e-trace spec.

Considering the case, a icount trigger is set to enter debug mode when a given PC 0x1234 is executed 100 times. Meantime, another trigger's action is configured to be trace-on at PC 0x1234. In this case, neither of the trigger should silence the other one and both should take effective. Otherwise, the user will witness one of trigger behaves as disabled.

I think we need to add clear definition to cover it.

@AoteJin
Copy link
Author

AoteJin commented Jun 7, 2024

Moreover, trace triggers should be orthogonal to each other, because theoretically, trace-on and trace-off trigger could hit at the same time.

@IainCRobertson
Copy link
Collaborator

There was a long discussion about this on the DTPM mailing list recently (subject was "Multiple trigger hit with different action" ). Issue #99 was generated in response to this. I believe this addresses your concern.

@AoteJin
Copy link
Author

AoteJin commented Jul 25, 2024

I went through the mail thread and it is addressing the action regarding trace on/off/notify. Actually what I am concerned about is the case when trigger set to action=1 ( enter debug mode) fires at the same time when another trigger set to trace related actions.

I would assume that the trace action (non-intrusive debug) should not suppress debug mode (intrusive debug) or vice verse.

Probably either debug spec or trace spec should elaborate on it?

@IainCRobertson
Copy link
Collaborator

That's a debug spec question, but I'd assume not also.

@pdonahue-ventana
Copy link
Contributor

The debug spec says:

What happens with trace actions when triggers with different actions are also firing is left to the trace specification.

This sentence was added in 2018 and is unchanged from the Debug 0.13 spec that was ratified over 5 years ago (before E-Trace was ratified). It looks like there might have been a lack of coordination here.

@AoteJin
Copy link
Author

AoteJin commented Jul 26, 2024

@pdonahue-ventana do you suggest to open an issue in debug repo and close this one?

@pdonahue-ventana
Copy link
Contributor

It's a strange and unfortunate situation. The debug spec came first and didn't know what trace wanted so it said that trace would answer the question. Debug got ratified. Trace didn't fill in the details and that got ratified without anybody noticing. The two options are to (1) put in some post-ratification clarification in the trace spec or (2) put something in the frozen but not quite ratified debug 1.0. Although the first option would also provide compatibility with debug 0.13, I don't think that we care about that in 2024. Option 2 makes the most sense. I assume that @IainCRobertson agrees.

As for the actual text that gets added, I think that there should be joint agreement between the trace and debug people. We don't want debug to dictate something that is bad for trace and vice-versa.

@rtwfroody

@IainCRobertson
Copy link
Collaborator

IainCRobertson commented Jul 26, 2024 via email

@AoteJin
Copy link
Author

AoteJin commented Jul 31, 2024

Intuitively, I agree on that the trace behavior should not affect the debug behavior. Since trigger itself is a module defined by debug spec, probably it is more adequate to elaborate on this case in scope of debug spec?

@rtwfroody
Copy link

Ideally we'd have a statement like "Triggers with debug actions (0, 1) exist completely independently of triggers with trace actions (2, 3, 4, 5). They have no effect on each other."

Questions:

  1. Is that backwards compatible?
  2. Do we need something similar for triggers with external trigger output actions (8, 9)?

@pdonahue-ventana
Copy link
Contributor

@rtwfroody: Maybe a recommendation like this?

Triggers with actions in each of these three categories should exist completely independently of triggers with actions in each of the other categories:

  • debug actions (0, 1)
  • trace actions (2, 3, 4, 5)
  • external trigger output actions (8, 9)

Maybe actions 8 and 9 should even be independent of each other (making four categories) since you could signal both triggers at the same time. You can't trap and halt at the same time and you can't turn trace on and off and do a trace-notify at the same time.

@rtwfroody
Copy link

Or maybe we should just say that actions 0 and 1 are specified in our priority table. All others may fire simultaneously. I know the trace spec had a discussion about what it means when multiple ones fire at the same time, so they've already addressed that.

@pdonahue-ventana
Copy link
Contributor

That's good.

@IainCRobertson
Copy link
Collaborator

This issue has had a lot of discussion, with some aspects being addressed by updates to the Debug spec, and the E-Trace clarifications separated out into Issue #99. The updates for this are included in #158. Any objections to closing this issue @pdonahue-ventana @AoteJin ?

@AoteJin
Copy link
Author

AoteJin commented Oct 24, 2024

It looks great to me. Thanks for the heads up!

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

4 participants