Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit '0ea3ac7890d550f84c5ae56ae3b29920b1615896'

  • Loading branch information...
commit 36deb0ef909a35333946ce66161f8a3aab64d0cf 2 parents 032c95e + 101fe58
Aaron Sarazan authored
Showing with 31 additions and 13 deletions.
  1. +2 −2 Documentation/INSTALL.md
  2. +3 −0  HookshotDemo/README.md
  3. +26 −11 README.md
View
4 Documentation/INSTALL.md
@@ -96,8 +96,8 @@ We recommend adding instrumentation in your AppDelegate class's `initialize` met
return;
}
if ([[[[NSProcessInfo processInfo] environment] objectForKey:@"HookshotProfile"] isEqualToString:@"YES"]) {
- PROFILE_CLASS(self);
- PROFILE_CLASS([UIWebView class]);
+ HOOKSHOT_PROFILE_CLASS(self);
+ HOOKSHOT_PROFILE_CLASS([UIWebView class]);
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~
View
3  HookshotDemo/README.md
@@ -0,0 +1,3 @@
+# hookshot demo
+
+The hookshot demo is a simple application that loads the Cue home page and instruments UIWebView, the AppDelegate, and counts live instances of images.
View
37 README.md
@@ -21,28 +21,43 @@ AppDelegate.application:didFinishLaunchingWithOptions:
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-## hookshot uses undocumented Apple APIs
+### hookshot uses undocumented Apple APIs
We'll say it again: **hookshot uses undocumented Apple APIs.** This is necessary for profiling and debugging, but will get your application rejected during App Store review if hookshot makes it in to production code. Follow the installation instructions to ensure hookshot is properly configured to be one big NOOP for release builds.
+## What is it?
+
+hookshot contains an instrumenting profiler. Contrary to its name, Apple's profiler in Instruments is actually a sampling profiler. We find both useful
+for different occasions. Specifically, we find hookshot most useful for:
+
+* Thread activity graphs with drill-in
+
+* Seeing accurate counts of calls
+
+* More precise per-call timings of messages
+
+* Measurement of messages with highly variable performance
+
+hookshot also contains utilities for counting live instances of classes you care about and generic message instrumentation.
+
## Installation
-You can get hookshot in your project within about 5 minutes: [step-by-step installation instructions](/Cue/hookshot/blob/master/Documentation/INSTALL.md)
+You can get hookshot in your project within about 5 minutes: [step-by-step installation instructions](/Documentation/INSTALL.md)
## Profiling
hookshot provides a whitelist based instrumenting profiler. You can use it to time critical parts of your code and identify bottlenecks.
-Once you've [installed](/Cue/hookshot/blob/master/Documentation/INSTALL.md) hookshot in your project and run it, you can start exploring your data.
+Once you've [installed](/Documentation/INSTALL.md) hookshot in your project and run it, you can start exploring your data.
### Basic hooks
Early in your application's run, you can instrument any classes you want to measure performance of:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.objc
-PROFILE_CLASS([AppDelegate class]);
-PROFILE_CLASS([UIWebView class]);
-PROFILE_CLASS_EXCEPT([AnotherClass class],
+HOOKSHOT_PROFILE_CLASS([AppDelegate class]);
+HOOKSHOT_PROFILE_CLASS([UIWebView class]);
+HOOKSHOT_PROFILE_CLASS_EXCEPT([AnotherClass class],
[NSValue valueWithPointer:@selector(someFrequentlyCalledSelector)],
[NSValue valueWithPointer:@selector(anotherFrequentlyCalledSelector)])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -51,7 +66,7 @@ You can omit messages you know are called frequently where you suspect profiling
### profile.py
-[/bin/profile.py](/Cue/hookshot/blob/master/bin/profile.py) will analyze your latest profile data dump and summarize it:
+[/bin/profile.py](/bin/profile.py) will analyze your latest profile data dump and summarize it:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ bin/profile.py
@@ -179,7 +194,7 @@ AppDelegate.viewController 1 0.004ms
You can use hookshot to track how many instances of a given class are live.
~~~~~~~~~~~~
-COUNT_INSTANCES(cls);
+HOOKSHOT_COUNT_INSTANCES(cls);
~~~~~~~~~~~~
It's best to install this hook in your AppDelegate `initialize` or in the `initialize` of the class you want to count instances of.
@@ -205,7 +220,7 @@ class ClassName {
write
~~~~~~~~~~~~.cpp
-COUNTED_CPP_CLASS(X) {
+HOOKSHOT_COUNTED_CPP_CLASS(X) {
...
}
~~~~~~~~~~~~
@@ -213,13 +228,13 @@ COUNTED_CPP_CLASS(X) {
In your implementation file, at the top, add:
~~~~~~~~~~~~
-COUNTED_CPP_CLASS_IMPLEMENTATION_PREAMBLE(ClassName)
+HOOKSHOT_COUNTED_CPP_CLASS_IMPLEMENTATION_PREAMBLE(ClassName)
~~~~~~~~~~~~
## Generic Instrumentation
The above features are built on top of a generic capability for instance message instrumentation defined
-in [Classes/CCInstanceMessageInstrumentation.h](/Cue/hookshot/blob/master/Classes/CCInstanceMessageInstrumentation.h)
+in [Classes/CCInstanceMessageInstrumentation.h](/Classes/CCInstanceMessageInstrumentation.h)
We'd love to hear what (non-production!) uses you find for it.

0 comments on commit 36deb0e

Please sign in to comment.
Something went wrong with that request. Please try again.