diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/profile.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'module/profile.m')
| -rw-r--r-- | module/profile.m | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/module/profile.m b/module/profile.m new file mode 100644 index 00000000..fc0ee687 --- /dev/null +++ b/module/profile.m @@ -0,0 +1,78 @@ +Profile: module +{ + PATH: con "/dis/lib/profile.dis"; + + Range: adt{ + l: int; + u: int; + f: int; + n: cyclic ref Range; + }; + + Funprof: adt{ + name: string; + # file: string; + line: int; + count: int; + counte: int; + }; + + Modprof: adt{ + name: string; + path: string; + srcpath: string; + rawtab: array of (int, int); + linetab: array of int; + rngtab: array of ref Range; + funtab: array of Funprof; + total: int; + totals: array of int; + coverage: int; + }; + + Prof: adt{ + mods: list of Modprof; + total: int; + totals: array of int; + }; + + Coverage: type list of (string, int, list of (list of (int, int, int), string)); + + # constants to or into second arg of show() + MODULE: con 1; # give stats for each module + FUNCTION: con 2; # give stats for each function + LINE: con 4; # give stats for each line + VERBOSE: con 8; # full stats + FULLHDR: con 16; # file:lineno: on each line of output + FREQUENCY: con 32; # show frequency rather than coverage + + init: fn(): int; + lasterror: fn(): string; + profile: fn(m: string): int; + sample: fn(i: int): int; + start: fn(): int; + stop: fn(): int; + stats: fn() : Prof; + show: fn(p: Prof, v: int): int; + end: fn(): int; + + # coverage profiling specific functions + + cpstart: fn(pid: int): int; + cpstats: fn(rec: int, v: int): Prof; + cpfstats: fn(v: int): Prof; + cpshow: fn(p: Prof, v: int): int; + + coverage: fn(p: Prof, v: int): Coverage; + + # memory profiling specific functions + + MAIN: con 1; + HEAP: con 2; + IMAGE: con 4; + + memstart: fn(mem: int): int; + memstats: fn(): Prof; + memshow: fn(p: Prof, v: int): int; + +}; |
