Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
01bcd2cf
Commit
01bcd2cf
authored
Sep 20, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove explicit deps on gperftools/profiler.h to adapt different versions of gperftools better
parent
cd4f8ee0
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
110 additions
and
77 deletions
+110
-77
Makefile
Makefile
+1
-1
config_brpc.sh
config_brpc.sh
+0
-2
index_service.cpp
src/brpc/builtin/index_service.cpp
+2
-2
profiler_linker.h
src/brpc/details/profiler_linker.h
+1
-10
gperftools_profiler.h
src/butil/gperftools_profiler.h
+83
-0
brpc_builtin_service_unittest.cpp
test/brpc_builtin_service_unittest.cpp
+1
-1
brpc_channel_unittest.cpp
test/brpc_channel_unittest.cpp
+0
-1
brpc_esp_protocol_unittest.cpp
test/brpc_esp_protocol_unittest.cpp
+0
-1
brpc_event_dispatcher_unittest.cpp
test/brpc_event_dispatcher_unittest.cpp
+1
-1
brpc_http_rpc_protocol_unittest.cpp
test/brpc_http_rpc_protocol_unittest.cpp
+0
-1
brpc_hulu_pbrpc_protocol_unittest.cpp
test/brpc_hulu_pbrpc_protocol_unittest.cpp
+1
-1
brpc_input_messenger_unittest.cpp
test/brpc_input_messenger_unittest.cpp
+1
-1
brpc_load_balancer_unittest.cpp
test/brpc_load_balancer_unittest.cpp
+1
-1
brpc_mongo_protocol_unittest.cpp
test/brpc_mongo_protocol_unittest.cpp
+0
-1
brpc_nova_pbrpc_protocol_unittest.cpp
test/brpc_nova_pbrpc_protocol_unittest.cpp
+0
-1
brpc_protobuf_json_unittest.cpp
test/brpc_protobuf_json_unittest.cpp
+6
-6
brpc_public_pbrpc_protocol_unittest.cpp
test/brpc_public_pbrpc_protocol_unittest.cpp
+0
-1
brpc_rtmp_unittest.cpp
test/brpc_rtmp_unittest.cpp
+0
-1
brpc_server_unittest.cpp
test/brpc_server_unittest.cpp
+0
-1
brpc_snappy_compress_unittest.cpp
test/brpc_snappy_compress_unittest.cpp
+1
-1
brpc_socket_map_unittest.cpp
test/brpc_socket_map_unittest.cpp
+0
-1
brpc_socket_unittest.cpp
test/brpc_socket_unittest.cpp
+3
-3
brpc_sofa_pbrpc_protocol_unittest.cpp
test/brpc_sofa_pbrpc_protocol_unittest.cpp
+0
-1
bthread_cond_unittest.cpp
test/bthread_cond_unittest.cpp
+1
-8
bthread_dispatcher_unittest.cpp
test/bthread_dispatcher_unittest.cpp
+1
-1
bthread_execution_queue_unittest.cpp
test/bthread_execution_queue_unittest.cpp
+1
-8
bthread_fd_unittest.cpp
test/bthread_fd_unittest.cpp
+1
-1
bthread_mutex_unittest.cpp
test/bthread_mutex_unittest.cpp
+1
-8
bthread_unittest.cpp
test/bthread_unittest.cpp
+2
-9
bvar_lock_timer_unittest.cpp
test/bvar_lock_timer_unittest.cpp
+1
-1
bvar_percentile_unittest.cpp
test/bvar_percentile_unittest.cpp
+0
-1
No files found.
Makefile
View file @
01bcd2cf
...
@@ -201,7 +201,7 @@ libbrpc.a:$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
...
@@ -201,7 +201,7 @@ libbrpc.a:$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
libbrpc.so
:
$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
libbrpc.so
:
$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
@
echo
"Linking
$@
"
@
echo
"Linking
$@
"
$(CXX)
-shared
-o
$@
$(LIBPATHS)
$(SOPATHS)
-Xlinker
"-("
$
(
filter %.o,
$^
)
-Xlinker
"-)"
$(STATIC_LINKINGS)
$(DYNAMIC_LINKINGS)
@
$(CXX)
-shared
-o
$@
$(LIBPATHS)
$(SOPATHS)
-Xlinker
"-("
$
(
filter %.o,
$^
)
-Xlinker
"-)"
$(STATIC_LINKINGS)
$(DYNAMIC_LINKINGS)
libbvar.dbg.a
:
$(BVAR_DEBUG_OBJS)
libbvar.dbg.a
:
$(BVAR_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
echo
"Packing
$@
"
...
...
config_brpc.sh
View file @
01bcd2cf
...
@@ -246,8 +246,6 @@ if [ -z "$TCMALLOC_LIB" ]; then
...
@@ -246,8 +246,6 @@ if [ -z "$TCMALLOC_LIB" ]; then
append_to_output
"
\$
(error
\"
Fail to find gperftools
\"
)"
append_to_output
"
\$
(error
\"
Fail to find gperftools
\"
)"
else
else
append_to_output_libs
"
$TCMALLOC_LIB
"
" "
append_to_output_libs
"
$TCMALLOC_LIB
"
" "
TCMALLOC_HDR
=
$(
find_dir_of_header_or_die google/profiler.h
)
append_to_output_headers
"
$TCMALLOC_HDR
"
" "
if
[
-f
$TCMALLOC_LIB
/libtcmalloc_and_profiler.a
]
;
then
if
[
-f
$TCMALLOC_LIB
/libtcmalloc_and_profiler.a
]
;
then
if
[
-f
$TCMALLOC_LIB
/libtcmalloc.so
]
;
then
if
[
-f
$TCMALLOC_LIB
/libtcmalloc.so
]
;
then
ldd
$TCMALLOC_LIB
/libtcmalloc.so
>
libtcmalloc.deps
ldd
$TCMALLOC_LIB
/libtcmalloc.so
>
libtcmalloc.deps
...
...
src/brpc/builtin/index_service.cpp
View file @
01bcd2cf
...
@@ -87,9 +87,9 @@ void IndexService::default_method(::google::protobuf::RpcController* controller,
...
@@ -87,9 +87,9 @@ void IndexService::default_method(::google::protobuf::RpcController* controller,
}
}
os
<<
'\n'
;
os
<<
'\n'
;
if
(
use_html
)
{
if
(
use_html
)
{
os
<<
"<a href=
\"
https://github.com/brpc/brpc
/tree/master/
\"
>Repo
</a>"
;
os
<<
"<a href=
\"
https://github.com/brpc/brpc
\"
>github
</a>"
;
}
else
{
}
else
{
os
<<
"
Repo : https://github.com/brpc/brpc/tree/master/
"
;
os
<<
"
github : https://github.com/brpc/brpc
"
;
}
}
os
<<
NL
<<
NL
;
os
<<
NL
<<
NL
;
if
(
!
as_more
)
{
if
(
!
as_more
)
{
...
...
src/brpc/details/profiler_linker.h
View file @
01bcd2cf
...
@@ -18,16 +18,7 @@
...
@@ -18,16 +18,7 @@
#define BRPC_PROFILER_LINKER_H
#define BRPC_PROFILER_LINKER_H
#if defined(BRPC_ENABLE_CPU_PROFILER) || defined(BAIDU_RPC_ENABLE_CPU_PROFILER)
#if defined(BRPC_ENABLE_CPU_PROFILER) || defined(BAIDU_RPC_ENABLE_CPU_PROFILER)
#ifdef __cplusplus
#include "butil/gperftools_profiler.h"
extern
"C"
{
#endif
// Suppress warning of `google/profiler.h' which has been deprecated since
// gperftools-2.2
void
ProfilerStart
(
const
char
*
);
void
ProfilerStop
(
const
char
*
);
#ifdef __cplusplus
}
#endif
#endif
#endif
namespace
brpc
{
namespace
brpc
{
...
...
src/butil/gperftools_profiler.h
0 → 100644
View file @
01bcd2cf
/* Copyright (c) 2005, 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.
*
* ---
* Author: Sanjay Ghemawat
*
* Module for CPU profiling based on periodic pc-sampling.
*
* These functions are thread-safe.
*/
#ifndef BUTIL_GPERFTOOLS_PROFILER_H_
#define BUTIL_GPERFTOOLS_PROFILER_H_
/* Annoying stuff for windows; makes sure clients can import these functions */
#ifndef BRPC_DLL_DECL
# ifdef _WIN32
# define BRPC_DLL_DECL __declspec(dllimport)
# else
# define BRPC_DLL_DECL
# endif
#endif
/* All this code should be usable from within C apps. */
#ifdef __cplusplus
extern
"C"
{
#endif
/* Start profiling and write profile info into fname, discarding any
* existing profiling data in that file.
*
* This is equivalent to calling ProfilerStartWithOptions(fname, NULL).
*/
BRPC_DLL_DECL
int
ProfilerStart
(
const
char
*
fname
);
/* Stop profiling. Can be started again with ProfilerStart(), but
* the currently accumulated profiling data will be cleared.
*/
BRPC_DLL_DECL
void
ProfilerStop
();
/* Flush any currently buffered profiling state to the profile file.
* Has no effect if the profiler has not been started.
*/
BRPC_DLL_DECL
void
ProfilerFlush
();
/* Returns nonzero if profile is currently enabled, zero if it's not. */
BRPC_DLL_DECL
int
ProfilingIsEnabledForAllThreads
();
/* Routine for registering new threads with the profiler.
*/
BRPC_DLL_DECL
void
ProfilerRegisterThread
();
#ifdef __cplusplus
}
// extern "C"
#endif
#endif
/* BUTIL_GPERFTOOLS_PROFILER_H_ */
test/brpc_builtin_service_unittest.cpp
View file @
01bcd2cf
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
#include <fstream>
#include <fstream>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <gperftools/profiler.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/gperftools_profiler.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "brpc/socket.h"
#include "brpc/socket.h"
...
...
test/brpc_channel_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/brpc_esp_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <gperftools/profiler.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
...
...
test/brpc_event_dispatcher_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/fd_utility.h"
#include "butil/fd_utility.h"
...
...
test/brpc_http_rpc_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/brpc_hulu_pbrpc_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/gperftools_profiler.h"
#include "brpc/socket.h"
#include "brpc/socket.h"
#include "brpc/acceptor.h"
#include "brpc/acceptor.h"
#include "brpc/server.h"
#include "brpc/server.h"
...
...
test/brpc_input_messenger_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <netdb.h> //
#include <netdb.h> //
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/fd_utility.h"
#include "butil/fd_utility.h"
...
...
test/brpc_load_balancer_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <map>
#include <map>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/containers/doubly_buffered_data.h"
#include "butil/containers/doubly_buffered_data.h"
#include "brpc/socket.h"
#include "brpc/socket.h"
...
...
test/brpc_mongo_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/brpc_nova_pbrpc_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/brpc_protobuf_json_unittest.cpp
View file @
01bcd2cf
...
@@ -5,19 +5,19 @@
...
@@ -5,19 +5,19 @@
#include <iostream>
#include <iostream>
#include <fstream>
#include <fstream>
#include <string>
#include <string>
#include <gperftools/profiler.h>
#include <json2pb/pb_to_json.h>
#include <json2pb/json_to_pb.h>
#include <butil/iobuf.h>
#include <google/protobuf/text_format.h>
#include <google/protobuf/text_format.h>
#include <butil/third_party/rapidjson/rapidjson.h>
#include "butil/iobuf.h"
#include "butil/third_party/rapidjson/rapidjson.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/gperftools_profiler.h"
#include "json2pb/pb_to_json.h"
#include "json2pb/json_to_pb.h"
#include "json2pb/encode_decode.h"
#include "message.pb.h"
#include "message.pb.h"
#include "addressbook1.pb.h"
#include "addressbook1.pb.h"
#include "addressbook.pb.h"
#include "addressbook.pb.h"
#include "addressbook_encode_decode.pb.h"
#include "addressbook_encode_decode.pb.h"
#include "addressbook_map.pb.h"
#include "addressbook_map.pb.h"
#include <json2pb/encode_decode.h>
namespace
{
// just for coding-style check
namespace
{
// just for coding-style check
...
...
test/brpc_public_pbrpc_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/brpc_rtmp_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
...
...
test/brpc_server_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <fstream>
#include <fstream>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
...
...
test/brpc_snappy_compress_unittest.cpp
View file @
01bcd2cf
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
// Date: 2015/01/20 19:01:06
// Date: 2015/01/20 19:01:06
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "butil/third_party/snappy/snappy.h"
#include "butil/third_party/snappy/snappy.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/iobuf.h"
#include "butil/iobuf.h"
...
...
test/brpc_socket_map_unittest.cpp
View file @
01bcd2cf
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <gperftools/profiler.h>
#include "brpc/socket.h"
#include "brpc/socket.h"
#include "brpc/socket_map.h"
#include "brpc/socket_map.h"
#include "brpc/reloadable_flags.h"
#include "brpc/reloadable_flags.h"
...
...
test/brpc_socket_unittest.cpp
View file @
01bcd2cf
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <fcntl.h> // F_GETFD
#include <fcntl.h> // F_GETFD
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include "butil/gperftools_profiler.h"
#include <bthread/unstable.h>
#include <bthread/task_control.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/fd_utility.h"
#include "butil/fd_utility.h"
#include "bthread/unstable.h"
#include "bthread/task_control.h"
#include "brpc/socket.h"
#include "brpc/socket.h"
#include "brpc/errno.pb.h"
#include "brpc/errno.pb.h"
#include "brpc/acceptor.h"
#include "brpc/acceptor.h"
...
...
test/brpc_sofa_pbrpc_protocol_unittest.cpp
View file @
01bcd2cf
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.h>
#include "butil/time.h"
#include "butil/time.h"
...
...
test/bthread_cond_unittest.cpp
View file @
01bcd2cf
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/scoped_lock.h"
#include "butil/scoped_lock.h"
#include "butil/gperftools_profiler.h"
#include "bthread/bthread.h"
#include "bthread/bthread.h"
#include "bthread/condition_variable.h"
#include "bthread/condition_variable.h"
#include "bthread/stack.h"
#include "bthread/stack.h"
...
@@ -198,14 +199,6 @@ TEST(CondTest, cpp_wrapper) {
...
@@ -198,14 +199,6 @@ TEST(CondTest, cpp_wrapper) {
#undef pthread_create
#undef pthread_create
#endif
#endif
#define ENABLE_PROFILE
#ifdef ENABLE_PROFILE
# include <gperftools/profiler.h>
#else
# define ProfilerStart(a)
# define ProfilerStop()
#endif
class
Signal
{
class
Signal
{
protected
:
protected
:
Signal
()
:
_signal
(
0
)
{}
Signal
()
:
_signal
(
0
)
{}
...
...
test/bthread_dispatcher_unittest.cpp
View file @
01bcd2cf
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/scoped_lock.h"
#include "butil/scoped_lock.h"
#include "butil/fd_utility.h"
#include "butil/fd_utility.h"
#include "butil/logging.h"
#include "butil/logging.h"
#include "butil/gperftools_profiler.h"
#include "bthread/bthread.h"
#include "bthread/bthread.h"
#include "bthread/task_control.h"
#include "bthread/task_control.h"
#include "bthread/task_group.h"
#include "bthread/task_group.h"
...
...
test/bthread_execution_queue_unittest.cpp
View file @
01bcd2cf
...
@@ -9,14 +9,7 @@
...
@@ -9,14 +9,7 @@
#include <bthread/countdown_event.h>
#include <bthread/countdown_event.h>
#include "butil/time.h"
#include "butil/time.h"
#include "butil/fast_rand.h"
#include "butil/fast_rand.h"
#include "butil/gperftools_profiler.h"
#define ENABLE_PROFILE
#ifdef ENABLE_PROFILE
# include <gperftools/profiler.h>
#else
# define ProfilerStart(a)
# define ProfilerStop()
#endif
namespace
{
namespace
{
bool
stopped
=
false
;
bool
stopped
=
false
;
...
...
test/bthread_fd_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <sys/utsname.h> // uname
#include <sys/utsname.h> // uname
#include <fcntl.h>
#include <fcntl.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/fd_utility.h"
#include "butil/fd_utility.h"
...
...
test/bthread_mutex_unittest.cpp
View file @
01bcd2cf
...
@@ -11,14 +11,7 @@
...
@@ -11,14 +11,7 @@
#include "bthread/butex.h"
#include "bthread/butex.h"
#include "bthread/task_control.h"
#include "bthread/task_control.h"
#include "bthread/mutex.h"
#include "bthread/mutex.h"
#include "butil/gperftools_profiler.h"
//#define ENABLE_PROFILE
#ifdef ENABLE_PROFILE
# include <gperftools/profiler.h>
#else
# define ProfilerStart(a)
# define ProfilerStop()
#endif
namespace
{
namespace
{
inline
unsigned
*
get_butex
(
bthread_mutex_t
&
m
)
{
inline
unsigned
*
get_butex
(
bthread_mutex_t
&
m
)
{
...
...
test/bthread_unittest.cpp
View file @
01bcd2cf
...
@@ -7,18 +7,11 @@
...
@@ -7,18 +7,11 @@
#include "butil/time.h"
#include "butil/time.h"
#include "butil/macros.h"
#include "butil/macros.h"
#include "butil/logging.h"
#include "butil/logging.h"
#include <bthread/task_meta.h>
#include "butil/logging.h"
#include "butil/logging.h"
#include "butil/gperftools_profiler.h"
#include "bthread/bthread.h"
#include "bthread/bthread.h"
#include "bthread/unstable.h"
#include "bthread/unstable.h"
#include "bthread/task_meta.h"
#define ENABLE_PROFILE
#ifdef ENABLE_PROFILE
# include <gperftools/profiler.h>
#else
# define ProfilerStart(a)
# define ProfilerStop()
#endif
namespace
{
namespace
{
class
BthreadTest
:
public
::
testing
::
Test
{
class
BthreadTest
:
public
::
testing
::
Test
{
...
...
test/bvar_lock_timer_unittest.cpp
View file @
01bcd2cf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <condition_variable>
#include <condition_variable>
#endif
#endif
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include
<gperftools/profiler.h>
#include
"butil/gperftools_profiler.h"
#include "bvar/utils/lock_timer.h"
#include "bvar/utils/lock_timer.h"
namespace
{
namespace
{
...
...
test/bvar_percentile_unittest.cpp
View file @
01bcd2cf
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
#include "bvar/detail/percentile.h"
#include "bvar/detail/percentile.h"
#include "butil/logging.h"
#include "butil/logging.h"
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <gperftools/profiler.h>
#include <fstream>
#include <fstream>
class
PercentileTest
:
public
testing
::
Test
{
class
PercentileTest
:
public
testing
::
Test
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment