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

SessionEndTime not set for real-time session #199

Closed
lowleveldesign opened this issue May 14, 2017 · 5 comments
Closed

SessionEndTime not set for real-time session #199

lowleveldesign opened this issue May 14, 2017 · 5 comments
Assignees
Milestone

Comments

@lowleveldesign
Copy link
Contributor

SessionEndTimeRelativeMSec property (of the TraceEventSource, or to be more exact ETWTraceEventSource instance) should contain the relative time in ms from the ETW session start, but for the real-time sessions it is always set to max-date (even after the session was stopped). I checked the source code and found that after initialization it is never touched again. To compare, CtfTraceEventSource sets the sessionEndTimeQPC field value for each processed event. In my test I added the following line to the RawDispatch method of the ETWTraceEventSource:

sessionEndTimeQPC = rawData->EventHeader.TimeStamp;

and it seems to work. Though, I am not sure if it's a valid approach.

Thanks for checking this out.

@vancem
Copy link
Contributor

vancem commented May 15, 2017

I am trying to figure out the 'right' definition for SessionStopTime when the session is real time.
What I like about the current definition (it is MaxTime), is that it is 'efficient' (no per-event overhead), and arguably more accurate (the session does not end at the last event processed it is ongoing)

Your suggestion is to make it the time of the last event. Can you describe the scenarios where this definition is helpful? Presumably it is for deciding the extent of the view when displaying the events, but it seems like you need special logic for real time events anyway since it changes over time (and you probably don't want it to be the time of the last event but round it up to something (e.g. next second, or next minute ..).

@lowleveldesign
Copy link
Contributor Author

I agree that adding this line will have negative impact on the performance - that's why I had doubts.

In my scenario I would like to use SessionEndTimeRelativeMSec after the real-time session was stopped (I'm printing some summary information). So setting the SessionEndTime when the session stops would work for me.

@vancem
Copy link
Contributor

vancem commented May 15, 2017

I think it is perfectly reasonable to set the SessionEndTime when a real time session actually ends. This should be a trivial fix.

@vancem
Copy link
Contributor

vancem commented May 16, 2017

I have added logic to set SessionEndTime at the end of a session (when Process() returns).

@vancem vancem closed this as completed May 16, 2017
@lowleveldesign
Copy link
Contributor Author

Great - thanks a lot!

@sharwell sharwell added this to the 1.9.55 milestone May 31, 2017
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