forked from contiki-os/contiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.powertrace
57 lines (51 loc) · 1.97 KB
/
Makefile.powertrace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ifndef MAKEFILE_POWERTRACE
MAKEFILE_POWERTRACE = 1
ifdef LOG
powertrace-parse:
cat $(LOG) | grep -a "P " | $(CONTIKI)/tools/powertrace/parse-power-data > powertrace-data
cat $(LOG) | grep -a "P " | $(CONTIKI)/tools/powertrace/parse-node-power | sort -nr > powertrace-node-data
cat $(LOG) | $(CONTIKI)/tools/powertrace/parse-sniff-data | sort -n > powertrace-sniff-data
else #LOG
powertrace-parse:
@echo LOG must be defined to point to the powertrace log file to parse
endif #LOG
powertrace-plot: powertrace-plot-node powertrace-plot-sniff
@gnuplot $(CONTIKI)/tools/powertrace/plot-power || echo gnupot failed
powertrace-plot-sniff:
@gnuplot $(CONTIKI)/tools/powertrace/plot-sniff-power || echo gnupot failed
powertrace-plot-node:
@gnuplot $(CONTIKI)/tools/powertrace/plot-node-power || echo gnupot failed
powertrace-show:
gv powertrace-power.eps
gv powertrace-node-power.eps
gv powertrace-sniff-power.eps
powertrace-all: powertrace-parse powertrace-plot powertrace-show
powertrace-help:
@echo Contiki powertrace is a tool that helps with collecting power data
@echo from motes. The data can be collected from a testbed or from a Cooja
@echo simulation. The powertrace data consists of lines of text that include
@echo the capital letter P followed by a list of numbers that contain the
@echo measured time that mote peripherals were switched on.
@echo
@echo A powertrace data file can be parsed and plotted with build-in
@echo powertrace scripts.
@echo
@echo To parse a data file with powertrace data, run:
@echo
@echo make powertrace-parse LOG=logfile
@echo
@echo to plot the parsed data, do:
@echo
@echo make powertrace-plot
@echo
@echo this produces two files called powertrace-power.eps and
@echo powertrace-node-power.eps. To show these files, run:
@echo
@echo make powertrace-show
@echo
@echo For convenience, all three above make targets can be combined into
@echo one:
@echo
@echo make powertrace-all LOG=logfile
@echo
endif # MAKEFILE_POWERTRACE