Commit Graph

18 Commits

Author SHA1 Message Date
Mark D. Roth
0944410d6c [reorg] move test/core/util -> test/core/test_util (#36446)
Closes #36446

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36446 from markdroth:reorg_test 5dcc85e006581a8fc52a3a914baa5f33e4a21589
PiperOrigin-RevId: 629229220
2024-04-29 17:06:40 -07:00
Tanvi Jagtap
3e0eeed4fa [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS… (#36267)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

Will not be replacing CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only a few - which fit into single - line regex will be changed. This would be small in number just to reduce the load later.

Replacing CHECK with CHECK_EQ , CHECK_NE etc could be done using Cider-V once these changes are submitted if we want to clean up later. Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36267

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36267 from tanvi-jagtap:tjagtap_grpc_assert_02 3aed62610192ef9e46b2b25f215e694a4a6f6862
PiperOrigin-RevId: 623469007
2024-04-10 06:02:54 -07:00
Yijie Ma
f99b8b5bc4 Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Cheng-Yu Chung
e28419f1f9 [cleanups] Remove class CoreCodegen and g_core_codegen_interface (#31875)
* Delete `g_core_codegen_interface`

* Automated change: Fix sanity tests

* Fix

* Update
2022-12-14 23:47:13 +08:00
Cheng-Yu Chung
4e90f43a75 Remove functions in class CoreCodegen (#31796)
* Update include

* Clean up `grpc_empty_slice()`

* Clean up `grpc_slice_malloc()`

* Clean up `grpc_slice_unref()`

* Clean up `grpc_slice_ref()`

* Clean up `grpc_slice_split_tail()`

* Clean up `grpc_slice_split_head()`

* Clean up `grpc_slice_sub()`

* Clean up `grpc_slice_buffer_add()`

* Clean up `grpc_slice_buffer_add_indexed()`

* Clean up `grpc_slice_buffer_pop()`

* Clean up `grpc_slice_from_static_buffer()`

* Clean up `grpc_slice_from_copied_buffer()`

* Clean up `grpc_metadata_array_init()`

* Clean up `grpc_metadata_array_destroy()`

* Clean up `gpr_inf_future()`

* Clean up `gpr_time_0()`
2022-12-07 18:55:47 +08:00
Cheng-Yu Chung
1d968a36aa Remove functions in class CoreCodegen (#31767)
* Clean up `grpc_byte_buffer_copy()`

* Clean up `grpc_byte_buffer_destroy()`

* Clean up `grpc_byte_buffer_length()`

* Clean up `grpc_byte_buffer_reader_init()`

* Clean up `grpc_byte_buffer_reader_destroy()`

* Clean up `grpc_byte_buffer_reader_next()`

* Clean up `grpc_byte_buffer_reader_peek()`

* Clean up `grpc_raw_byte_buffer_create()`

* Clean up `grpc_slice_new_with_user_data()`

* Clean up `grpc_slice_new_with_len()`

* Clean up `grpc_call_start_batch()`

* Clean up `grpc_call_cancel_with_status()`

* Clean up `grpc_call_failed_before_recv_message()`

* Clean up `grpc_call_ref()`

* Clean up `grpc_call_unref()`

* Clean up `grpc_call_error_to_string()`

* Fix typos

* Automated change: Fix sanity tests
2022-12-03 05:27:42 +08:00
AJ Heller
18a8f6aad9 Refactor end2end tests to exercise each EventEngine (#29202)
* Refactor end2end tests to exercise each EventEngine

* fix incorrect bazel_only exclusions

* Automated change: Fix sanity tests

* microbenchmark fix

* sanitize, fix iOS flub

* Automated change: Fix sanity tests

* iOS fix

* reviewer feedback

* first pass at excluding EventEngine test expansion

Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.

* end2end fuzzers to be fuzzed differently via EventEngine.

* sanitize

* reviewer feedback

* remove misleading comment

* reviewer feedback: comments

* EE test_init needs to play with our build system

* fix golden file test runner

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-03-30 15:43:05 -07:00
AJ Heller
85189b24bb Reintroduce: Avoid fully qualifying namespaces (and add check) (#28917)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-18 16:18:54 -08:00
AJ Heller
e72a5fe5dd Revert "Avoid fully qualifying namespaces (and add check) (#28901)" (#28916)
This reverts commit fc7314c701.
2022-02-17 17:56:19 -08:00
AJ Heller
fc7314c701 Avoid fully qualifying namespaces (and add check) (#28901)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-17 16:23:25 -08:00
Craig Tiller
ea389c00c2 Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
Esun Kim
62ac3f075a Added call to grpc::testing::TestEnvironment in tests 2020-07-01 11:37:57 -07:00
Vijay Pai
1077b3435c Use range-based for on state rather than state.KeepRunning when possible 2019-08-29 11:27:00 -07:00
Esun Kim
e18ed03c04 Made gRPC inialized after entering main function in microbenchmarks. 2019-05-02 16:58:37 -07:00
Soheil Hassas Yeganeh
ad1b3e5094 Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
grpc_byte_buffer_reader_next() copies and references the slice. This
is not always necessary since the caller will not use the slice
after destroying the byte buffer.

A prominent example is the protobuf parser, which
calls grpc_byte_buffer_reader_next() and immediately unrefs the slice
after the call. This ref() and unref() calls can be very expensive
in the hot path.

This commit introduces grpc_byte_buffer_reader_peek() which
essentialy return a pointer to the slice in the buffer, i.e.,
no copies, and no refs.

QPS of 1MiB 1 Channel callback benchmark increases by 5%.
More importantly insructions per cycle is increased by 10%.

Also add tests and benchmarks for byte_buffer_reader_peek()

This commit reaplies 509e77a5a3
2019-03-21 06:03:45 -04:00
Soheil Hassas Yeganeh
c060d55cc7 Revert "Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing." 2019-03-05 14:01:01 -05:00
Soheil Hassas Yeganeh
509e77a5a3 Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
grpc_byte_buffer_reader_next() copies and references the slice. This
is not always necessary since the caller will not use the slice
after destroying the byte buffer.

A prominent example is the protobuf parser, which
calls grpc_byte_buffer_reader_next() and immediately unrefs the slice
after the call. This ref() and unref() calls can be very expensive
in the hot path.

This commit introduces grpc_byte_buffer_reader_peek() which
essentialy return a pointer to the slice in the buffer, i.e.,
no copies, and no refs.

QPS of 1MiB 1 Channel callback benchmark increases by 5%.
More importantly insructions per cycle is increased by 10%.

Also add tests and benchmarks for byte_buffer_reader_peek()
2019-03-04 14:17:46 -05:00
Vijay Pai
ca4e55e6ca Benchmark to show that byte buffer copy is size-independent 2018-12-14 13:23:34 -08:00