mirror of https://github.com/grpc/grpc.git
This commit includes a faulty Makefile to be fixed in a follow commit.pull/1408/head
parent
a9eb302aba
commit
8954e90b72
21 changed files with 327 additions and 108 deletions
@ -0,0 +1,43 @@ |
||||
/* Generated by the Systemtap dtrace wrapper */ |
||||
|
||||
#define _SDT_HAS_SEMAPHORES 1 |
||||
|
||||
|
||||
#define STAP_HAS_SEMAPHORES 1 /* deprecated */ |
||||
|
||||
|
||||
#include <sys/sdt.h> |
||||
|
||||
/* _STAP_ADD_MARK ( int tag) */ |
||||
#if defined STAP_SDT_V1 |
||||
#define _STAP_ADD_MARK_ENABLED() __builtin_expect (add_mark_semaphore, 0) |
||||
#define _stap_add_mark_semaphore add_mark_semaphore |
||||
#else |
||||
#define _STAP_ADD_MARK_ENABLED() __builtin_expect (_stap_add_mark_semaphore, 0) |
||||
#endif |
||||
__extension__ extern unsigned short _stap_add_mark_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); |
||||
#define _STAP_ADD_MARK(arg1) \ |
||||
DTRACE_PROBE1(_stap,add_mark,arg1) |
||||
|
||||
/* _STAP_TIMING_NS_BEGIN ( int tag) */ |
||||
#if defined STAP_SDT_V1 |
||||
#define _STAP_TIMING_NS_BEGIN_ENABLED() __builtin_expect (timing_ns_begin_semaphore, 0) |
||||
#define _stap_timing_ns_begin_semaphore timing_ns_begin_semaphore |
||||
#else |
||||
#define _STAP_TIMING_NS_BEGIN_ENABLED() __builtin_expect (_stap_timing_ns_begin_semaphore, 0) |
||||
#endif |
||||
__extension__ extern unsigned short _stap_timing_ns_begin_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); |
||||
#define _STAP_TIMING_NS_BEGIN(arg1) \ |
||||
DTRACE_PROBE1(_stap,timing_ns_begin,arg1) |
||||
|
||||
/* _STAP_TIMING_NS_END ( int tag) */ |
||||
#if defined STAP_SDT_V1 |
||||
#define _STAP_TIMING_NS_END_ENABLED() __builtin_expect (timing_ns_end_semaphore, 0) |
||||
#define _stap_timing_ns_end_semaphore timing_ns_end_semaphore |
||||
#else |
||||
#define _STAP_TIMING_NS_END_ENABLED() __builtin_expect (_stap_timing_ns_end_semaphore, 0) |
||||
#endif |
||||
__extension__ extern unsigned short _stap_timing_ns_end_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); |
||||
#define _STAP_TIMING_NS_END(arg1) \ |
||||
DTRACE_PROBE1(_stap,timing_ns_end,arg1) |
||||
|
@ -0,0 +1,57 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <grpc/support/port_platform.h> |
||||
|
||||
#ifdef GRPC_STAP_PROFILER |
||||
|
||||
#include "src/core/profiling/timers.h" |
||||
|
||||
#include <sys/sdt.h> |
||||
/* Generated from src/core/profiling/stap_probes.d */ |
||||
#include "src/core/profiling/stap_probes.h" |
||||
|
||||
/* Latency profiler API implementation. */ |
||||
void grpc_timer_add_mark(int tag, void* id, const char *file, int line) { |
||||
_STAP_ADD_MARK(tag); |
||||
} |
||||
|
||||
void grpc_timer_begin(int tag, void* id, const char *file, int line) { |
||||
_STAP_TIMING_NS_BEGIN(tag); |
||||
} |
||||
|
||||
void grpc_timer_end(int tag, void* id, const char *file, int line) { |
||||
_STAP_TIMING_NS_END(tag); |
||||
} |
||||
|
||||
#endif /* GRPC_STAP_PROFILER */ |
Loading…
Reference in new issue