diff --git a/tools/powertrace/Makefile.powertrace b/tools/powertrace/Makefile.powertrace index 712151bac..22aa63dcc 100644 --- a/tools/powertrace/Makefile.powertrace +++ b/tools/powertrace/Makefile.powertrace @@ -8,8 +8,14 @@ powertrace-parse: @echo LOG must be defined to point to the powertrace log file to parse endif #LOG -powertrace-plot: - gnuplot $(CONTIKI)/tools/powertrace/plot-power || echo gnupot failed +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 diff --git a/tools/powertrace/parse-sniff-data b/tools/powertrace/parse-sniff-data index 0c0731272..45e696c6a 100755 --- a/tools/powertrace/parse-sniff-data +++ b/tools/powertrace/parse-sniff-data @@ -22,7 +22,8 @@ while(<>) { if($packettype == 1) { $channel .= "-ack" } - + + $num_packets_for_channel{$channel}++; $tx_for_channel{$channel} += $tx; $rx_for_channel{$channel} += $rx; $total += $rx + $tx; @@ -36,8 +37,11 @@ while(<>) { } } +print "# Columns are:\n"; +print "# activity tx_dutycycle rx_dutycycle num_packets\n"; + foreach $c (keys %tx_for_channel) { - print "$c " . $tx_for_channel{$c}/$total . " " . $rx_for_channel{$c}/$total . "\n"; + print "$c " . $tx_for_channel{$c}/$total . " " . $rx_for_channel{$c}/$total . " " . $num_packets_for_channel{$c} . "\n"; } print STDERR "Final / forward = " . $final / $total . "/" . $forward / $total . "\n";