From 37eb925a06b094167e6f23df91e067503d095bd4 Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Tue, 15 May 2018 16:12:49 -0700 Subject: Add epollex fd cache --- src/core/lib/debug/stats_data.cc | 5 +++++ src/core/lib/debug/stats_data.h | 8 ++++++++ src/core/lib/debug/stats_data.yaml | 6 ++++++ src/core/lib/debug/stats_data_bq_schema.sql | 2 ++ 4 files changed, 21 insertions(+) (limited to 'src/core/lib/debug') diff --git a/src/core/lib/debug/stats_data.cc b/src/core/lib/debug/stats_data.cc index 309ece94bb..f8c27db0a8 100644 --- a/src/core/lib/debug/stats_data.cc +++ b/src/core/lib/debug/stats_data.cc @@ -40,6 +40,8 @@ const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = { "pollset_kick_wakeup_fd", "pollset_kick_wakeup_cv", "pollset_kick_own_thread", + "syscall_epoll_ctl", + "pollset_fd_cache_hits", "histogram_slow_lookups", "syscall_write", "syscall_read", @@ -144,6 +146,9 @@ const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = { "polling wakeup (only valid for epoll1 right now)", "How many times could a polling wakeup be satisfied by keeping the waking " "thread awake? (only valid for epoll1 right now)", + "Number of epoll_ctl calls made (only valid for epollex right now)", + "Number of epoll_ctl calls skipped because the fd was cached as already " + "being added. (only valid for epollex right now)", "Number of times histogram increments went through the slow (binary " "search) path", "Number of write syscalls (or equivalent - eg sendmsg) made by this " diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h index 37c548095f..1f3861f494 100644 --- a/src/core/lib/debug/stats_data.h +++ b/src/core/lib/debug/stats_data.h @@ -41,6 +41,8 @@ typedef enum { GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_FD, GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV, GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD, + GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL, + GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS, GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS, GRPC_STATS_COUNTER_SYSCALL_WRITE, GRPC_STATS_COUNTER_SYSCALL_READ, @@ -203,6 +205,10 @@ typedef enum { GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV) #define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD() \ GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD) +#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL() \ + GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL) +#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS() \ + GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS) #define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS() \ GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS) #define GRPC_STATS_INC_SYSCALL_WRITE() \ @@ -443,6 +449,8 @@ void grpc_stats_inc_server_cqs_checked(int x); #define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD() #define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV() #define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD() +#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL() +#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS() #define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS() #define GRPC_STATS_INC_SYSCALL_WRITE() #define GRPC_STATS_INC_SYSCALL_READ() diff --git a/src/core/lib/debug/stats_data.yaml b/src/core/lib/debug/stats_data.yaml index af4553028e..775b09df74 100644 --- a/src/core/lib/debug/stats_data.yaml +++ b/src/core/lib/debug/stats_data.yaml @@ -63,6 +63,12 @@ doc: How many times could a polling wakeup be satisfied by keeping the waking thread awake? (only valid for epoll1 right now) +# polling +- counter: syscall_epoll_ctl + doc: Number of epoll_ctl calls made (only valid for epollex right now) +- counter: pollset_fd_cache_hits + doc: Number of epoll_ctl calls skipped because the fd was cached as + already being added. (only valid for epollex right now) # stats system - counter: histogram_slow_lookups doc: Number of times histogram increments went through the slow diff --git a/src/core/lib/debug/stats_data_bq_schema.sql b/src/core/lib/debug/stats_data_bq_schema.sql index 04b6d471f6..7d1ab1dae9 100644 --- a/src/core/lib/debug/stats_data_bq_schema.sql +++ b/src/core/lib/debug/stats_data_bq_schema.sql @@ -12,6 +12,8 @@ pollset_kicked_again_per_iteration:FLOAT, pollset_kick_wakeup_fd_per_iteration:FLOAT, pollset_kick_wakeup_cv_per_iteration:FLOAT, pollset_kick_own_thread_per_iteration:FLOAT, +syscall_epoll_ctl_per_iteration:FLOAT, +pollset_fd_cache_hits_per_iteration:FLOAT, histogram_slow_lookups_per_iteration:FLOAT, syscall_write_per_iteration:FLOAT, syscall_read_per_iteration:FLOAT, -- cgit v1.2.3