blob: c86d74f058ab3d54de6812f54ee72c127597cf62 [file] [log] [blame]
David Garcia Quintas8954e902015-04-29 09:46:33 -07001/*
2 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2015 gRPC authors.
David Garcia Quintas8954e902015-04-29 09:46:33 -07004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
David Garcia Quintas8954e902015-04-29 09:46:33 -07008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
David Garcia Quintas8954e902015-04-29 09:46:33 -070010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
David Garcia Quintas8954e902015-04-29 09:46:33 -070016 *
17 */
18
19#include <grpc/support/port_platform.h>
20
21#ifdef GRPC_STAP_PROFILER
22
Craig Tiller9533d042016-03-25 17:11:06 -070023#include "src/core/lib/profiling/timers.h"
David Garcia Quintas8954e902015-04-29 09:46:33 -070024
25#include <sys/sdt.h>
26/* Generated from src/core/profiling/stap_probes.d */
Craig Tiller9533d042016-03-25 17:11:06 -070027#include "src/core/lib/profiling/stap_probes.h"
David Garcia Quintas8954e902015-04-29 09:46:33 -070028
29/* Latency profiler API implementation. */
Craig Tiller0ba432d2015-10-09 16:57:11 -070030void gpr_timer_add_mark(int tag, const char *tagstr, void *id, const char *file,
31 int line) {
Craig Tillera82950e2015-09-22 12:33:20 -070032 _STAP_ADD_MARK(tag);
David Garcia Quintas8954e902015-04-29 09:46:33 -070033}
34
Craig Tiller0ba432d2015-10-09 16:57:11 -070035void gpr_timer_add_important_mark(int tag, const char *tagstr, void *id,
36 const char *file, int line) {
Craig Tillera82950e2015-09-22 12:33:20 -070037 _STAP_ADD_IMPORTANT_MARK(tag);
David Garcia Quintas73423ae2015-05-05 17:11:04 -070038}
39
Craig Tiller0ba432d2015-10-09 16:57:11 -070040void gpr_timer_begin(int tag, const char *tagstr, void *id, const char *file,
41 int line) {
Craig Tillera82950e2015-09-22 12:33:20 -070042 _STAP_TIMING_NS_BEGIN(tag);
David Garcia Quintas8954e902015-04-29 09:46:33 -070043}
44
Craig Tiller0ba432d2015-10-09 16:57:11 -070045void gpr_timer_end(int tag, const char *tagstr, void *id, const char *file,
46 int line) {
Craig Tillera82950e2015-09-22 12:33:20 -070047 _STAP_TIMING_NS_END(tag);
David Garcia Quintas8954e902015-04-29 09:46:33 -070048}
49
50#endif /* GRPC_STAP_PROFILER */