| Index: third_party/grpc/test/core/bad_client/tests/unknown_frame.c
|
| diff --git a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h b/third_party/grpc/test/core/bad_client/tests/unknown_frame.c
|
| similarity index 63%
|
| copy from third_party/tcmalloc/vendor/src/base/synchronization_profiling.h
|
| copy to third_party/grpc/test/core/bad_client/tests/unknown_frame.c
|
| index cf02c218a111806189f71f7b528a83b5ceb164a4..2ef340eeb5cd0567f114589107c28fa875b47423 100644
|
| --- a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h
|
| +++ b/third_party/grpc/test/core/bad_client/tests/unknown_frame.c
|
| @@ -1,4 +1,6 @@
|
| -/* Copyright (c) 2010, Google Inc.
|
| +/*
|
| + *
|
| + * Copyright 2015, Google Inc.
|
| * All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| @@ -27,24 +29,31 @@
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| *
|
| - * ---
|
| - * Author: Chris Ruemmler
|
| */
|
|
|
| -#ifndef BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
| -#define BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
| +#include "test/core/bad_client/bad_client.h"
|
| +#include "src/core/surface/server.h"
|
| +
|
| +#define PFX_STR \
|
| + "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
|
| + "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
|
|
|
| -#include "base/basictypes.h"
|
| +static void verifier(grpc_server *server, grpc_completion_queue *cq,
|
| + void *registered_method) {
|
| + while (grpc_server_has_open_connections(server)) {
|
| + GPR_ASSERT(grpc_completion_queue_next(cq,
|
| + GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20),
|
| + NULL).type == GRPC_QUEUE_TIMEOUT);
|
| + }
|
| +}
|
|
|
| -namespace base {
|
| +int main(int argc, char **argv) {
|
| + grpc_test_init(argc, argv);
|
|
|
| -// We can do contention-profiling of SpinLocks, but the code is in
|
| -// mutex.cc, which is not always linked in with spinlock. Hence we
|
| -// provide a weak definition, which are used if mutex.cc isn't linked in.
|
| + /* test adding prioritization data */
|
| + GRPC_RUN_BAD_CLIENT_TEST(verifier,
|
| + PFX_STR "\x00\x00\x00\x88\x00\x00\x00\x00\x01",
|
| + GRPC_BAD_CLIENT_DISCONNECT);
|
|
|
| -// Submit the number of cycles the spinlock spent contending.
|
| -ATTRIBUTE_WEAK extern void SubmitSpinLockProfileData(const void *, int64);
|
| -extern void SubmitSpinLockProfileData(const void *contendedlock,
|
| - int64 wait_cycles) {}
|
| + return 0;
|
| }
|
| -#endif // BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
|
|