diff options
author | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2012-03-23 18:05:46 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2012-03-23 18:05:46 -0400 |
commit | 63f66ae44899e044058fa370c440ed47a8d98209 (patch) | |
tree | 76862f17d83b57918204bf70df03dac8518be758 | |
parent | 7a1f4341dcf3ff05b7bf2056d36ee6db59b18d6a (diff) |
More analysis
-rwxr-xr-x | image.py | 47 |
1 files changed, 39 insertions, 8 deletions
@@ -11,8 +11,14 @@ if len (sys.argv) < 2: filename = sys.argv[1] +not_in_vm_by_address = { } + +area_by_reason_cached = { } +area_by_reason_uncached = { } + f = open (filename); for line in f: + line = line.rstrip() fields = line.split (',') if fields[0].find (']'): @@ -24,7 +30,7 @@ for line in f: if len (tmp) > 1: tmp = tmp[1].split (" ") address = tmp[1]; - print address, "--------", why + not_in_vm_by_address[address] = why elif fields[0].find ("IMAGE") != -1: width = int (fields[1]) height = int (fields[2]) @@ -33,12 +39,37 @@ for line in f: in_cache = not (contains (fields[4], "non-cache")) if contains (fields[5], "Composite"): - composite = True - op = fields[6] - with_mask = not contains (fields[7], "without-mask") + why = "Composite" + fields[6] + fields[7] + elif contains (fields[5], "is not in video memory"): + tmp = fields[5].split (' ') + + if tmp[2] in not_in_vm_by_address: + why = "not in video memory:" + not_in_vm_by_address[tmp[2]] + else: + why = "not in video memory for unknown reason" + elif contains (fields[5], "PutImage"): + why = "PutImage or ShmPutImage" + else: + why = fields[5] + + if not why in area_by_reason_cached: + area_by_reason_cached[why] = 0 + if not why in area_by_reason_uncached: + area_by_reason_uncached[why] = 0 + + if in_cache: + area_by_reason_cached[why] += width * height else: - composite = False - op = None - with_mask = None + area_by_reason_uncached[why] += width * height + +print "=============== cached ======================" + +for k in area_by_reason_cached: + print k, area_by_reason_cached[k] + +print +print "=============== uncached ====================" + - print width, height, in_cache, composite, op, with_mask +for k in area_by_reason_uncached: + print k, area_by_reason_uncached[k] |