mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* nscd/cache.c (cache_search): Keep track of how many chain links we searched and update table statistics. (cache_add): Keep track of how many values are in the table. (prune_cache): Likewise. Keep track of locking success. Print messages about removed entries in separate pass. * nscd/connections.c (handle_request): Don't print debug message here. The caller will do it. Keep track of locking success. (nscd_run): Print debug message. Also print PID of the client process. * nscd/nscd.c (start_time): New variable. (main): Remember start time. * nscd/nscd.h: Declare start_time. (struct database): Add more members for new statistics. * nscd/nscd_stat.c: Add support for sending, receiving, and printing of new statistics.
This commit is contained in:
@ -120,14 +120,17 @@ struct _pthread_descr_struct
|
||||
union dtv *dtvp;
|
||||
pthread_descr self; /* Pointer to this structure */
|
||||
int multiple_threads;
|
||||
# define p_multiple_threads(descr) (descr)->p_header.data.multiple_threads
|
||||
# ifdef NEED_DL_SYSINFO
|
||||
uintptr_t sysinfo;
|
||||
# endif
|
||||
} data;
|
||||
void *__padding[16];
|
||||
} p_header;
|
||||
# define p_multiple_threads p_header.data.multiple_threads
|
||||
#elif TLS_MULTIPLE_THREADS_IN_TCB
|
||||
int p_multiple_threads;
|
||||
#endif
|
||||
|
||||
pthread_descr p_nextlive, p_prevlive;
|
||||
/* Double chaining of active threads */
|
||||
pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */
|
||||
@ -186,22 +189,7 @@ struct _pthread_descr_struct
|
||||
#endif
|
||||
size_t p_alloca_cutoff; /* Maximum size which should be allocated
|
||||
using alloca() instead of malloc(). */
|
||||
/* New elements must be added at the end before __multiple_threads. */
|
||||
#if TLS_MULTIPLE_THREADS_IN_TCB
|
||||
/* This field here isn't necessarily multiple_threads, which is really
|
||||
the last integer in struct _pthread_descr_struct. */
|
||||
int __multiple_threads;
|
||||
# define p_multiple_threads(descr) \
|
||||
(((union \
|
||||
{ \
|
||||
struct _pthread_descr_struct s; \
|
||||
struct \
|
||||
{ \
|
||||
char dummy[sizeof (struct _pthread_descr_struct) - sizeof (int)]; \
|
||||
int multiple_threads; \
|
||||
} m; \
|
||||
} *)(descr))->m.multiple_threads)
|
||||
#endif
|
||||
/* New elements must be added at the end. */
|
||||
} __attribute__ ((aligned(32))); /* We need to align the structure so that
|
||||
doubles are aligned properly. This is 8
|
||||
bytes on MIPS and 16 bytes on MIPS64.
|
||||
|
@ -571,7 +571,7 @@ int __pthread_initialize_manager(void)
|
||||
|
||||
__pthread_multiple_threads = 1;
|
||||
#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
|
||||
p_multiple_threads (__pthread_main_thread) = 1;
|
||||
__pthread_main_thread->p_multiple_threads = 1;
|
||||
#endif
|
||||
*__libc_multiple_threads_ptr = 1;
|
||||
|
||||
@ -620,7 +620,7 @@ int __pthread_initialize_manager(void)
|
||||
#if !defined USE_TLS || !TLS_DTV_AT_TP
|
||||
mgr->p_header.data.tcb = tcbp;
|
||||
mgr->p_header.data.self = mgr;
|
||||
p_multiple_threads (mgr) = 1;
|
||||
mgr->p_header.data.multiple_threads = 1;
|
||||
#elif TLS_MULTIPLE_THREADS_IN_TCB
|
||||
p_multiple_threads (mgr) = 1;
|
||||
#endif
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
--
|
||||
#ifdef USE_TLS
|
||||
MULTIPLE_THREADS_OFFSET -sizeof(int)
|
||||
MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads) - sizeof (struct _pthread_descr_struct)
|
||||
#else
|
||||
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
|
||||
#endif
|
||||
|
@ -32,6 +32,8 @@ typedef union dtv
|
||||
void *pointer;
|
||||
} dtv_t;
|
||||
|
||||
#else /* __ASSEMBLER__ */
|
||||
# include <tcb-offsets.h>
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#ifdef HAVE_TLS_SUPPORT
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
--
|
||||
#ifdef USE_TLS
|
||||
MULTIPLE_THREADS_OFFSET ((char *) &p_multiple_threads ((struct _pthread_descr_struct *)0) - (char *) 0)
|
||||
MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads)
|
||||
TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct)
|
||||
#else
|
||||
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <tls.h>
|
||||
#ifndef __ASSEMBLER__
|
||||
# include <linuxthreads/internals.h>
|
||||
#else
|
||||
# include <tcb-offsets.h>
|
||||
#endif
|
||||
|
||||
#if !defined NOT_IN_libc || defined IS_IN_libpthread
|
||||
@ -87,7 +85,7 @@
|
||||
|
||||
# ifndef __ASSEMBLER__
|
||||
# define SINGLE_THREAD_P \
|
||||
__builtin_expect (p_multiple_threads (THREAD_SELF) == 0, 1)
|
||||
__builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
|
||||
# else
|
||||
# define SINGLE_THREAD_P \
|
||||
lwz 10,MULTIPLE_THREADS_OFFSET(2); \
|
||||
|
@ -121,7 +121,7 @@
|
||||
# ifndef __ASSEMBLER__
|
||||
# if defined FLOATING_STACKS && USE___THREAD && defined PIC
|
||||
# define SINGLE_THREAD_P \
|
||||
__builtin_expect (p_multiple_threads (THREAD_SELF) == 0, 1)
|
||||
__builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
|
||||
# else
|
||||
extern int __local_multiple_threads attribute_hidden;
|
||||
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
|
||||
|
Reference in New Issue
Block a user