1
# Copyright (C) 2005-2010 Canonical Ltd
1
# Copyright (C) 2006, 2007 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
135
135
'WorkingSetSize': mem_struct.WorkingSetSize,
136
136
'QuotaPeakPagedPoolUsage': mem_struct.QuotaPeakPagedPoolUsage,
137
137
'QuotaPagedPoolUsage': mem_struct.QuotaPagedPoolUsage,
138
'QuotaPeakNonPagedPoolUsage':
139
mem_struct.QuotaPeakNonPagedPoolUsage,
138
'QuotaPeakNonPagedPoolUsage': mem_struct.QuotaPeakNonPagedPoolUsage,
140
139
'QuotaNonPagedPoolUsage': mem_struct.QuotaNonPagedPoolUsage,
141
140
'PagefileUsage': mem_struct.PagefileUsage,
142
141
'PeakPagefileUsage': mem_struct.PeakPagefileUsage,
153
152
' or win32process')
156
# using base-2 units (see HACKING.txt).
157
trace.note('WorkingSize %7dKiB'
158
'\tPeakWorking %7dKiB\t%s',
155
trace.note('WorkingSize %7dKB'
156
'\tPeakWorking %7dKB\t%s',
159
157
info['WorkingSetSize'] / 1024,
160
158
info['PeakWorkingSetSize'] / 1024,
164
162
trace.note('%s', message)
165
trace.note('WorkingSize %8d KiB', info['WorkingSetSize'] / 1024)
166
trace.note('PeakWorking %8d KiB', info['PeakWorkingSetSize'] / 1024)
167
trace.note('PagefileUsage %8d KiB', info.get('PagefileUsage', 0) / 1024)
168
trace.note('PeakPagefileUsage %8d KiB',
169
info.get('PeakPagefileUsage', 0) / 1024)
170
trace.note('PrivateUsage %8d KiB', info.get('PrivateUsage', 0) / 1024)
163
trace.note('WorkingSize %8d KB', info['WorkingSetSize'] / 1024)
164
trace.note('PeakWorking %8d KB', info['PeakWorkingSetSize'] / 1024)
165
trace.note('PagefileUsage %8d KB', info.get('PagefileUsage', 0) / 1024)
166
trace.note('PeakPagefileUsage %8d KB', info.get('PeakPagefileUsage', 0) / 1024)
167
trace.note('PrivateUsage %8d KB', info.get('PrivateUsage', 0) / 1024)
171
168
trace.note('PageFaultCount %8d', info.get('PageFaultCount', 0))
192
189
(bufx, bufy, curx, cury, wattr,
193
left, top, right, bottom, maxx, maxy) = struct.unpack(
194
"hhhhHhhhhhh", csbi.raw)
190
left, top, right, bottom, maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw)
195
191
sizex = right - left + 1
196
192
sizey = bottom - top + 1
197
193
return (sizex, sizey)
416
412
def _ensure_with_dir(path):
417
if (not os.path.split(path)[0] or path.startswith(u'*')
418
or path.startswith(u'?')):
413
if not os.path.split(path)[0] or path.startswith(u'*') or path.startswith(u'?'):
419
414
return u'./' + path, True
421
416
return path, False