Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge commit '0ea3ac7890d550f84c5ae56ae3b29920b1615896'

  • Loading branch information...
commit 36deb0ef909a35333946ce66161f8a3aab64d0cf 2 parents 032c95e + 101fe58
Aaron Sarazan authored
4 Documentation/INSTALL.md
Source Rendered
@@ -96,8 +96,8 @@ We recommend adding instrumentation in your AppDelegate class's `initialize` met
96 96 return;
97 97 }
98 98 if ([[[[NSProcessInfo processInfo] environment] objectForKey:@"HookshotProfile"] isEqualToString:@"YES"]) {
99   - PROFILE_CLASS(self);
100   - PROFILE_CLASS([UIWebView class]);
  99 + HOOKSHOT_PROFILE_CLASS(self);
  100 + HOOKSHOT_PROFILE_CLASS([UIWebView class]);
101 101 }
102 102 }
103 103 ~~~~~~~~~~~~~~~~~~~~~~~~~
3  HookshotDemo/README.md
Source Rendered
... ... @@ -0,0 +1,3 @@
  1 +# hookshot demo
  2 +
  3 +The hookshot demo is a simple application that loads the Cue home page and instruments UIWebView, the AppDelegate, and counts live instances of images.
37 README.md
Source Rendered
@@ -21,28 +21,43 @@ AppDelegate.application:didFinishLaunchingWithOptions:
21 21 ...
22 22 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 23
24   -## hookshot uses undocumented Apple APIs
  24 +### hookshot uses undocumented Apple APIs
25 25
26 26 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.
27 27
  28 +## What is it?
  29 +
  30 +hookshot contains an instrumenting profiler. Contrary to its name, Apple's profiler in Instruments is actually a sampling profiler. We find both useful
  31 +for different occasions. Specifically, we find hookshot most useful for:
  32 +
  33 +* Thread activity graphs with drill-in
  34 +
  35 +* Seeing accurate counts of calls
  36 +
  37 +* More precise per-call timings of messages
  38 +
  39 +* Measurement of messages with highly variable performance
  40 +
  41 +hookshot also contains utilities for counting live instances of classes you care about and generic message instrumentation.
  42 +
28 43 ## Installation
29 44
30   -You can get hookshot in your project within about 5 minutes: [step-by-step installation instructions](/Cue/hookshot/blob/master/Documentation/INSTALL.md)
  45 +You can get hookshot in your project within about 5 minutes: [step-by-step installation instructions](/Documentation/INSTALL.md)
31 46
32 47 ## Profiling
33 48
34 49 hookshot provides a whitelist based instrumenting profiler. You can use it to time critical parts of your code and identify bottlenecks.
35 50
36   -Once you've [installed](/Cue/hookshot/blob/master/Documentation/INSTALL.md) hookshot in your project and run it, you can start exploring your data.
  51 +Once you've [installed](/Documentation/INSTALL.md) hookshot in your project and run it, you can start exploring your data.
37 52
38 53 ### Basic hooks
39 54
40 55 Early in your application's run, you can instrument any classes you want to measure performance of:
41 56
42 57 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.objc
43   -PROFILE_CLASS([AppDelegate class]);
44   -PROFILE_CLASS([UIWebView class]);
45   -PROFILE_CLASS_EXCEPT([AnotherClass class],
  58 +HOOKSHOT_PROFILE_CLASS([AppDelegate class]);
  59 +HOOKSHOT_PROFILE_CLASS([UIWebView class]);
  60 +HOOKSHOT_PROFILE_CLASS_EXCEPT([AnotherClass class],
46 61 [NSValue valueWithPointer:@selector(someFrequentlyCalledSelector)],
47 62 [NSValue valueWithPointer:@selector(anotherFrequentlyCalledSelector)])
48 63 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -51,7 +66,7 @@ You can omit messages you know are called frequently where you suspect profiling
51 66
52 67 ### profile.py
53 68
54   -[/bin/profile.py](/Cue/hookshot/blob/master/bin/profile.py) will analyze your latest profile data dump and summarize it:
  69 +[/bin/profile.py](/bin/profile.py) will analyze your latest profile data dump and summarize it:
55 70
56 71 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 72 $ bin/profile.py
@@ -179,7 +194,7 @@ AppDelegate.viewController 1 0.004ms
179 194 You can use hookshot to track how many instances of a given class are live.
180 195
181 196 ~~~~~~~~~~~~
182   -COUNT_INSTANCES(cls);
  197 +HOOKSHOT_COUNT_INSTANCES(cls);
183 198 ~~~~~~~~~~~~
184 199
185 200 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 {
205 220 write
206 221
207 222 ~~~~~~~~~~~~.cpp
208   -COUNTED_CPP_CLASS(X) {
  223 +HOOKSHOT_COUNTED_CPP_CLASS(X) {
209 224 ...
210 225 }
211 226 ~~~~~~~~~~~~
@@ -213,13 +228,13 @@ COUNTED_CPP_CLASS(X) {
213 228 In your implementation file, at the top, add:
214 229
215 230 ~~~~~~~~~~~~
216   -COUNTED_CPP_CLASS_IMPLEMENTATION_PREAMBLE(ClassName)
  231 +HOOKSHOT_COUNTED_CPP_CLASS_IMPLEMENTATION_PREAMBLE(ClassName)
217 232 ~~~~~~~~~~~~
218 233
219 234 ## Generic Instrumentation
220 235
221 236 The above features are built on top of a generic capability for instance message instrumentation defined
222   -in [Classes/CCInstanceMessageInstrumentation.h](/Cue/hookshot/blob/master/Classes/CCInstanceMessageInstrumentation.h)
  237 +in [Classes/CCInstanceMessageInstrumentation.h](/Classes/CCInstanceMessageInstrumentation.h)
223 238
224 239 We'd love to hear what (non-production!) uses you find for it.
225 240

0 comments on commit 36deb0e

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