Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Meeks committed Jan 11, 2010
1 parent 557036a commit 3d0aa2f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ VER=0.0.3
PKG_NAME=bootchart2
PKG_TARBALL=$(PKG_NAME)-$(VER).tar.bz2

nurgh
CC = gcc
CFLAGS = -g -Wall -Os

Expand Down
7 changes: 7 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
** Bugs:
+ Ensure that we merge up a sub-process' CPU usage into the
parent process when we hide very short running processes.

** Features:

Woah, there is some -serious- rounding error on the sample
data ... what is a CPU sample !? ...
Expand All @@ -6,6 +11,7 @@ we only see a ms at a time - which sucks [!] lets up-res the
old-style / bog-standard samples.



Account for the time taken to run the bootchart-collector ...
+ scale all other times by this ammount [!] ;-)
+ to make it -appear- as if it doesn't impact the system :-)
Expand Down Expand Up @@ -48,3 +54,4 @@ Process taskstats in advance
* Export ODF, with a number of pie charts in it etc.
+ export cumulative data for rendering in ods ?
+ rather than adding manual rendering - which sucks (!?)

6 changes: 4 additions & 2 deletions pybootchartgui/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ def render(ctx, options, xscale, headers, cpu_stats, disk_stats, proc_tree, time
ctx.set_font_size(SIG_FONT_SIZE)
draw_text(ctx, SIGNATURE, SIG_COLOR, off_x + 5, h - off_y - 5)

draw_cuml_graph(ctx, proc_tree, 5, h, w, 500)
# draw a cumulative CPU time per-process graph at the bottom ...
# see from the wiggles in it where we're waiting / blocking (?)
# draw_cuml_graph(ctx, proc_tree, 5, h, w, 500)


def accumulate_time(name_to_cuml_t, proc):
Expand Down Expand Up @@ -405,7 +407,7 @@ def draw_process_activity_colors(ctx, proc, proc_tree, x, y, w, proc_h, rect):

color = STATE_COLORS[state]
if state == STATE_RUNNING:
alpha = 1.0 #min (sample.cpu_sample.user + sample.cpu_sample.sys, 1.0)
alpha = min (sample.cpu_sample.user + sample.cpu_sample.sys, 1.0)
color = tuple(list(PROC_COLOR_R[0:3]) + [alpha])
# print "render time %d [ tx %d tw %d ], sample state %s color %s alpha %g" % (sample.time, tx, tw, state, color, alpha)
elif state == STATE_SLEEPING:
Expand Down
16 changes: 8 additions & 8 deletions pybootchartgui/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def _parse_taskstats_log(writer, file):
process = Process(writer, pid, cmd, ppid, time)
processMap[pid] = process

delta_cpu_ns = (int) (cpu_ns - process.last_cpu_ns)
delta_blkio_delay_ns = (int) (blkio_delay_ns - process.last_blkio_delay_ns)
delta_swapin_delay_ns = (int) (swapin_delay_ns - process.last_swapin_delay_ns)
delta_cpu_ns = (float) (cpu_ns - process.last_cpu_ns)
delta_blkio_delay_ns = (float) (blkio_delay_ns - process.last_blkio_delay_ns)
delta_swapin_delay_ns = (float) (swapin_delay_ns - process.last_swapin_delay_ns)

# make up some state data ...
if delta_cpu_ns > 0:
Expand All @@ -165,12 +165,12 @@ def _parse_taskstats_log(writer, file):
else:
state = "S"

# FIXME - we really need to render these more accurately - retaining higher precision to rendering.
ms_to_ns = 1000000;
# retain the ns timing information into a CPUSample - that tries
# with the old-style to be a %age of CPU used in this time-slice.
if delta_cpu_ns + delta_blkio_delay_ns + delta_swapin_delay_ns > 0:
cpuSample = CPUSample('null', delta_cpu_ns / ms_to_ns, 0.0,
delta_blkio_delay_ns / ms_to_ns,
delta_swapin_delay_ns / ms_to_ns)
cpuSample = CPUSample('null', delta_cpu_ns, 0.0,
delta_blkio_delay_ns,
delta_swapin_delay_ns)
process.samples.append(ProcessSample(time, state, cpuSample))

process.last_cpu_ns = cpu_ns
Expand Down

0 comments on commit 3d0aa2f

Please sign in to comment.