Instruments

RSS for tag

Instruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.

Instruments Documentation

Posts under Instruments tag

91 Posts
Sort by:
Post not yet marked as solved
2 Replies
209 Views
Hi I am developing an iPhone app which is somewhat numerically intensive. I'd like to save "telemetry"/debug data to memory and then be able to retrieve that data. Data will most likely be in form of a .csv file. Some have recommended NSLog. I am tempted to use fwrite() calls but don't know how to retrieve the generated file. I have searched the web for this info and have not found relevant info. Thanks.
Posted
by
Post not yet marked as solved
1 Replies
270 Views
When using Time Profiler for finding the time needed for each method(executed) in iOS App. Some written(not system) method couldn’t appear in Call tree. (Please Note: Some of written methods appeared and some method don't) Anything need to add/do in Instrument or filter for finding those missing methods in call tree. Or is there any criteria for some methods not appearing in the call tree, Specially ViewController life cycle method or if less work done in some method. viewDidLoad() sometimes found and sometimes not. viewWillAppear(), viewDidAppear(), viewWillDisappear(), viewDidDisappear() couldn't find any time. Please clarify the issue. Thanks in advance.
Posted
by
Post not yet marked as solved
0 Replies
227 Views
The same graphics program runs in the webview, and the iPhone 12Pro has 15+% more GPU usage than the iPhone 11Pro. In theory, the performance of the A14 should be stronger than that of the A13. Is it possible to increase the GPU overhead by 15+% just because there are more 45x96 pixels? The fragment profiling in XCode Instrument, please see the screenshot.
Posted
by
Post not yet marked as solved
1 Replies
421 Views
The Leaks instrument is suddenly giving me the error "Required kernel recording resources are in use by another document." I see this has come up with Xcode 12 on iOS, but now it's happening when profiling a Mac application on Monterey 12.3.1 and Xcode 13.3. I get the same behaviour on a debug or release build. The Allocations instrument on its own also gives the same error. The Time Profiler intrument launches without issue. Regardless of the (useless) error, it's possible this is a signing issue, since Intruments is also constantly asking for a password when launching the process. Does anyone have any insight into what is causing this?
Posted
by
dwn
Post not yet marked as solved
0 Replies
209 Views
When scrolling a collection view, it looks like all supplementary views (even those that currently not appear) are invalidated. If there is a large number of supplementary views (section headers in my case) this significantly affects scrolling performance. Can I instruct the collection view to invalidate only the visible supplementary header views (rather than all of them) when user scrolls the view? Here is the code I use to create the collection view (tableview-like layout) in my custom UICollectionViewController class: // Create list layout configuration UICollectionLayoutListConfiguration *config = [[UICollectionLayoutListConfiguration alloc] initWithAppearance:UICollectionLayoutListAppearancePlain]; config.headerMode = UICollectionLayoutListHeaderModeSupplementary; // Create compositional layout based on configuration and assign to collection view UICollectionViewCompositionalLayout *layout = [UICollectionViewCompositionalLayout layoutWithListConfiguration:config]; self.collectionView.collectionViewLayout = layout;
Posted
by
Post marked as solved
6 Replies
361 Views
My little network extension is running out of file descriptors. My suspicion is that something in the Security framework is not being deallocated, although even this doesn't make a great deal of sense: The extension looks at each flow, and gets a SecStaticCodeRef for it, finds the pathname, makes a decision, and stores the result of that decision in an NSCache<NSData, NSNumber> where the key is flow.metaData.sourceAppUniqueIdentifier. This goes through a couple layers of abstractions (the cache is in one Swift class, and it calls another Swift class that gets the security info and then returns the pathname, or throws an error). As an example, after running for a couple of days, it has 1074 open file descriptors for /System/Library/PrivateFrameworks/CloudKitDaemon.framework/Support/cloudd -- and only had 732 three hours ago.
Posted
by
Post not yet marked as solved
1 Replies
302 Views
Hi, I was trying to use Instruments on a executable Swift Package I am working on but I keep getting this error. "Required kernel recording resources are in use by another document." What document? I also can't profile Swift NIO's NIOHTTP1Server or a fresh iOS project using File > New > Project > Multiplatform App I was getting this error before revoking the current certificate in keychain and setting up a new one. “Failed to gain authorization” https://developer.apple.com/forums/thread/681687 Xcode/Instruments 13.3 (13E113) Thanks in advance for any help.
Posted
by
Post not yet marked as solved
0 Replies
252 Views
When there is a large number of supplementary views, scrolling is extremely slow. To reproduce: Download Apple's demo of "Implementing Modern Collection Views" from here Open project in Xcode and show PinnedSectionHeaderFooterViewController.swift Go to line 106 and replace it with let sections = Array(0..<3000) Run project, navigate to "Pinned Section Headers" page, and try scrolling. Scrolling is barely possible and extremely slow! While profiling with Time instrument, issue seems to rely in invalidating supplementary views. Screenshot attached below. How can I fix this? (I have many section headers in my view)
Posted
by
Post marked as solved
1 Replies
419 Views
When trying to profile any process with the Instruments CPU Profiler I get this message: (Before run started) No allocated PMI record. Not sure what to do here. I tried other instruments like time profile and that works fine so not sure what to do here... Didn't find any people having similar issues when googling so I'm hoping someone here can help me out. Im using a m1 max 14 inch macbook pro with macOS 12.3 and instruments 13.0 (13A1030d)
Posted
by
Post not yet marked as solved
1 Replies
299 Views
We've been trying to deal with this issue for weeks now. We suspect might be something related with sendbird and we are also in contact with sendBird team but getting nowhere. Sometimes, when starting our app after the login our app just freezes and becomes unresponsive, sometimes even causing a crash. We are having some trouble finding out what is causing it. Today I was able to replicate the issue using an iPhone 7 simulator with ios 15.4 and I was able to debug a little. The debug view hierarchy is also unresponsive and suggests to try and use time profile, which I did. I also use Thread safe But I couldnt actual make much sense of the results. So I was hoping you could help me with it. Hopefully, you can provide some light on this issue. Thanks
Posted
by
Post not yet marked as solved
3 Replies
528 Views
I have a schema building an instruments package. After updating to Xcode 13.3 it fails with: BuildInstrumentsPackage ....instrdst... /Applications/Xcode.app/Contents/Developer/usr/bin/instrumentbuilder ... Assertion failed: (_columnToInterpolationExpressionMapping[column] == nil), function -[XRPackageModelingRuleSystem setColumnInterpolation:expression:definesLayoutScope:], file XRPackageModelingRuleSystem.m, line 422. Command BuildInstrumentsPackage failed with a nonzero exit code I don't have a clue what's going wrong. Any hint?
Posted
by
Post marked as solved
3 Replies
609 Views
Hi @eskimo and experts, I created a simple code and found there is a memory leak: #import &lt;Foundation/Foundation.h&gt; #include &lt;functional&gt; void testLeaks(const std::function &lt;void (int)&gt;&amp; inCallback) {   NSTask* task = [[NSTask alloc] init];   [task setTerminationHandler:^(NSTask* inTask) {     inCallback(inTask.terminationStatus);   }];       [task release]; } int main(int argc, const char * argv[]) {   auto callback = [](int result) {     NSLog(@"callback");   };   testLeaks(callback);   NSLog(@"done");   return 0; } The output of leaks: Process: testLeaks2 [13084] Path: /Users/USER/Library/Developer/Xcode/DerivedData/Build/Products/Debug/testLeaks2 Load Address: 0x10a04d000 Identifier: testLeaks2 Version: ??? Code Type: X86-64 Platform: macOS Parent Process: leaks [13083] Date/Time: 2022-02-28 23:34:28.374 +0800 Launch Time: 2022-02-28 23:34:27.939 +0800 OS Version: Mac OS X 10.15.6 (19G73) Report Version: 7 Analysis Tool: /Applications/Xcode.app/Contents/Developer/usr/bin/leaks Analysis Tool Version: Xcode 12.4 (12D4e) ---- leaks Report Version: 4.0 Process 13084: 596 nodes malloced for 59 KB Process 13084: 1 leak for 48 total leaked bytes. 1 (48 bytes) ROOT LEAK: &lt;__NSMallocBlock__ 0x7fbbc2704350&gt; [48] testLeaks2 invocation function for block in testLeaks(std::__1::function&lt;void (int)&gt; const&amp;) 0..." Looks the issue is in the block of setTerminationHandler. How do I address this memory leak issue if I want to keep using std::function as a callback?
Posted
by
Post not yet marked as solved
0 Replies
305 Views
Hello dear kindly I need your support about this problem since I update my iOS 15.3.1 every time I have a call and get waiting I can’t close this sound beep beep beep beep beep only solution to end this sound press on lock bottom so both of call will end or I can reject and answer second call or I can reject only or I can answer and hold So please I need solution for this problem
Posted
by
Post not yet marked as solved
1 Replies
312 Views
I would like to retrieve operation lengths of different metal GPU informations in form of xml. I know that exporting is possible using xtrace but how could i export the information of all wire memory statistics for example that are shown in the regarding row inside instruments. It would be helpful to get the xpath something in the GUI of Instruments belongs to. Specifically i am looking at Metal GPU traces. Any help is much appreciated! —toc gives a list of all contents but no description or affiliation with data in the GUI.
Posted
by
Post marked as solved
2 Replies
513 Views
When I attempt to log network requests with the new "Network" profiling template with "Http Traffic" instrument (Instruments version 13.2.1), I get network connections data on my iphone, but no HTTP traffic data. I'm running with iOS 15.3 on iphone 11, and running macos 12.2 I get the warning that sensitive data will be recorded in the trace, but I never get any actual events posted there. I also don't get any kind of warnings or errors from Instruments telling me why it might have issues recording anything. I get these data from Charles just fine (when I properly setup Charles as a proxy). From what I read, Instruments HTTP Traffic should "just work", but for me it's not and not telling me why. Is there any way to diagnose why I'm not getting any Http traffic data in my recordings? I've disabled web protection on the phone (Microsoft Defender), which was necessary for Charles to work, but I never needed to install any certificate for instruments (or are there any instructions to do so), so I assume there is a default certificate that is used to encrypt web traffic which instruments can decrypt. I'd really like to use this tool!
Post not yet marked as solved
2 Replies
299 Views
I have 3 devices. One is iPhone 7 plus which system version is iOS 14.8. and the others are iOS 15.1, though one is iPhoneX , one is ipad. When I use xcode to run my app, I find out the memory keeps rasing in iOS 15.1. By using instruments, I could see there're a lot autoreleasepoll content(which is growing more and more). But it doen't happen on iOS 14.8.
Posted
by
Post not yet marked as solved
1 Replies
273 Views
I have a custom Xcode 13.2.1 (13C100) Instrument to which I have recently added os-signpost-point-schema. I notice that the events are marked with a hyphen/dash rather than a ⓢ. See the comparison of the signposts in my custom tool vs the standard “Points of Interest” tool: I have been digging through the documentation and while I am wagering that there is some simple attribute that can be set to dictate which symbol is included within the signpost circle, but it is not jumping out at me. How does one select the symbol used within custom event points in Instruments? FWIW, here is my Instrument: <?xml version="1.0" encoding="UTF-8" ?> <!-- Instruments Developer Help: https://help.apple.com/instruments/developer/mac/current/ --> <package> <id>com.robertmryan.CustomInterval</id> <version>0.2</version> <title>Custom Points of Interest</title> <owner> <name>Robert Ryan</name> </owner> <import-schema>os-signpost</import-schema> <!-- See https://help.apple.com/instruments/developer/mac/current/#/dev536412616 --> <os-signpost-point-schema> <id>custom-point-schema</id> <title>Points</title> <owner> <name>Robert Ryan</name> </owner> <purpose>Provide mechanism for multicolored events posted by `os_signpost`; The string generated by `os_signpost` must be in form of "Label:%d,Concept:%{public}@", where "Label" is string that will control what text appears in the event, and "Concept" is one of the strings listed in https://help.apple.com/instruments/developer/mac/current/#/dev66257045 that dictates the color of the interval. No spaces after the commas within this string.</purpose> <note>That message must use that printf-style format, not embedding the values in the format string literal.</note> <!-- you can constrain this to a particular subsystem if you'd like: <subsystem>"com.domain.MyApp"</subsystem> --> <category>"Interval"</category> <name>?name</name> <pattern> <message>"Label:" ?label ",Concept:" ?concept</message> </pattern> <column> <mnemonic>name</mnemonic> <title>Name</title> <type>string</type> <expression>?name</expression> </column> <column> <mnemonic>label</mnemonic> <title>Label</title> <type>string</type> <expression>?label</expression> </column> <column> <mnemonic>concept</mnemonic> <title>Concept</title> <type>event-concept</type> <expression>?concept</expression> </column> </os-signpost-point-schema> <os-signpost-interval-schema> <id>custom-interval-schema</id> <title>Intervals</title> <owner> <name>Robert Ryan</name> </owner> <purpose>Provide mechanism for multicolored intervals posted by `os_signpost`; The string generated by `os_signpost` must be in form of "Label:%d,Concept:%{public}@", where "Label" is string that will control what text appears in the interval, and "Concept" is one of the strings listed in https://help.apple.com/instruments/developer/mac/current/#/dev66257045 that dictates the color of the interval. No spaces after the commas within this string.</purpose> <note>That message must use that printf-style format, not embedding the values in the format string literal.</note> <!-- you can constrain this to a particular subsystem if you'd like: <subsystem>"com.domain.MyApp"</subsystem> --> <category>"Interval"</category> <name>?name</name> <start-pattern> <message>"Label:" ?label ",Concept:" ?concept</message> </start-pattern> <column> <mnemonic>name</mnemonic> <title>Name</title> <type>string</type> <expression>?name</expression> </column> <column> <mnemonic>label</mnemonic> <title>Label</title> <type>string</type> <expression>?label</expression> </column> <column> <mnemonic>concept</mnemonic> <title>Concept</title> <type>event-concept</type> <expression>?concept</expression> </column> </os-signpost-interval-schema> <instrument> <id>com.robertmryan.CustomInterval.instrument</id> <title>Custom Points of Interest</title> <category>Behavior</category> <purpose>Provide multi-colored intervals as dictated by the "event-concept" parsed from the `start-pattern` string.</purpose> <icon>Points of Interest</icon> <limitations></limitations> <create-table> <id>custom-interval-table</id> <schema-ref>custom-interval-schema</schema-ref> </create-table> <create-table> <id>custom-point-table</id> <schema-ref>custom-point-schema</schema-ref> </create-table> <graph> <title>Custom Interval Graph</title> <lane> <title>Points</title> <table-ref>custom-point-table</table-ref> <plot-template> <instance-by>name</instance-by> <label-format>%s</label-format> <value-from>name</value-from> <color-from>concept</color-from> <label-from>label</label-from> </plot-template> </lane> <lane> <title>Intervals</title> <table-ref>custom-interval-table</table-ref> <plot-template> <instance-by>name</instance-by> <label-format>%s</label-format> <value-from>name</value-from> <color-from>concept</color-from> <label-from>label</label-from> <qualified-by>layout-qualifier</qualified-by> </plot-template> </lane> </graph> <list> <title>Custom Regions of Interest</title> <table-ref>custom-interval-table</table-ref> <column>name</column> <column>label</column> <column>concept</column> <column>start</column> <column>duration</column> </list> <list> <title>Custom Points of Interest</title> <table-ref>custom-point-table</table-ref> <column>name</column> <column>label</column> <column>concept</column> </list> </instrument> </package>
Posted
by