-
Notifications
You must be signed in to change notification settings - Fork 326
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
Elide ALL commands that we are not trying to trace. #1883
Conversation
gapii/cc/call_observer.cpp
Outdated
encoder()->object(cmd); | ||
} | ||
|
||
void CallObserver::exit() { | ||
if (!mSpy->should_trace(mApi)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scares me. If the should_trace
return value changes between enter
and exit
then You're Going To Have A Bad Time.
Are there cases where should_trace
should change for the lifetime of a CallObserver
? If not, can we fetch it once and store it as a member?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no cases (that I know) that would make this change during a call.
The only place we change ShouldTrace is during MEC start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can definitely store it off as a member, that will prevent this from accidentally happening.
gapii/cc/spy_base.h
Outdated
@@ -89,6 +89,10 @@ class SpyBase { | |||
return should_trace(api) ? mEncoder : mNullEncoder; | |||
} | |||
|
|||
std::shared_ptr<gapii::PackEncoder> parentEncoder(uint8_t api, CallObserver* parent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a bit of a clunky method. There's nothing particularly parent-specific about the implementation, and the name has no real indication of what it does.
I wonder if it would be clearer to just expose mNullEncoder
and let the caller do this logic. This would also deobfuscate the call to should_trace
.
We were ignoring some of the data, but not all of it. We would end up adding the commands to the tree, but no observations, this caused havok with the new memory work, since replaying those commands would cause OOB memory accesses.
We were ignoring some of the data, but not all of it. We would
end up adding the commands to the tree, but no observations,
this caused havok with the new memory work, since replaying
those commands would cause OOB memory accesses.