Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
0321e8a0
Commit
0321e8a0
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
No more debug log in loop.
parent
b02e5a3e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ccnode/hypervisor/lib.py
+11
-11
11 additions, 11 deletions
ccnode/hypervisor/lib.py
with
11 additions
and
11 deletions
ccnode/hypervisor/lib.py
+
11
−
11
View file @
0321e8a0
...
@@ -151,7 +151,7 @@ class EventLoop(object):
...
@@ -151,7 +151,7 @@ class EventLoop(object):
# with the event loop for input events. When we need to force
# with the event loop for input events. When we need to force
# the main thread out of a poll() sleep, we simple write a
# the main thread out of a poll() sleep, we simple write a
# single byte of data to the other end of the pipe.
# single byte of data to the other end of the pipe.
logger
.
debug
(
'
Self pipe watch %d write %d
'
,
self
.
pipetrick
[
0
],
self
.
pipetrick
[
1
])
#
logger.debug('Self pipe watch %d write %d', self.pipetrick[0], self.pipetrick[1])
self
.
poll
.
register
(
self
.
pipetrick
[
0
],
select
.
POLLIN
)
self
.
poll
.
register
(
self
.
pipetrick
[
0
],
select
.
POLLIN
)
def
next_timeout
(
self
):
def
next_timeout
(
self
):
...
@@ -214,7 +214,7 @@ class EventLoop(object):
...
@@ -214,7 +214,7 @@ class EventLoop(object):
"""
"""
sleep
=
-
1
sleep
=
-
1
next
=
self
.
next_timeout
()
next
=
self
.
next_timeout
()
logger
.
debug
(
'
Next timeout due at %d
'
,
next
)
#
logger.debug('Next timeout due at %d', next)
if
next
>
0
:
if
next
>
0
:
now
=
int
(
time
.
time
()
*
1000
)
now
=
int
(
time
.
time
()
*
1000
)
if
now
>=
next
:
if
now
>=
next
:
...
@@ -222,7 +222,7 @@ class EventLoop(object):
...
@@ -222,7 +222,7 @@ class EventLoop(object):
else
:
else
:
sleep
=
next
-
now
sleep
=
next
-
now
logger
.
debug
(
'
Poll with a sleep of %d
'
,
sleep
)
#
logger.debug('Poll with a sleep of %d', sleep)
events
=
self
.
poll
.
poll
(
sleep
)
events
=
self
.
poll
.
poll
(
sleep
)
# Dispatch any file handle events that occurred
# Dispatch any file handle events that occurred
...
@@ -236,7 +236,7 @@ class EventLoop(object):
...
@@ -236,7 +236,7 @@ class EventLoop(object):
h
=
self
.
get_handle_by_fd
(
fd
)
h
=
self
.
get_handle_by_fd
(
fd
)
if
h
:
if
h
:
logger
.
debug
(
'
Dispatch fd %d handle %d events %d
'
,
fd
,
h
.
get_id
(),
revents
)
#
logger.debug('Dispatch fd %d handle %d events %d', fd, h.get_id(), revents)
h
.
dispatch
(
self
.
events_from_poll
(
revents
))
h
.
dispatch
(
self
.
events_from_poll
(
revents
))
now
=
int
(
time
.
time
()
*
1000
)
now
=
int
(
time
.
time
()
*
1000
)
...
@@ -249,7 +249,7 @@ class EventLoop(object):
...
@@ -249,7 +249,7 @@ class EventLoop(object):
# Deduct 20ms, since schedular timeslice
# Deduct 20ms, since schedular timeslice
# means we could be ever so slightly early
# means we could be ever so slightly early
if
now
>=
(
want
-
20
):
if
now
>=
(
want
-
20
):
logger
.
debug
(
'
Dispatch timer %d now %s want %s
'
,
t
.
get_id
(),
str
(
now
),
str
(
want
))
#
logger.debug('Dispatch timer %d now %s want %s', t.get_id(), str(now), str(want))
t
.
set_last_fired
(
now
)
t
.
set_last_fired
(
now
)
t
.
dispatch
()
t
.
dispatch
()
...
@@ -272,7 +272,7 @@ class EventLoop(object):
...
@@ -272,7 +272,7 @@ class EventLoop(object):
self
.
poll
.
register
(
fd
,
self
.
events_to_poll
(
events
))
self
.
poll
.
register
(
fd
,
self
.
events_to_poll
(
events
))
self
.
interrupt
()
self
.
interrupt
()
logger
.
debug
(
'
Add handle %d fd %d events %d
'
,
handleID
,
fd
,
events
)
#
logger.debug('Add handle %d fd %d events %d', handleID, fd, events)
return
handleID
return
handleID
...
@@ -291,7 +291,7 @@ class EventLoop(object):
...
@@ -291,7 +291,7 @@ class EventLoop(object):
self
.
timers
.
append
(
h
)
self
.
timers
.
append
(
h
)
self
.
interrupt
()
self
.
interrupt
()
logger
.
debug
(
'
Add timer %d interval %d
'
,
timerID
,
interval
)
#
logger.debug('Add timer %d interval %d', timerID, interval)
return
timerID
return
timerID
...
@@ -306,7 +306,7 @@ class EventLoop(object):
...
@@ -306,7 +306,7 @@ class EventLoop(object):
self
.
poll
.
register
(
h
.
get_fd
(),
self
.
events_to_poll
(
events
))
self
.
poll
.
register
(
h
.
get_fd
(),
self
.
events_to_poll
(
events
))
self
.
interrupt
()
self
.
interrupt
()
logger
.
debug
(
'
Update handle %d fd %d events %d
'
,
handleID
,
h
.
get_fd
(),
events
)
#
logger.debug('Update handle %d fd %d events %d', handleID, h.get_fd(), events)
def
update_timer
(
self
,
timerID
,
interval
):
def
update_timer
(
self
,
timerID
,
interval
):
"""
Change the periodic frequency of the timer.
"""
Change the periodic frequency of the timer.
...
@@ -317,7 +317,7 @@ class EventLoop(object):
...
@@ -317,7 +317,7 @@ class EventLoop(object):
h
.
set_interval
(
interval
);
h
.
set_interval
(
interval
);
self
.
interrupt
()
self
.
interrupt
()
logger
.
debug
(
'
Update timer %d interval %d
'
,
timerID
,
interval
)
#
logger.debug('Update timer %d interval %d', timerID, interval)
break
break
def
remove_handle
(
self
,
handleID
):
def
remove_handle
(
self
,
handleID
):
...
@@ -328,7 +328,7 @@ class EventLoop(object):
...
@@ -328,7 +328,7 @@ class EventLoop(object):
for
h
in
self
.
handles
:
for
h
in
self
.
handles
:
if
h
.
get_id
()
==
handleID
:
if
h
.
get_id
()
==
handleID
:
self
.
poll
.
unregister
(
h
.
get_fd
())
self
.
poll
.
unregister
(
h
.
get_fd
())
logger
.
debug
(
'
Remove handle %d fd %d
'
,
handleID
,
h
.
get_fd
())
#
logger.debug('Remove handle %d fd %d', handleID, h.get_fd())
else
:
else
:
handles
.
append
(
h
)
handles
.
append
(
h
)
self
.
handles
=
handles
self
.
handles
=
handles
...
@@ -342,7 +342,7 @@ class EventLoop(object):
...
@@ -342,7 +342,7 @@ class EventLoop(object):
for
h
in
self
.
timers
:
for
h
in
self
.
timers
:
if
h
.
get_id
()
!=
timerID
:
if
h
.
get_id
()
!=
timerID
:
timers
.
append
(
h
)
timers
.
append
(
h
)
logger
.
debug
(
'
Remove timer %d
'
,
timerID
)
#
logger.debug('Remove timer %d', timerID)
self
.
timers
=
timers
self
.
timers
=
timers
self
.
interrupt
()
self
.
interrupt
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment