EzDevInfo.com

Shark

Swift Script that transforms the .xcassets folder into a type safe enum

Launching a process with arguments and profile with shark

I need to sample a (cli) application with shark and pass parameters to it like so:

shortest-path <input-ref-littleendian|diff -u - output-ref

How can I do this with shark? Shark assumes that the parameters i need to pass to the launched cli app are for shark itself, not the process.


Source: (StackOverflow)

Shark L2 cache profiling won't take samples

I'm trying to use Shark to check for L2 cache misses, but it won't work. All of the other Shark sampling modes work fine.


Source: (StackOverflow)

Advertisements

Is there a Quick Guide on how to use Shark with iPhone to measure performance?

I set it to iPhone/Network mode, but the device never appears anywhere. Connected and running an app through xcode. Do you know a useful tutorial for this?


Source: (StackOverflow)

"blkclr (mach_kernel)" shows up in mac's shark profiler. What does it do?

I am profiling a C program using Mac's Shark which shows that some of CPU time goes to "blkclr" in "mach_kernel". What does this kernel function do? I speculate it is related to memory allocation, but I am not sure. I have googled for some time, but could not find the answer, either. Does someone know this? Thanks in advance.


Source: (StackOverflow)

How to set that compiler flag?

Shark told me this:

This instruction is the start of a loop that is not aligned to a 16-byte address boundary. For optimal performance, you should align the start of a hot loop using a compiler directive. With gcc 3.3 or later, use the -falign-loops=16 compiler flag.

for (int i=0; i < 4; i++) { // line with the info
   //...code
}

How would I set that flag, and does it really improve performance?


Source: (StackOverflow)

Shark tool on iphone crashes

I am trying to use Shark to profile my app. However, it crashes after I hit "stop" and it analyzes and then goes to "load session". Only once when I decided not to select my app but chose to target "everything" did it actually display some trace. However, I could not reproduce this case. Does anyone have any idea what might be going wrong? Could it be something to do with the wrong version of Shark or my SDK or some other detail? I have the latest SDK and am running 3.1.3 on the phone.

The various documentation I've found on google or via Apple's docs don't seem to be terribly helpful, so if anyone has found some that's useful, I'd love to see it. Thanks.


Source: (StackOverflow)

What makes Apple's PowerPC memcpy so fast?

I've written several copy functions in search of a good memory strategy on PowerPC. Using the Altivec or fp registers with cache hints (dcb*) doubles the performance over a simple byte copy loop for large data. Initially pleased with that, I threw in a regular memcpy to see how it compared... 10x faster than my best! I have no intention of rewriting memcpy, but I do hope to learn from it and accelerate several simple image filters that spend most of their time moving pixels to and from memory.

Shark analysis reveals that their inner loop uses dcbt to prefetch, with 4 vector reads, then 4 vector writes. After tweaking my best function to also haul 64 bytes per iteration, the performance advantage of memcpy is still embarrassing. I'm using dcbz to free up bandwidth, Apple uses nothing, but both codes tend to hesitate on stores.

prefetch
  dcbt future
  dcbt distant future
load stuff
  lvx image
  lvx image + 16
  lvx image + 32
  lvx image + 48
  image += 64
prepare to store
  dcbz filtered
  dcbz filtered + 32
store stuff
  stvxl filtered
  stvxl filtered + 16
  stvxl filtered + 32
  stvxl filtered + 48
  filtered += 64
repeat

Does anyone have some ideas on why very similar code has such a dramatic performance gap? I'd love to marinate the real image filters in whatever secret sauce memcpy is using!

Additional info: All data is vector aligned. I'm making filtered copies of the image, not replacing the original. The code runs on PowerPC G4, G5, and Cell PPU. The Cell SPU version is already insanely fast.


Source: (StackOverflow)

Shark for profiling iPhone app

Hi All I am using Shark to profile my application on iphone. As per instruction in Shark user guide from http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/SharkUserGuide/SelectingExecutiontoSampleorTrace/SelectingExecutiontoSampleorTrace.html#//apple_ref/doc/uid/TP40005233-CH13-SW19

I am able to generate profile for my application. But most of functions in my application appear as unknown under symbol header. This is because I am using release version of application. The user guide suggest that symbol information can be generated by using symbolification information and symbol rich binary of application. So first I generated debug version of application retaining the debug information then generated release version and used shark to profile and then used FILE/symbolicate option and selected the debug version of application from Debug-iphoneOs. I get error symbolification failed. Can anyone suggest a method to eliminate this error?


Source: (StackOverflow)

Shark was unable to find symbol information for this address range - iPhone

I'm trying to use Shark to determine which method(s) are taking the most time in my iPhone app. After sampling, I get this: alt text

Clicking the "!" button yields:

Shark was unable to find symbol information for this address range. Typically this happens because the application was compiled without symbols or they have been subsequently stripped away. In Xcode, make sure the "Generate Debug Symbols" checkbox is selected (passes the -g flag to the compiler). Note that this does not affect code optimization, and does not typically alter performance significantly. However, the extra symbol information does consume significantly more space and may bloat the size of the executable.

But I AM using the Debug option, and I am running on my Device. And Generate Debug Symbols IS checked. So what's wrong?


Source: (StackOverflow)

Shark crashes on processor bandwidth trace

Shark started crashing on me when I use the "Processor Bandwidth (Core 2)" mode of analysis. It collects the samples, spends the time to analyze them, and crashes with a bus error about when the window should come up.

First I thought it might be because I've been running on low memory. I installed the latest system updates, rebooted, tried again. No difference. Installed latest XCode, no difference. Used CHUD Remover, reinstalled Shark, rebooted, no difference. Tried building with symbols and without.

All the other analyses work. I don't have any third-party KEXTs and never had problems with this before.

Has anyone else seen this? Is there another forum where I can ask this kind of thing? (Apple's dev forums require a $500/yr support package!) Is there a verbose mode for Shark, perhaps via command-line option?


Source: (StackOverflow)

Shark does not show function names

I want to use shark to profile my application(I used it before and it worked fine), but now it does not show any function name. I have only Unknown Library and address[unknown] in symbol column. Some project parts are static libraries(compiled and linked in same project, with debug symbols on). Function names from standard lib or from other framework are shown.

Thanks for help!


Source: (StackOverflow)

How to Profile a C-Program in a Loop of Shell Script, Using Shark on Mac?

I have a question about Shark-profiling on mac.

Say if I have a C-program, compiled with:

gcc -o mycprog mycprog.c -g -pg

and also I have a shell script something like:

for file in ($SomeDirectory)
do
    mycprog $file
done

I need to profile the average performance for all files in $SomeDirectory.

Where should I put the shark -i command? Thanks.


Source: (StackOverflow)

Why could Shark be so slow?

I'm trying to profile Ruby interpreter. I run shark -i ./ruby bm_sudoku.rb or something like that, the script finishes in less than a second, and then Shark goes to "CHUDData - Analyzing samples... 99.3%.." point and stays there frozen for 10 minutes or so. It finishes eventually, it's just so ridiculously slow it's pretty much unusable.

Version I have here is OSX 10.5, shark 4.6.1 (227).

Any ideas what that might be?


Source: (StackOverflow)

shark does not show source code

We are trying to run shark on our iphone application. However, in the analyzed samples it does not list any of our application function. All that is listed are the libraries and when we click on any of those, the assembly code is visible. Most of the sites mention about 'Generate Debug Symbols' option when building the app; I am not able to find this option either. Instead I have enabled the 'Generate Profiling Information' option. Can anyone please help as to how do I see my application functions and source code in the analyzed samples of Shark?


Source: (StackOverflow)

Where can I download Shark?

This is probably a rather dumb question but I've been looking around the Apple developer pages and I haven't found any download link to shark. I did a search on my hard drive and I only found shark plugins...


Source: (StackOverflow)