Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
20f5b388
Commit
20f5b388
authored
Jan 11, 2010
by
antirez
Browse files
converted random printfs in debug logs
parent
b3e3d0d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
20f5b388
...
@@ -7385,10 +7385,6 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
...
@@ -7385,10 +7385,6 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
/* Post process it in the main thread, as there are things we
/* Post process it in the main thread, as there are things we
* can do just here to avoid race conditions and/or invasive locks */
* can do just here to avoid race conditions and/or invasive locks */
redisLog
(
REDIS_DEBUG
,
"Job type: %d, key at %p (%s) refcount: %d
\n
"
,
j
->
type
,
(
void
*
)
j
->
key
,
(
char
*
)
j
->
key
->
ptr
,
j
->
key
->
refcount
);
redisLog
(
REDIS_DEBUG
,
"Job type: %d, key at %p (%s) refcount: %d
\n
"
,
j
->
type
,
(
void
*
)
j
->
key
,
(
char
*
)
j
->
key
->
ptr
,
j
->
key
->
refcount
);
if
(
j
->
key
->
refcount
<=
0
)
{
printf
(
"Ooops ref count is <= 0!
\n
"
);
exit
(
1
);
}
de
=
dictFind
(
j
->
db
->
dict
,
j
->
key
);
de
=
dictFind
(
j
->
db
->
dict
,
j
->
key
);
assert
(
de
!=
NULL
);
assert
(
de
!=
NULL
);
key
=
dictGetEntryKey
(
de
);
key
=
dictGetEntryKey
(
de
);
...
@@ -7523,7 +7519,7 @@ static void *IOThreadEntryPoint(void *arg) {
...
@@ -7523,7 +7519,7 @@ static void *IOThreadEntryPoint(void *arg) {
lockThreadedIO
();
lockThreadedIO
();
if
(
listLength
(
server
.
io_newjobs
)
==
0
)
{
if
(
listLength
(
server
.
io_newjobs
)
==
0
)
{
/* No new jobs in queue, exit. */
/* No new jobs in queue, exit. */
printf
(
"Thread %lld exiting, nothing to do
\n
"
,
redisLog
(
REDIS_DEBUG
,
"Thread %lld exiting, nothing to do
\n
"
,
(
long
long
)
pthread_self
());
(
long
long
)
pthread_self
());
server
.
io_active_threads
--
;
server
.
io_active_threads
--
;
unlockThreadedIO
();
unlockThreadedIO
();
...
@@ -7537,7 +7533,7 @@ static void *IOThreadEntryPoint(void *arg) {
...
@@ -7537,7 +7533,7 @@ static void *IOThreadEntryPoint(void *arg) {
listAddNodeTail
(
server
.
io_processing
,
j
);
listAddNodeTail
(
server
.
io_processing
,
j
);
ln
=
listLast
(
server
.
io_processing
);
/* We use ln later to remove it */
ln
=
listLast
(
server
.
io_processing
);
/* We use ln later to remove it */
unlockThreadedIO
();
unlockThreadedIO
();
printf
(
"Thread %lld got a new job: %p about key '%s'
\n
"
,
redisLog
(
REDIS_DEBUG
,
"Thread %lld got a new job: %p about key '%s'
\n
"
,
(
long
long
)
pthread_self
(),
(
void
*
)
j
,
(
char
*
)
j
->
key
->
ptr
);
(
long
long
)
pthread_self
(),
(
void
*
)
j
,
(
char
*
)
j
->
key
->
ptr
);
/* Process the Job */
/* Process the Job */
...
@@ -7550,7 +7546,7 @@ static void *IOThreadEntryPoint(void *arg) {
...
@@ -7550,7 +7546,7 @@ static void *IOThreadEntryPoint(void *arg) {
}
}
/* Done: insert the job into the processed queue */
/* Done: insert the job into the processed queue */
printf
(
"Thread %lld completed the job: %p
\n
"
,
redisLog
(
REDIS_DEBUG
,
"Thread %lld completed the job: %p
\n
"
,
(
long
long
)
pthread_self
(),
(
void
*
)
j
);
(
long
long
)
pthread_self
(),
(
void
*
)
j
);
lockThreadedIO
();
lockThreadedIO
();
listDelNode
(
server
.
io_processing
,
ln
);
listDelNode
(
server
.
io_processing
,
ln
);
...
@@ -7721,7 +7717,6 @@ static void daemonize(void) {
...
@@ -7721,7 +7717,6 @@ static void daemonize(void) {
FILE
*
fp
;
FILE
*
fp
;
if
(
fork
()
!=
0
)
exit
(
0
);
/* parent exits */
if
(
fork
()
!=
0
)
exit
(
0
);
/* parent exits */
printf
(
"New pid: %d
\n
"
,
getpid
());
setsid
();
/* create a new session */
setsid
();
/* create a new session */
/* Every output goes to /dev/null. If Redis is daemonized but
/* Every output goes to /dev/null. If Redis is daemonized but
...
...
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