channel.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * 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
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * 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.
16  *
17  */
18 
20 
22 
23 #include <inttypes.h>
24 #include <string.h>
25 
26 #include <algorithm>
27 #include <atomic>
28 #include <functional>
29 #include <memory>
30 
31 #include "absl/status/status.h"
32 
33 #include <grpc/compression.h>
34 #include <grpc/grpc.h>
36 #include <grpc/support/alloc.h>
37 #include <grpc/support/log.h>
38 
60 
61 // IWYU pragma: no_include <type_traits>
62 
63 namespace grpc_core {
64 
65 Channel::Channel(bool is_client, std::string target, ChannelArgs channel_args,
66  grpc_compression_options compression_options,
68  : is_client_(is_client),
69  compression_options_(compression_options),
70  call_size_estimate_(channel_stack->call_stack_size +
72  channelz_node_(channel_args.GetObjectRef<channelz::ChannelNode>()),
73  allocator_(channel_args.GetObject<ResourceQuota>()
74  ->memory_quota()
75  ->CreateMemoryOwner(target)),
77  channel_stack_(std::move(channel_stack)) {
78  // We need to make sure that grpc_shutdown() does not shut things down
79  // until after the channel is destroyed. However, the channel may not
80  // actually be destroyed by the time grpc_channel_destroy() returns,
81  // since there may be other existing refs to the channel. If those
82  // refs are held by things that are visible to the wrapped language
83  // (such as outstanding calls on the channel), then the wrapped
84  // language can be responsible for making sure that grpc_shutdown()
85  // does not run until after those refs are released. However, the
86  // channel may also have refs to itself held internally for various
87  // things that need to be cleaned up at channel destruction (e.g.,
88  // LB policies, subchannels, etc), and because these refs are not
89  // visible to the wrapped language, it cannot be responsible for
90  // deferring grpc_shutdown() until after they are released. To
91  // accommodate that, we call grpc_init() here and then call
92  // grpc_shutdown() when the channel is actually destroyed, thus
93  // ensuring that shutdown is deferred until that point.
94  grpc_init();
97  if (channelz_node != nullptr) {
99  channelz::ChannelTrace::Severity::Info,
100  grpc_slice_from_static_string("Channel destroyed"));
101  }
102  grpc_shutdown();
103  };
104 }
105 
108  auto channel_args = builder->channel_args();
109  if (builder->channel_stack_type() == GRPC_SERVER_CHANNEL) {
111  } else {
113  }
115  if (!r.ok()) {
116  auto status = r.status();
117  gpr_log(GPR_ERROR, "channel stack builder failed: %s",
118  status.ToString().c_str());
119  return status;
120  }
121 
124  auto default_level =
125  channel_args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL);
126  if (default_level.has_value()) {
129  static_cast<grpc_compression_level>(*default_level),
132  }
133  auto default_algorithm =
134  channel_args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM);
135  if (default_algorithm.has_value()) {
138  Clamp(static_cast<grpc_compression_algorithm>(*default_algorithm),
140  static_cast<grpc_compression_algorithm>(
142  }
143  auto enabled_algorithms_bitset =
145  if (enabled_algorithms_bitset.has_value()) {
147  *enabled_algorithms_bitset | 1 /* always support no compression */;
148  }
149 
150  return RefCountedPtr<Channel>(new Channel(
151  grpc_channel_stack_type_is_client(builder->channel_stack_type()),
152  std::string(builder->target()), std::move(channel_args),
154 }
155 
156 namespace {
157 
158 void* channelz_node_copy(void* p) {
159  channelz::ChannelNode* node = static_cast<channelz::ChannelNode*>(p);
160  node->Ref().release();
161  return p;
162 }
163 void channelz_node_destroy(void* p) {
164  channelz::ChannelNode* node = static_cast<channelz::ChannelNode*>(p);
165  node->Unref();
166 }
167 int channelz_node_cmp(void* p1, void* p2) { return QsortCompare(p1, p2); }
168 const grpc_arg_pointer_vtable channelz_node_arg_vtable = {
169  channelz_node_copy, channelz_node_destroy, channelz_node_cmp};
170 
171 void CreateChannelzNode(ChannelStackBuilder* builder) {
172  auto args = builder->channel_args();
173  // Check whether channelz is enabled.
174  const bool channelz_enabled = args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
175  .value_or(GRPC_ENABLE_CHANNELZ_DEFAULT);
176  if (!channelz_enabled) return;
177  // Get parameters needed to create the channelz node.
178  const size_t channel_tracer_max_memory = std::max(
181  const bool is_internal_channel =
182  args.GetBool(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL).value_or(false);
183  // Create the channelz node.
184  std::string target(builder->target());
185  RefCountedPtr<channelz::ChannelNode> channelz_node =
186  MakeRefCounted<channelz::ChannelNode>(
187  target.c_str(), channel_tracer_max_memory, is_internal_channel);
188  channelz_node->AddTraceEvent(
189  channelz::ChannelTrace::Severity::Info,
190  grpc_slice_from_static_string("Channel created"));
191  // Add channelz node to channel args.
192  // We remove the is_internal_channel arg, since we no longer need it.
193  builder->SetChannelArgs(
196  ChannelArgs::Pointer(channelz_node.release(),
197  &channelz_node_arg_vtable)));
198 }
199 
200 } // namespace
201 
203  const char* target, ChannelArgs args,
204  grpc_channel_stack_type channel_stack_type,
205  grpc_transport* optional_transport) {
207  grpc_channel_stack_type_string(channel_stack_type), channel_stack_type);
208  if (!args.GetString(GRPC_ARG_DEFAULT_AUTHORITY).has_value()) {
209  auto ssl_override = args.GetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
210  if (ssl_override.has_value()) {
212  std::string(ssl_override.value()));
213  }
214  }
215  if (grpc_channel_stack_type_is_client(channel_stack_type)) {
216  auto channel_args_mutator =
218  if (channel_args_mutator != nullptr) {
219  args = channel_args_mutator(target, args, channel_stack_type);
220  }
221  }
222  builder.SetChannelArgs(std::move(args))
223  .SetTarget(target)
224  .SetTransport(optional_transport);
225  if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
226  return nullptr;
227  }
228  // We only need to do this for clients here. For servers, this will be
229  // done in src/core/lib/surface/server.cc.
230  if (grpc_channel_stack_type_is_client(channel_stack_type)) {
231  CreateChannelzNode(&builder);
232  }
233  return CreateWithBuilder(&builder);
234 }
235 
237  size_t cur = call_size_estimate_.load(std::memory_order_relaxed);
238  if (cur < size) {
239  // size grew: update estimate
240  call_size_estimate_.compare_exchange_weak(
241  cur, size, std::memory_order_relaxed, std::memory_order_relaxed);
242  // if we lose: never mind, something else will likely update soon enough
243  } else if (cur == size) {
244  // no change: holding pattern
245  } else if (cur > 0) {
246  // size shrank: decrease estimate
247  call_size_estimate_.compare_exchange_weak(
248  cur, std::min(cur - 1, (255 * cur + size) / 256),
249  std::memory_order_relaxed, std::memory_order_relaxed);
250  // if we lose: never mind, something else will likely update soon enough
251  }
252 }
253 
254 } // namespace grpc_core
255 
257  GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
259  char* buffer = static_cast<char*>(gpr_zalloc(target.size() + 1));
260  memcpy(buffer, target.data(), target.size());
261  return buffer;
262 }
263 
265  const grpc_channel_info* channel_info) {
266  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
269  grpc_core::Channel::FromC(channel)->channel_stack(), 0);
270  elem->filter->get_channel_info(elem, channel_info);
271 }
272 
274  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
276  GRPC_API_TRACE("grpc_channel_reset_connect_backoff(channel=%p)", 1,
277  (channel));
279  op->reset_connect_backoff = true;
281  grpc_core::Channel::FromC(channel)->channel_stack(), 0);
282  elem->filter->start_transport_op(elem, op);
283 }
284 
286  grpc_channel* c_channel, grpc_call* parent_call, uint32_t propagation_mask,
287  grpc_completion_queue* cq, grpc_pollset_set* pollset_set_alternative,
289  grpc_core::Timestamp deadline) {
290  auto channel = grpc_core::Channel::FromC(c_channel)->Ref();
291  GPR_ASSERT(channel->is_client());
292  GPR_ASSERT(!(cq != nullptr && pollset_set_alternative != nullptr));
293 
295  args.channel = std::move(channel);
296  args.server = nullptr;
297  args.parent = parent_call;
298  args.propagation_mask = propagation_mask;
299  args.cq = cq;
300  args.pollset_set_alternative = pollset_set_alternative;
301  args.server_transport_data = nullptr;
302  args.path = std::move(path);
303  args.authority = std::move(authority);
304  args.send_deadline = deadline;
305 
306  grpc_call* call;
307  GRPC_LOG_IF_ERROR("call_create", grpc_call_create(&args, &call));
308  return call;
309 }
310 
312  grpc_call* parent_call,
313  uint32_t propagation_mask,
315  grpc_slice method, const grpc_slice* host,
316  gpr_timespec deadline, void* reserved) {
317  GPR_ASSERT(!reserved);
318  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
321  channel, parent_call, propagation_mask, completion_queue, nullptr,
323  host != nullptr
325  : absl::nullopt,
327 
328  return call;
329 }
330 
332  grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
333  grpc_pollset_set* pollset_set, const grpc_slice& method,
334  const grpc_slice* host, grpc_core::Timestamp deadline, void* reserved) {
335  GPR_ASSERT(!reserved);
337  channel, parent_call, propagation_mask, nullptr, pollset_set,
339  host != nullptr
341  : absl::nullopt,
342  deadline);
343 }
344 
345 namespace grpc_core {
346 
347 RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg) {
348  path = Slice::FromCopiedString(method_arg);
349  if (host_arg != nullptr && host_arg[0] != 0) {
351  }
352 }
353 
355  : path(other.path.Ref()) {
356  if (other.authority.has_value()) {
357  authority = other.authority->Ref();
358  }
359 }
360 
362 
363 } // namespace grpc_core
364 
366  const char* host, void* reserved) {
368  "grpc_channel_register_call(channel=%p, method=%s, host=%s, reserved=%p)",
369  4, (channel, method, host, reserved));
370  GPR_ASSERT(!reserved);
371  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
374 }
375 
376 namespace grpc_core {
377 
378 RegisteredCall* Channel::RegisterCall(const char* method, const char* host) {
380  registration_table_.method_registration_attempts++;
381  auto key = std::make_pair(std::string(host != nullptr ? host : ""),
382  std::string(method != nullptr ? method : ""));
383  auto rc_posn = registration_table_.map.find(key);
384  if (rc_posn != registration_table_.map.end()) {
385  return &rc_posn->second;
386  }
387  auto insertion_result = registration_table_.map.insert(
388  {std::move(key), RegisteredCall(method, host)});
389  return &insertion_result.first->second;
390 }
391 
392 } // namespace grpc_core
393 
395  grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
396  grpc_completion_queue* completion_queue, void* registered_call_handle,
397  gpr_timespec deadline, void* reserved) {
399  static_cast<grpc_core::RegisteredCall*>(registered_call_handle);
401  "grpc_channel_create_registered_call("
402  "channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, "
403  "registered_call_handle=%p, "
404  "deadline=gpr_timespec { tv_sec: %" PRId64
405  ", tv_nsec: %d, clock_type: %d }, "
406  "reserved=%p)",
407  9,
408  (channel, parent_call, (unsigned)propagation_mask, completion_queue,
409  registered_call_handle, deadline.tv_sec, deadline.tv_nsec,
410  (int)deadline.clock_type, reserved));
411  GPR_ASSERT(!reserved);
412  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
415  channel, parent_call, propagation_mask, completion_queue, nullptr,
416  rc->path.Ref(),
417  rc->authority.has_value()
419  : absl::nullopt,
421 
422  return call;
423 }
424 
427  grpc_core::Channel::FromC(c_channel));
430  GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (c_channel));
431  op->disconnect_with_error =
432  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Destroyed");
433  elem = grpc_channel_stack_element(channel->channel_stack(), 0);
434  elem->filter->start_transport_op(elem, op);
435 }
436 
438  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
441 }
grpc_core::RegisteredCall::authority
absl::optional< Slice > authority
Definition: src/core/lib/surface/channel.h:89
trace.h
gpr_timespec::tv_nsec
int32_t tv_nsec
Definition: gpr_types.h:52
gpr_timespec::tv_sec
int64_t tv_sec
Definition: gpr_types.h:51
compression.h
grpc_compression_options::enabled_algorithms_bitset
uint32_t enabled_algorithms_bitset
Definition: compression_types.h:84
completion_queue
grpc_completion_queue * completion_queue
Definition: completion_queue.c:21
channelz_node_
RefCountedPtr< channelz::SubchannelNode > channelz_node_
Definition: health_check_client.cc:154
grpc_core::Slice::Ref
Slice Ref() const
Definition: src/core/lib/slice/slice.h:368
log.h
core_configuration.h
grpc_slice_ref_internal
const grpc_slice & grpc_slice_ref_internal(const grpc_slice &slice)
Definition: slice_refcount.h:32
absl::Status::ToString
std::string ToString(StatusToStringMode mode=StatusToStringMode::kDefault) const
Definition: third_party/abseil-cpp/absl/status/status.h:821
grpc_call_create
grpc_error_handle grpc_call_create(grpc_call_create_args *args, grpc_call **out_call)
Definition: call.cc:1758
grpc_channel_stack_element
grpc_channel_element * grpc_channel_stack_element(grpc_channel_stack *channel_stack, size_t index)
Definition: channel_stack.cc:78
grpc_core::Channel::channel_stack_
const RefCountedPtr< grpc_channel_stack > channel_stack_
Definition: src/core/lib/surface/channel.h:168
grpc_channel_create_call_internal
static grpc_call * grpc_channel_create_call_internal(grpc_channel *c_channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *cq, grpc_pollset_set *pollset_set_alternative, grpc_core::Slice path, absl::optional< grpc_core::Slice > authority, grpc_core::Timestamp deadline)
Definition: channel.cc:285
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::Slice
Definition: src/core/lib/slice/slice.h:282
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc_core::Channel::registration_table_
CallRegistrationTable registration_table_
Definition: src/core/lib/surface/channel.h:164
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
string.h
grpc_compression_algorithm
grpc_compression_algorithm
Definition: compression_types.h:60
grpc_compression_options::grpc_compression_options_default_level::is_set
int is_set
Definition: compression_types.h:92
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
useful.h
grpc_channel_element
Definition: channel_stack.h:186
elem
Timer elem
Definition: event_engine/iomgr_event_engine/timer_heap_test.cc:109
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_compression_options::grpc_compression_options_default_level::level
grpc_compression_level level
Definition: compression_types.h:93
status
absl::Status status
Definition: rls.cc:251
grpc_core::ApplicationCallbackExecCtx
Definition: exec_ctx.h:283
GRPC_ARG_ENABLE_CHANNELZ
#define GRPC_ARG_ENABLE_CHANNELZ
Definition: grpc_types.h:323
allocator_
std::shared_ptr< internal::MemoryAllocatorImpl > allocator_
Definition: memory_allocator.cc:55
GRPC_LOG_IF_ERROR
#define GRPC_LOG_IF_ERROR(what, error)
Definition: error.h:398
grpc_compression_options
Definition: compression_types.h:80
check_documentation.path
path
Definition: check_documentation.py:57
GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL
#define GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL
Definition: compression_types.h:46
GRPC_COMPRESS_LEVEL_COUNT
@ GRPC_COMPRESS_LEVEL_COUNT
Definition: compression_types.h:77
GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET
#define GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET
Definition: compression_types.h:54
channelz.h
grpc_core::Channel::channelz_node_
RefCountedPtr< channelz::ChannelNode > channelz_node_
Definition: src/core/lib/surface/channel.h:165
GRPC_COMPRESS_NONE
@ GRPC_COMPRESS_NONE
Definition: compression_types.h:61
grpc_arg_pointer_vtable
Definition: grpc_types.h:85
stats.h
grpc_transport_op
Definition: transport.h:452
call
FilterStackCall * call
Definition: call.cc:750
grpc_channel_get_info
void grpc_channel_get_info(grpc_channel *channel, const grpc_channel_info *channel_info)
Definition: channel.cc:264
grpc_core::ChannelStackBuilder
Definition: channel_stack_builder.h:41
grpc_channel_destroy_internal
void grpc_channel_destroy_internal(grpc_channel *c_channel)
Definition: channel.cc:425
GRPC_STATS_INC_SERVER_CHANNELS_CREATED
#define GRPC_STATS_INC_SERVER_CHANNELS_CREATED()
Definition: stats_data.h:186
GRPC_ARG_CHANNELZ_CHANNEL_NODE
#define GRPC_ARG_CHANNELZ_CHANNEL_NODE
Definition: channelz.h:49
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
Definition: alloc.cc:40
GRPC_ENABLE_CHANNELZ_DEFAULT
#define GRPC_ENABLE_CHANNELZ_DEFAULT
Definition: channelz.h:57
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc_core::ResourceQuota
Definition: src/core/lib/resource_quota/resource_quota.h:40
GRPC_SERVER_CHANNEL
@ GRPC_SERVER_CHANNEL
Definition: channel_stack_type.h:36
grpc_core::RefCounted::Unref
void Unref()
Definition: ref_counted.h:302
GRPC_ARG_DEFAULT_AUTHORITY
#define GRPC_ARG_DEFAULT_AUTHORITY
Definition: grpc_types.h:251
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
grpc_core::slice_detail::CopyConstructors< Slice >::FromCopiedString
static Slice FromCopiedString(const char *s)
Definition: src/core/lib/slice/slice.h:173
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
grpc_core::Channel::compression_options
grpc_compression_options compression_options() const
Definition: src/core/lib/surface/channel.h:121
channel_init.h
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_channel_reset_connect_backoff
void grpc_channel_reset_connect_backoff(grpc_channel *channel)
Definition: channel.cc:273
grpc_core::RefCountedPtr< grpc_channel_stack >
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
Definition: grpc_types.h:278
grpc_call_get_initial_size_estimate
size_t grpc_call_get_initial_size_estimate()
Definition: call.cc:1754
grpc_core::CoreConfiguration::Get
static const CoreConfiguration & Get()
Definition: core_configuration.h:82
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
channel_stack.h
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_completion_queue
Definition: completion_queue.cc:347
grpc_compression_options::default_level
struct grpc_compression_options::grpc_compression_options_default_level default_level
grpc_call_create_args
Definition: src/core/lib/surface/call.h:51
GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT
#define GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT
Definition: channelz.h:63
grpc.h
grpc_call
struct grpc_call grpc_call
Definition: grpc_types.h:70
is_client_
const bool is_client_
Definition: binder_transport.cc:370
GRPC_COMPRESS_LEVEL_NONE
@ GRPC_COMPRESS_LEVEL_NONE
Definition: compression_types.h:73
absl::optional< grpc_core::Slice >
absl::inlined_vector_internal::Pointer
typename AllocatorTraits< A >::pointer Pointer
Definition: abseil-cpp/absl/container/internal/inlined_vector.h:52
grpc_slice_from_static_string
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Definition: slice/slice.cc:89
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
grpc_core::Channel::RegisterCall
RegisteredCall * RegisterCall(const char *method, const char *host)
Definition: channel.cc:378
grpc_make_transport_op
grpc_transport_op * grpc_make_transport_op(grpc_closure *on_complete)
Definition: transport.cc:205
grpc_compression_options::default_algorithm
struct grpc_compression_options::grpc_compression_options_default_algorithm default_algorithm
error.h
grpc_core::ChannelStackBuilderImpl
Definition: channel_stack_builder_impl.h:33
channel_stack_
RefCountedPtr< grpc_channel_stack > channel_stack_
Definition: filter_fuzzer.cc:570
grpc_core::channelz::ChannelNode::AddTraceEvent
void AddTraceEvent(ChannelTrace::Severity severity, const grpc_slice &data)
Definition: channelz.h:194
grpc_channel_create_call
grpc_call * grpc_channel_create_call(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, grpc_slice method, const grpc_slice *host, gpr_timespec deadline, void *reserved)
Definition: channel.cc:311
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
min
#define min(a, b)
Definition: qsort.h:83
channel_stack_type.h
resource_quota.h
grpc_core::ExecCtx
Definition: exec_ctx.h:97
manual_constructor.h
GRPC_ERROR_CREATE_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
Definition: error.h:291
gpr_types.h
gpr_timespec::clock_type
gpr_clock_type clock_type
Definition: gpr_types.h:55
grpc_core::channelz::ChannelNode
Definition: channelz.h:178
grpc_channel_destroy
void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
memory_diff.cur
def cur
Definition: memory_diff.py:83
grpc_channel_get_target
char * grpc_channel_get_target(grpc_channel *channel)
Definition: channel.cc:256
grpc_core::Channel::call_size_estimate_
std::atomic< size_t > call_size_estimate_
Definition: src/core/lib/surface/channel.h:163
grpc_core::Clamp
T Clamp(T val, T min, T max)
Definition: useful.h:31
key
const char * key
Definition: hpack_parser_table.cc:164
grpc_core::Channel::Channel
Channel(bool is_client, std::string target, ChannelArgs channel_args, grpc_compression_options compression_options, RefCountedPtr< grpc_channel_stack > channel_stack)
Definition: channel.cc:65
grpc_core::QsortCompare
int QsortCompare(const T &a, const T &b)
Definition: useful.h:95
grpc_core::Channel::channelz_node
channelz::ChannelNode * channelz_node() const
Definition: src/core/lib/surface/channel.h:125
GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE
#define GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE
Definition: grpc_types.h:318
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_compression_options_init
GRPCAPI void grpc_compression_options_init(grpc_compression_options *opts)
Definition: compression.cc:74
grpc_channel_create_pollset_set_call
grpc_call * grpc_channel_create_pollset_set_call(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_pollset_set *pollset_set, const grpc_slice &method, const grpc_slice *host, grpc_core::Timestamp deadline, void *reserved)
Definition: channel.cc:331
alloc.h
fix_build_deps.r
r
Definition: fix_build_deps.py:491
grpc_compression_level
grpc_compression_level
Definition: compression_types.h:72
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
GRPC_COMPRESS_ALGORITHMS_COUNT
@ GRPC_COMPRESS_ALGORITHMS_COUNT
Definition: compression_types.h:65
grpc_compression_options::grpc_compression_options_default_algorithm::is_set
int is_set
Definition: compression_types.h:100
grpc_channel_create_registered_call
grpc_call * grpc_channel_create_registered_call(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved)
Definition: channel.cc:394
grpc_channel_stack_type
grpc_channel_stack_type
Definition: channel_stack_type.h:24
exec_ctx.h
channelz
void channelz(grpc_end2end_test_config config)
Definition: test/core/end2end/tests/channelz.cc:318
slice_refcount.h
grpc_core::ChannelArgs
Definition: channel_args.h:111
ref_counted_ptr.h
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
grpc_core::RegisteredCall::path
Slice path
Definition: src/core/lib/surface/channel.h:88
grpc_transport
Definition: transport_impl.h:89
transport.h
memory_quota.h
grpc_core::Channel::target
absl::string_view target() const
Definition: src/core/lib/surface/channel.h:141
GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL
#define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL
Definition: channelz.h:52
channel_args.h
grpc_core::Channel::UpdateCallSizeEstimate
void UpdateCallSizeEstimate(size_t size)
Definition: channel.cc:236
api_trace.h
channel_stack_builder_impl.h
grpc_channel_stack::on_destroy
grpc_core::ManualConstructor< std::function< void()> > on_destroy
Definition: channel_stack.h:213
grpc_channel_register_call
void * grpc_channel_register_call(grpc_channel *channel, const char *method, const char *host, void *reserved)
Definition: channel.cc:365
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
gpr_timespec
Definition: gpr_types.h:50
grpc_core::RegisteredCall::RegisteredCall
RegisteredCall(const char *method_arg, const char *host_arg)
Definition: channel.cc:347
grpc_core::Channel::CreateWithBuilder
static absl::StatusOr< RefCountedPtr< Channel > > CreateWithBuilder(ChannelStackBuilder *builder)
Definition: channel.cc:106
grpc_channel_stack_type_is_client
bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type)
Definition: channel_stack_type.cc:23
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
grpc_core::Timestamp::FromTimespecRoundUp
static Timestamp FromTimespecRoundUp(gpr_timespec t)
Definition: src/core/lib/gprpp/time.cc:136
channel_trace.h
testing::Ref
internal::RefMatcher< T & > Ref(T &x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8628
GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM
#define GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM
Definition: compression_types.h:42
method
NSString * method
Definition: ProtoMethod.h:28
grpc_core::CppImplOf< Channel, grpc_channel >::FromC
static Channel * FromC(grpc_channel *c_type)
Definition: cpp_impl_of.h:30
grpc_channel_info
Definition: grpc_types.h:720
grpc_channel_stack_type_string
const char * grpc_channel_stack_type_string(grpc_channel_stack_type type)
Definition: channel_stack_type.cc:41
grpc_core::RegisteredCall::~RegisteredCall
~RegisteredCall()
Definition: channel.cc:361
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
GRPC_STATS_INC_CLIENT_CHANNELS_CREATED
#define GRPC_STATS_INC_CLIENT_CHANNELS_CREATED()
Definition: stats_data.h:182
grpc_core::RegisteredCall
Definition: src/core/lib/surface/channel.h:87
grpc_core::CallRegistrationTable::mu
Mutex mu
Definition: src/core/lib/surface/channel.h:99
grpc_compression_options::grpc_compression_options_default_algorithm::algorithm
grpc_compression_algorithm algorithm
Definition: compression_types.h:101
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
grpc_core::Channel::Create
static absl::StatusOr< RefCountedPtr< Channel > > Create(const char *target, ChannelArgs args, grpc_channel_stack_type channel_stack_type, grpc_transport *optional_transport)
Definition: channel.cc:202
cq
static grpc_completion_queue * cq
Definition: test/core/fling/client.cc:37
grpc_channel_args_get_client_channel_creation_mutator
grpc_channel_args_client_channel_creation_mutator grpc_channel_args_get_client_channel_creation_mutator()
Definition: channel_args.cc:555
target_
std::string target_
Definition: rls.cc:342
call.h
grpc_core::RefCounted::Ref
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
Definition: ref_counted.h:287
GRPC_API_TRACE
#define GRPC_API_TRACE(fmt, nargs, args)
Definition: api_trace.h:48
channel.h
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52