Open Nnnnut opened 10 months ago
Unfortunately that's actually the expected behavior. The python client doesn't parse the data quickly enough for the device (these are huge amounts of data) so eventually we get a socket failure after too much data is pending. Maybe some tweaks can be made to speed things up but currently that's the best we have.
I saw this code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
:
IDENTIFIER = 'com.apple.instruments.server.services.coreprofilesessiontap'
...
class CoreProfileSessionTap(Tap):
...
def __init__(self, dvt: DvtSecureSocketProxyService, time_config: typing.Mapping, filters: typing.Set = None):
...
if filters is None:
filters = {0xffffffff}
config = {
'tc': [{
'csd': 128, # Callstack frame depth.
'kdf2': filters, # Kdebug filter, receive all classes.
'ta': [[3], [0], [2], [1, 1, 0]], # Actions.
'tk': 3, # Kind.
'uuid': self.uuid,
}], # Triggers configs
'rp': 100, # Recording priority
'bm': 0, # Buffer mode.
}
super().__init__(dvt, self.IDENTIFIER, config)
It seems that the working behavior of services.coreprofilesessiontap
can be changed through different config
.
So I think we can try changing the output behavior of services.coreprofilesession
by changing the config
, such as filtering out data that I am not interested in,right?
But I don't understand the meaning of these config
parameters, or maybe there are other parameters as well?
Can you give me some tips on where to find detailed of config
?
Thanks for help.
These filters are described directly a few lines above. Unfortunately, just filtering the BSC which is the common use-case is enough to flood
What is the BSC?
Is that hexadecimal codes like those in /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Packages/GPU.instrdst/Contents/Extensions/com.apple.metalsystrace-display.dtac/modeling-rules/rules-0001.clp
?
yeah it's the same concept. BSC is for BSD syscalls in general
Test environment
Describe the bug I run this command:
python -m pymobiledevice3 developer dvt core-profile-session save core.trace --rsd xxx xxx
It continuously dump data after running, But it can only last for a few minutes or even tens of seconds. Is that running normally? In my expectation, it should continue to run until I manually stop it.
To Reproduce
Modified the following code to add logs in
pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
:python -m pymobiledevice3 developer dvt core-profile-session save core.trace --rsd xxx xxx
.Expected behavior In my expectation, it should continue to run until I manually stop it. And I can continuously filter out the trace information of the "swap program" to calculate FPS.
Logs I got these logs:
The final log output stayed at
receive_message start
, dump data only lasted for ten seconds.Thanks for help.