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
0 Replies
416 Views
I'm using xcrun xctrace export --output results.xml --input test_trace.trace --xpath '//trace-toc[1]/run[1]/data[1]/table' to export data from a test run with instruments as part of my app's CI. With Xcode 12 this resulted in an xml file that I could parse relatively quickly, but now with Xcode 13 the export process itself is taking 90+ seconds and generating a 160mb xml file for a 10 second recording. I noticed the table that has increased is the time-sample schema. Just attempting to export this table with --xpath '//trace-toc[1]/run[1]/data[1]/table[4]' takes quite a while. The table has about 790 thousand rows. I'm using a custom instrument based off the time profiler, and still have about the same number of stack trace samples in my output. Did anything change in Xcode 13 that caused instruments to include many more time samples that aren't corresponding to a stack trace? Is it possible to disable this to have fewer time samples in my trace (while preserving the stack trace frequency) so the xml can be parsed quicker?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.1k Views
I use “Points of Interest” signposts and ranges all the time. But with Xcode 11.4, I’m no longer seeing signposts for my iOS targets. Is this a known issue?import os.log private let pointsOfInterest = OSLog(subsystem: "PointsOfInterestDemo", category: .pointsOfInterest) class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() os_signpost(.event, log: pointsOfInterest, name: "viewDidLoad") } @IBAction func didTapStartRange(_ sender: Any) { let id = OSSignpostID(log: pointsOfInterest) os_signpost(.begin, log: pointsOfInterest, name: "didTapStartRange", signpostID: id) DispatchQueue.main.asyncAfter(deadline: .now() + 3) { os_signpost(.end, log: pointsOfInterest, name: "didTapStartRange", signpostID: id) } os_log("didTapStartRange") } @IBAction func didTapSignpost(_ sender: Any) { os_signpost(.event, log: pointsOfInterest, name: #function) os_log("didTapSignpost") } }It works in Xcode 11.3.1 (11C505), but not Xcode 11.4 (11E146). And in Xcode 11.4, it works for macOS targets, but not iOS targets. I’m running Catalina 10.15.4 (19E266) on MacBook Pro (15-inch, 2018). I tried deferred recording, and 13.2 simulator target, all with no joy.
Posted
by eoonline.
Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
In XCode 9.2, I open the Accessibility Inspector and want to change font size to test dynamic type. I click the Settings tab, but there's no font size slider.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
0 Replies
218 Views
When measuring "Game Performance" from Instruments in "Deferred" mode with a connected device, I'm seeing huge regions of data go missing. I'm trying to figure out why this might be the case, and what I can do to capture more reliable data. Ideally I would like to capture 60 seconds of gameplay and analyze the performance, but very often only a fraction of the graph has data. The amount varies wildly, even on a very basic tutorial-level Metal application. Sometimes I'll get the full 60 seconds, other times only 5 seconds (with 55 seconds of empty space), and I'm always running with the same settings. Any ideas? Is anyone else able to reliably get the full set of data? **For reference, I'll state that I'm using an iPhone 13 Pro and an iPad Pro 11, so I don't think the devices are too underpowered. I even tested on two different computers and got similar results.
Posted
by m_baxter.
Last updated
.
Post not yet marked as solved
0 Replies
244 Views
Instruments CoreAnimation FPS don't display 120,why???
Posted
by xiaoliu.
Last updated
.
Post not yet marked as solved
0 Replies
876 Views
As per Xcode 13 Release Notes - To support the new JSON-format crash logs generated in macOS Monterey and iOS 15, Instruments includes a new CrashSymbolicator.py script. This Python 3 script replaces the symbolicatecrash utility for JSON-format logs and supports inlined frames with its default options. For more information, see: CrashSymbolicator.py --help. CrashSymbolicator.py is located in the Contents/SharedFrameworks/CoreSymbolicationDT.framework/Resources/ subdirectory within Xcode 13. (78891800) usage: CrashSymbolicator.py [-h] [-d dSYM] [-s SEARCH_PATH] [-o OUTPUT_FILE] [-p] [-w N] [--no-inlines] [--no-source-info] [--only-missing] [--no-system-frameworks] [--no-demangle] [-v] LOGFILE Symbolicate a crash log python3 CrashSymbolicator.py -d PATH_TO_DSYMS -o PATH_TO_OUTPUT CRASH_LOG_FILE When we run this command getting the following errors Traceback (most recent call last): File "CrashSymbolicator.py", line 502, in symbolicate(args) File "CrashSymbolicator.py", line 482, in symbolicate crash_log.write_to(args.output, args.pretty) File "/Applications/Xcode.app/Contents/SharedFrameworks/CoreSymbolicationDT.framework/Versions/A/Resources/JSONCrashLog/JSONCrashLog.py", line 167, in write_to ips_header_dictionary = vars(self.ips_header) TypeError: vars() argument must have dict attribute
Posted
by neha24.
Last updated
.
Post not yet marked as solved
0 Replies
218 Views
Hi, we're profiling our iOS app with XCode13. We found there are cache miss counters like L1D_CACHE_MISS_LD and L1D_CACHE_MISS_ST. However, we couldn't find a counter related to L1 data cache access. Therefore, we couldn't calculate the cache miss rate. But we found there is a L1D_TLB_ACCESS counter. Can we assume that every TLB access will lead to a data cache access, so we can use L1D_TLB_ACCESS as L1 data cache access?
Posted
by Kai Zhang.
Last updated
.
Post not yet marked as solved
0 Replies
239 Views
Use instrument to test the frame rate of iPhone 13 Pro App, Core Animation FPS only displays 60 at most, not 120。please tell me why. vsync displays 8ms, but the frame rate does not display 120,why???
Posted
by xiaoliu.
Last updated
.
Post not yet marked as solved
1 Replies
230 Views
I wrote simple NSMutableData test project. I profiled with allocations instruments. It shows alloc1() total bytes are 55MB. But alloc1() only called once and alloced byte should be 1MB. I cannot find the reason of 55MB allocation in alloc1() Replace this code with fresh macOS App project on Xcode13. #import "ViewController.h" @implementation ViewController {     NSTimer *mTimer;     NSMutableData *mData1;     NSMutableData *mData2; } - (void)viewDidLoad {     [super viewDidLoad];     mData1 = nil;     mData2 = nil;     mTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self             selector:@selector(timer_cb) userInfo:nil repeats:YES]; } - (void) timer_cb {     if (mData1 == nil) {         [self alloc1];     }     if (mData2 == nil) {         [self alloc2];     }     [self copy1]; } - (void) alloc1 {     NSLog(@"alloc1");     mData1 = [NSMutableData dataWithCapacity:1024*1024]; } - (void) alloc2 {     NSLog(@"alloc2");     mData2 = [NSMutableData dataWithCapacity:1024*1024];     [mData2 resetBytesInRange:NSMakeRange(0, 1024*1024)]; } - (void) copy1 {     [mData1 replaceBytesInRange:NSMakeRange(0, 1024*1024) withBytes:mData2.bytes]; } @end
Posted
by Himadeus.
Last updated
.
Post not yet marked as solved
1 Replies
236 Views
Hii, im having troubles updating the software of my ipad 6thgen the reason is, there are no software Update button on my Ipad settings/general, and if i try to update it using our computer and itunes it is also not working..can you please make a solution for this thank you😊🥺
Posted
by Eugenetyy.
Last updated
.
Post not yet marked as solved
1 Replies
813 Views
I have a MacOS application which displays a NSStatusItem with a custom view, implemented in SwiftUI. I noticed some rather terrible performance problems, however only when I am using some specific wallpapers. I've made a super small Xcode project - https://github.com/nmcdonaldd/StatusItemCACommitCycle demoing the behavior. In that repo, I've also linked a YouTube video demoing the behavior (can't post video link here for some reason). With one wallpaper, Instruments Time Profile is showing little-to-no weight in any CA-related traces. However, as soon as I change the wallpaper, Instruments is reporting a huge increase in CA::Transaction::commit(). After updating the wallpaper, Core Animation commit graph in instruments is showing hundreds of commits per second. When I switch it back to the first wallpaper, it stops. Also interesting - as soon as I switch the wallpaper, Instruments Time Profiler is reporting my application to be out of "Initializing" state and now into "Foreground". Is this a bug or something I, as a developer, can prevent? Furthermore, how would a wallpaper change the state of my application?
Posted Last updated
.
Post marked as solved
4 Replies
1.1k Views
On three different machines (all running Xcode 13 and Big Sur), it always tells me that the command-line developer tools need to be installed. I've "installed" them four times so far on one machine, and at least twice on the other two.
Posted
by kithrup.
Last updated
.
Post not yet marked as solved
4 Replies
908 Views
I updated my xcode 12.5 to xocde 13 and after that Install command line developer tool popup come & ask to install "Instruments". I click on install & accepted license. and installation finished. But I am getting this popup again & again even i cancelled it still it is showing again & again. Please help me here to get rid from this popup.
Posted Last updated
.
Post not yet marked as solved
3 Replies
699 Views
When using the Hitches instrument in Xcode 12.5, I am never getting data for the Commits phase. It just says "No Graphs". I tried out the instrument with two phones & two apps and it never worked. Any tips?
Posted
by rp24.
Last updated
.
Post not yet marked as solved
1 Replies
388 Views
One of our team members reported very high memory usage for our Network System Extension in Activity Monitor. Therefore, to check for leaks and accumulating memory, I plugged it into Instruments which shows quite low usage (~4MB) compared to Activity Monitor (40MB) at same moment. I am instrumenting release version of my extension (and App). So, my questions are: Why such a huge difference in these two tools? Which one should be considered more authentic/valid memory usage Is there any upper limit for Network System Extension? From my iOS experience, I remember iOS has 15MB limit for Network Extensions. Is there any such limit for Network System Extensions?
Posted Last updated
.
Post not yet marked as solved
0 Replies
295 Views
On three different machines (all running Xcode 13 and Big Sur), it always tells me that the command-line developer tools need to be installed. I've "installed" them four times so far on one machine, and at least twice on the other two.
Posted
by kithrup.
Last updated
.
Post not yet marked as solved
0 Replies
369 Views
I have this performance test to check Memory usage during scrolling. func testMemotyUsage() { let app = XCUIApplication() let measureOptions = XCTMeasureOptions() measureOptions.invocationOptions = [.manuallyStop] measure( metrics: [XCTMemoryMetric(application: app)], options: measureOptions ) { app.buttons["Listing Page"].tap() swipeUp() stopMeasuring() tapBack() } } func tapBack() { app.navigationBars.buttons.element(boundBy: 0).tap() } func swipeUp() { collectionView.swipeUp(velocity: .fast) } func swipeDown() { collectionView.swipeDown(velocity: .fast) } var collectionView: XCUIElement { app.collectionViews["collectionViewId"] } But when I run the test, it doesn't display any metrics at all. I tried to update XCTMemoryMetric(application: app) -> to XCTMemoryMetric() In this case it at least shows some result, but the result is incorrect, because as it's seen on the screenshot below, the app consumes around 130 MB of memory, but the test shows 9 KB only. BTW the real memory consumption is around 130-150 MB, because there are a lot of images in the collection view. My guess that it doesn't show the correct result, because the app is not passed as a parameter. Although when I pass the app, it doesn't show any results at all 🙃 Same issue happens when I write the test to check CPU usage with XCTCPUMetric. Questions: How to write a performance test that will show memory and CPU usage of some UI tests? (Optional) Why when I run the test in Debug mode, it shows that 2 processes are running (ExampleUITests - the target for UI tests, and Example - the main target). Is it normal and when I measure the memory consumption, am I supposed to get the consumption of the main target Example, right?
Posted
by paultas2.
Last updated
.