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)
Instruments
RSS for tagInstruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.
Post
Replies
Boosts
Views
Activity
I want to test app launch performance in my project.
Therefore I tried to use performance test with measure func and XCTApplicationLaunchMetric. But after test completion there is no any result with average time.
Here is a test example:
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
But when I create a new empty project and add the same performance test – it works and shows app launch results.
1st image is a real project test – there is no test result.
and the 2nd image is a demo empty project test – it has performance result diagram.
I am running test on MacBook with M1 Pro chip. However, when my colleague is running the same performance test on our real project with Intel based MacBook Pro – all is fine, it shows app launch results correctly as my demo project.
I have no idea how it can be fixed, because it seems that it depends on M1 chip 🤷🏻♂️.
May be somebody have a solution?
I just downloaded Xcode 15 RC and iOS 17 RC on an iPhone Xr. When running the app it seems to run fine however when trying to run in profile mode I get the error:
Failed to install embedded profile for com...* : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.)
Verify that the Developer App certificate for your account is trusted on your device. Open Settings on the device and navigate to General -> VPN & Device Management, then select your Developer App certificate to trust it.
Does anyone have any insight into what the issue may be? There is nothing to select within VPN & Device Management when I navigate there
The Leaks Instrument in Sonoma never reports any leaks. This is happening on Sonoma only. Instruments on Ventura reports the leaks appropriately.
This feels like a bug in Instruments on Sonoma, but I wanted to check in here to see if maybe I'm doing something wrong.
Steps to dupe:
On a Sonoma machine, create a Mac OS Application Project in Xcode, using xibs and Objective-C.
In the app delegate create a method:
- (IBAction)leak:(id)sender
{
NSLog(@"LEAK!");
int* ptr = ( int* )malloc( 5 * sizeof(int) );
}
In the MainMenu.xib, create a button in the window and connect it to the leak action.
Build and Run.
Launch Instruments and choose the Leaks tool.
Attach Instruments to your running application and start recording.
Click the Leak button in your app any number of times.
Stop recording in Instruments.
RESULT: Instruments reports no leaks found.
WORKAROUND: To see leaks on Sonoma I can do so in the Terminal using leaks with these steps:
Launch Terminal
export MallocStackLogging=1
leaks -atExit -- /Users/zack/Library/Developer/Xcode/DerivedData/Leaker-fkhkydpehobufngumikoydtpyxsc/Build/Products/Debug/Leaker.app/Contents/MacOS/Leaker NOTE: this leaks command takes the path to the actual built binary.
The app will launch.
Click the Leak button any number of times.
Quit the app.
For example, clicking the Leak button 7 times, the leaks tool reports:
STACK OF 7 INSTANCES OF 'ROOT LEAK: <malloc in -[AppDelegate leak:]>':
19 dyld 0x183e39058 start + 2224
18 ZJ.Leaker 0x10207d12c main + 60 main.m:14
17 com.apple.AppKit 0x187a33708 NSApplicationMain + 880
16 com.apple.AppKit 0x187a5c460 -[NSApplication run] + 512
15 com.apple.AppKit 0x187e8f1bc -[NSApplication _handleEvent:] + 60
14 com.apple.AppKit 0x18823bc08 -[NSApplication(NSEventRouting) sendEvent:] + 1556
13 com.apple.AppKit 0x187b9482c -[NSWindow(NSEventRouting) sendEvent:] + 284
12 com.apple.AppKit 0x187b94b6c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 364
11 com.apple.AppKit 0x187c093b4 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3472
10 com.apple.AppKit 0x187c0a5e8 -[NSControl mouseDown:] + 448
9 com.apple.AppKit 0x187c0b114 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 488
8 com.apple.AppKit 0x187c0b25c -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 144
7 com.apple.AppKit 0x187c0b850 NSControlTrackMouse + 1480
6 com.apple.AppKit 0x187c0e220 -[NSButtonCell _sendActionFrom:] + 88
5 com.apple.AppKit 0x187c0e2fc -[NSCell _sendActionFrom:] + 204
4 com.apple.AppKit 0x187c0e3d4 __26-[NSCell _sendActionFrom:]_block_invoke + 100
3 com.apple.AppKit 0x187c0e490 -[NSControl sendAction:to:] + 72
2 com.apple.AppKit 0x187c0e68c -[NSApplication(NSResponder) sendAction:to:from:] + 460
1 ZJ.Leaker 0x10207d2b8 -[AppDelegate leak:] + 88 AppDelegate.m:34
0 libsystem_malloc.dylib 0x183ff4ad0 _malloc_zone_malloc_instrumented_or_legacy + 276
====
7 (224 bytes) << TOTAL >>
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000ca5bc0> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000ca6e80> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000ca74a0> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000cb8520> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000cc0840> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000cc09a0> [32]
1 (32 bytes) ROOT LEAK: <malloc in -[AppDelegate leak:] 0x600000cc7a00> [32]
Error info is below.
Time Awake Since Boot: 1500 seconds
System Integrity Protection: disabled
Crashed Thread: 13 Dispatch queue: com.apple.dt.frame.activity
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000009
Exception Codes: 0x0000000000000001, 0x0000000000000009
Instruments CPU Profiler failed to start the profilable app (get-task-allow is set to true) with error "No PMI Record Found". Device is iPhone 13 Pro currently running iOS 17.0.3. Tried to profile in instruments shipped with Xcode 14.3.1, Xcode 15.0.1 and Xcode 15.1 Beta, same issue across. If it helps, I was able to successfully profile on iPhone X running iOS f16.7 using Xcode 14.2 instruments.
I would like to be able to collect profiling data on a physical device, say when I am going for a run, and later analyze that data using instruments.
Is there a way to do that?
Hi, I'm using Instrument to profile my metal app, found a metric called display ( average frame time ) shows much longer than what expected. Is this truly the frame time ? Or did I misunderstand something ?
I'm using instrument to profile my metal app, found there are more than one display devices shows on my view, I'm wondering what these display devices mean, thx .
as you can see, gpu performance start earlier than gpu activity, i don't know why? thx
this encoder happens to make gpu bubble, wondering what it is , and how to get rid of it, thx.
It seems this ops shows up many times, can anyone tell me what it is plz.?
Hello, I have a macbook for 1 year and I could never use Instruments Leaks. I always get these messages:
)
I have already reinstall my mac, I use the Xcode version 15, I tried to delete and reinstall Xcode. Nothing is working. Can somebody help me please?
➜ ~ xctrace version
xctrace version 15.0.1 (15A507)
in my project, i use xctrace record command to attach exist app process, it high probability lead app hang, but attach is ok;
how can i solve this problem?
Instruments in XCode 14 used to support CPU counters in A16 with iOS 16.x, but after I upgrade iOS to 17.1 and also XCode to 15.0.1, In "CPU Counters", it says "CPU Name: Unsupported" and thus I cannot choose "Sample by" events etc.
Found some link on this:https://stackoverflow.com/questions/77344529/is-latest-instruments-not-support-a17-pro-for-cpu-counters
Please help to confirm this is some known issue, and if so, how to fix it.
Thanks!
Hi,
I have a few traces where I have samples for kernel (and other processes), yet kernel is always 0 for any CPU Counter selected. There are other processes with an equivalent number of samples where the counter values appear.
Perhaps there is a bit of 'art' to get the kernel counters to populate?
I am trying to understand the workload from the system perspective (not simply the narrower process perspective), and it would be helpful to have the counter values. I've tried running for extended durations, yet that doesn't seem to adjust the counted events. I've adjusted to include "High Frequency Sampling" to resolve issues with VMware counter collection. Yet..
I need help to enable counter values to appear for kernel.
Sam
I'm tracing a process, specifically focusing on the Metal device track, which records frames from other processes like Terminal, WindowServer, and sometimes processes that utilize the GPU.
I attempted tracing with all apps closed and only Instruments running. However, it also records traces for Instruments.
This behavior wasn't present in previous versions of Instruments. Was there a recent change in Instruments/Xcode 15.0.1? I cannot find any relevant information about this in the release notes either.
Is there a way to configure Instruments to record only the running process?
Steps to reproduce:
Open Instruments app
Settings
Select recording tab (Next to General)
Click Open Keyboard Shortcut preferences to produce the aforementioned error.
Profiler Version 15.1 (15C65) - Instruments
macOs 14.1.2 (23B92)
Thanks all.
Instruments freeze when WKWebView is created
I create a very simple mac os application
If I create a WKWebView like this
"
(void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.webview = [[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 500, 500)];
}
"
Then the instruments freeze when I record allocations
Why?
If I remove the creation of WKWebView, everything works fine
I'm using Xcode 14.2
When I use Instruments to record Allocation, the phone will display a dialog box indicating that the phone is unlocked when the screen is locked, as shown in Figure 1.
When I have started recording allocation and lock the screen 10s later, the allocation can be recorded normally. For details, see Figure 2. I want to know why. Start recording for 10s and lock the screen on the device. The recording can be performed normally. What is the principle of this?