Debian Codegraph @

doc/examples/profiling/Makefile

raw symbols SCIP
1 ## Copyright (C) 2022 Matthew Fluet
2 # Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 # Jagannathan, and Stephen Weeks.
4 # Copyright (C) 1997-2000 NEC Research Institute.
5 #
6 # MLton is released under a HPND-style license.
7 # See the file MLton-LICENSE for details.
8 ##
9
10 ROOT := ../../..
11 include $(ROOT)/Makefile.config
12
13 ######################################################################
14
15 PATH := $(BIN):$(shell echo $$PATH)
16
17 mlton := mlton
18 mlprof := mlprof
19 ALLOC_EX := list-rev
20 COUNT_EX := tak
21 MULT_EX := fib-tak
22 TIME_EX := tak
23
24 .PHONY: all
25 all: profile-time profile-alloc profile-count profile-stack profile-multiple
26
27 .PHONY: profile-alloc
28 profile-alloc:
29 $(mlton) -profile alloc $(ALLOC_EX).sml
30 ./$(ALLOC_EX)
31 $(mlprof) -show-line true $(ALLOC_EX) mlmon.out
32
33 .PHONY: profile-count
34 profile-count:
35 $(mlton) -profile count $(COUNT_EX).sml
36 ./$(COUNT_EX)
37 $(mlprof) -raw true -show-line true $(COUNT_EX) mlmon.out
38
39 .PHONE: profile-multiple
40 profile-multiple:
41 $(mlton) -profile time $(MULT_EX).sml
42 ./$(MULT_EX)
43 $(mlprof) $(MULT_EX) mlmon.fib.out
44 $(mlprof) $(MULT_EX) mlmon.tak.out
45 $(mlprof) $(MULT_EX) mlmon.fib.out mlmon.tak.out mlmon.out
46
47 .PHONY: profile-stack
48 profile-stack:
49 $(mlton) -profile alloc -profile-stack true $(ALLOC_EX).sml
50 ./$(ALLOC_EX)
51 $(mlprof) -call-graph $(ALLOC_EX).dot -show-line true \
52 $(ALLOC_EX) mlmon.out
53 dot -Tps $(ALLOC_EX).dot >$(ALLOC_EX).ps || true
54
55 .PHONY: profile-time
56 profile-time:
57 $(mlton) -profile time $(TIME_EX).sml
58 ./$(TIME_EX)
59 $(mlprof) $(TIME_EX) mlmon.out
60 $(mlprof) -raw true $(TIME_EX) mlmon.out
61 $(mlprof) -show-line true $(TIME_EX) mlmon.out
62
63
64 $(eval $(MK_COMMON_GOALS))