| OLD | NEW |
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // ProfileHandle that only one instance of prof_handler can run at a time. | 104 // ProfileHandle that only one instance of prof_handler can run at a time. |
| 105 SpinLock lock_; | 105 SpinLock lock_; |
| 106 ProfileData collector_; | 106 ProfileData collector_; |
| 107 | 107 |
| 108 // Filter function and its argument, if any. (NULL means include all | 108 // Filter function and its argument, if any. (NULL means include all |
| 109 // samples). Set at start, read-only while running. Written while holding | 109 // samples). Set at start, read-only while running. Written while holding |
| 110 // lock_, read and executed in the context of SIGPROF interrupt. | 110 // lock_, read and executed in the context of SIGPROF interrupt. |
| 111 int (*filter_)(void*); | 111 int (*filter_)(void*); |
| 112 void* filter_arg_; | 112 void* filter_arg_; |
| 113 | 113 |
| 114 // Opague token returned by the profile handler. To be used when calling | 114 // Opaque token returned by the profile handler. To be used when calling |
| 115 // ProfileHandlerUnregisterCallback. | 115 // ProfileHandlerUnregisterCallback. |
| 116 ProfileHandlerToken* prof_handler_token_; | 116 ProfileHandlerToken* prof_handler_token_; |
| 117 | 117 |
| 118 // Sets up a callback to receive SIGPROF interrupt. | 118 // Sets up a callback to receive SIGPROF interrupt. |
| 119 void EnableHandler(); | 119 void EnableHandler(); |
| 120 | 120 |
| 121 // Disables receiving SIGPROF interrupt. | 121 // Disables receiving SIGPROF interrupt. |
| 122 void DisableHandler(); | 122 void DisableHandler(); |
| 123 | 123 |
| 124 // Signal handler that records the interrupted pc in the profile data. | 124 // Signal handler that records the interrupted pc in the profile data. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 extern "C" void ProfilerStop() { } | 333 extern "C" void ProfilerStop() { } |
| 334 extern "C" void ProfilerGetCurrentState(ProfilerState* state) { | 334 extern "C" void ProfilerGetCurrentState(ProfilerState* state) { |
| 335 memset(state, 0, sizeof(*state)); | 335 memset(state, 0, sizeof(*state)); |
| 336 } | 336 } |
| 337 | 337 |
| 338 #endif // OS_CYGWIN | 338 #endif // OS_CYGWIN |
| 339 | 339 |
| 340 // DEPRECATED routines | 340 // DEPRECATED routines |
| 341 extern "C" PERFTOOLS_DLL_DECL void ProfilerEnable() { } | 341 extern "C" PERFTOOLS_DLL_DECL void ProfilerEnable() { } |
| 342 extern "C" PERFTOOLS_DLL_DECL void ProfilerDisable() { } | 342 extern "C" PERFTOOLS_DLL_DECL void ProfilerDisable() { } |
| OLD | NEW |