OLD | NEW |
1 // Copyright (c) 2009, Google Inc. | 1 // Copyright (c) 2009, 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 24 matching lines...) Expand all Loading... |
35 // prevent inlining of routines defined here. | 35 // prevent inlining of routines defined here. |
36 // | 36 // |
37 // Inlining causes skip_count to be incorrect, and there | 37 // Inlining causes skip_count to be incorrect, and there |
38 // is no portable way to prevent it. | 38 // is no portable way to prevent it. |
39 // | 39 // |
40 // Eventually LTO (link-time optimization) and/or LLVM | 40 // Eventually LTO (link-time optimization) and/or LLVM |
41 // may inline this code anyway. Let's hope they respect | 41 // may inline this code anyway. Let's hope they respect |
42 // ATTRIBUTE_NOINLINE. | 42 // ATTRIBUTE_NOINLINE. |
43 | 43 |
44 #include <config.h> | 44 #include <config.h> |
45 #include <gperftools/stacktrace.h> | 45 #include <google/stacktrace.h> |
46 #include "stacktrace_config.h" | 46 #include "stacktrace_config.h" |
47 #include "base/basictypes.h" | 47 #include "base/basictypes.h" |
48 | 48 |
49 #if !defined(STACKTRACE_SKIP_CONTEXT_ROUTINES) | 49 #if !defined(STACKTRACE_SKIP_CONTEXT_ROUTINES) |
50 ATTRIBUTE_NOINLINE PERFTOOLS_DLL_DECL | 50 ATTRIBUTE_NOINLINE PERFTOOLS_DLL_DECL |
51 int GetStackFramesWithContext(void** pcs, int* sizes, int max_depth, | 51 int GetStackFramesWithContext(void** pcs, int* sizes, int max_depth, |
52 int skip_count, const void * /* uc */) { | 52 int skip_count, const void * /* uc */) { |
53 return GetStackFrames(pcs, sizes, max_depth, skip_count + 1); | 53 return GetStackFrames(pcs, sizes, max_depth, skip_count + 1); |
54 } | 54 } |
55 | 55 |
56 ATTRIBUTE_NOINLINE PERFTOOLS_DLL_DECL | 56 ATTRIBUTE_NOINLINE PERFTOOLS_DLL_DECL |
57 int GetStackTraceWithContext(void** result, int max_depth, | 57 int GetStackTraceWithContext(void** result, int max_depth, |
58 int skip_count, const void * /* uc */) { | 58 int skip_count, const void * /* uc */) { |
59 return GetStackTrace(result, max_depth, skip_count + 1); | 59 return GetStackTrace(result, max_depth, skip_count + 1); |
60 } | 60 } |
61 #endif | 61 #endif |
OLD | NEW |