(Please don't remove the list from cc)
On Tue, Jun 2, 2015 at 11:28 AM, Zhaoyang Huang zhaoyang.huang@linaro.org wrote:
amit, where i should add the shell script? pmqa?
No, the shell script can live in the 'tests' directory of idlestat.
i find that there is no idlestat dir established yet, need i create a new one or add it in the dir of cpuidle?
should i add juno.* into the pmqa or just under the idlestat dir?
No, not in PM-QA.
On 2 June 2015 at 13:29, Amit Kucheria amit.kucheria@linaro.org wrote:
On Mon, Jun 1, 2015 at 6:24 PM, Zhaoyang Huang zhaoyang.huang@linaro.org wrote:
the commit add one Makefile rule which will compare the output of the $(PLAT).trace to $(PLAT).report to check if idlestat have no regression
bellowing command line can verify it via the preloaded juno.trace and juno.report
make check PLAT=juno
Makefile | 5 + juno.report | 91 ++++++++++++++ juno.trace | 401 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please put juno.* in its own subdirectory called 'tests' since we might add other platforms here and don't want to litter the toplevel directory.
3 files changed, 497 insertions(+) create mode 100644 juno.report create mode 100644 juno.trace
diff --git a/Makefile b/Makefile index 42f16d7..1c1a108 100644 --- a/Makefile +++ b/Makefile @@ -49,3 +49,8 @@ install: idlestat idlestat.1
clean: rm -f $(OBJS) idlestat +check: idlestat
sudo ./idlestat --import -f ./$(PLAT).trace -p -c -w -o
comp.report
diff -s $(PLAT).report comp.report
rm -f comp.report
IMO, you should check the return code from the diff operation and print PASS or FAIL.
So it might be better to create a shell script (posix-compliant so it can run on a variety of shells) that contains the above commands, check the return code of diff and print a message.
diff --git a/juno.report b/juno.report new file mode 100644 index 0000000..9367115 --- /dev/null +++ b/juno.report @@ -0,0 +1,91 @@
+-------------------------------------------------------------------------------- +| C-state | min | max | avg | total | hits | over | under |
+-------------------------------------------------------------------------------- +| clusterA |
+-------------------------------------------------------------------------------- +| cpu-sleep-0 | 8.08ms | 8.08ms | 8.08ms | 8.08ms | 1 | 0 | 0 | +| cluster-sleep-0 | 478us | 994.46ms | 497.47ms | 994.93ms | 2 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu1 |
+-------------------------------------------------------------------------------- +| cluster-sleep-0 | 1.00s | 1.00s | 1.00s | 1.00s | 1 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu2 |
+-------------------------------------------------------------------------------- +| cpu-sleep-0 | 8.08ms | 8.08ms | 8.08ms | 8.08ms | 1 | 0 | 0 | +| cluster-sleep-0 | 995.04ms | 995.04ms | 995.04ms | 995.04ms | 1 | 0 | 0 |
+-------------------------------------------------------------------------------- +| clusterB |
+-------------------------------------------------------------------------------- +| cpu-sleep-0 | 88us | 5.30ms | 3.54ms | 14.16ms | 4 | 0 | 0 | +| cluster-sleep-0 | 221us | 101.27ms | 18.94ms | 984.69ms | 52 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu0 |
+-------------------------------------------------------------------------------- +| cpu-sleep-0 | 4.26ms | 5.30ms | 4.75ms | 14.24ms | 3 | 0 | 0 | +| cluster-sleep-0 | 321us | 101.27ms | 24.65ms | 985.86ms | 40 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu3 |
+-------------------------------------------------------------------------------- +| cluster-sleep-0 | 481us | 523.07ms | 111.35ms | 1.00s | 9 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu4 |
+-------------------------------------------------------------------------------- +| cluster-sleep-0 | 7.41ms | 515.70ms | 250.77ms | 1.00s | 4 | 0 | 0 |
+-------------------------------------------------------------------------------- +| cpu5 |
+-------------------------------------------------------------------------------- +| cluster-sleep-0 | 2.60ms | 521.31ms | 334.39ms | 1.00s | 3 | 0 | 0 |
+--------------------------------------------------------------------------------
+---------------------------------------------------------------- +| P-state | min | max | avg | total | hits | +---------------------------------------------------------------- +| clusterA | +---------------------------------------------------------------- +| 450.00MHz | 10us | 1.88ms | 524us | 2.10ms | 4 | +---------------------------------------------------------------- +| cpu1 | +---------------------------------------------------------------- +| 450.00MHz | 101us | 1.30ms | 699us | 1.40ms | 2 | +---------------------------------------------------------------- +| cpu2 | +---------------------------------------------------------------- +| 450.00MHz | 10us | 1.88ms | 665us | 1.99ms | 3 | +---------------------------------------------------------------- +| clusterB | +---------------------------------------------------------------- +| 450.00MHz | 12us | 404us | 65us | 1.70ms | 26 | +| 575.00MHz | 6us | 2.96ms | 195us | 6.06ms | 31 | +---------------------------------------------------------------- +| cpu0 | +---------------------------------------------------------------- +| 450.00MHz | 12us | 266us | 46us | 962us | 21 | +| 575.00MHz | 6us | 922us | 129us | 3.09ms | 24 | +---------------------------------------------------------------- +| cpu3 | +---------------------------------------------------------------- +| 450.00MHz | 77us | 135us | 106us | 212us | 2 | +| 575.00MHz | 77us | 2.22ms | 392us | 3.13ms | 8 | +---------------------------------------------------------------- +| cpu4 | +---------------------------------------------------------------- +| 450.00MHz | 19us | 154us | 80us | 239us | 3 | +| 575.00MHz | 16us | 2.59ms | 1.30ms | 2.60ms | 2 | +---------------------------------------------------------------- +| cpu5 | +---------------------------------------------------------------- +| 450.00MHz | 19us | 404us | 157us | 470us | 3 | +| 575.00MHz | 2.96ms | 2.96ms | 2.96ms | 2.96ms | 1 | +----------------------------------------------------------------
+------------------------------------------------------- +| IRQ | Name | Count | early | late | +------------------------------------------------------- +| cpu0 | +------------------------------------------------------- +| 92 | arch_mem_timer | 33 | 0 | 0 | +| 68 | arm_mhu | 2 | 0 | 0 | +| 67 | arm_mhu | 1 | 0 | 0 | +-------------------------------------------------------
diff --git a/juno.trace b/juno.trace new file mode 100644 index 0000000..6b22d18 --- /dev/null +++ b/juno.trace @@ -0,0 +1,401 @@ +idlestat version = 0.5 +cpus=6 +clusterA:
core0
cpu1
core1
cpu2
+clusterB:
core0
cpu0
core1
cpu3
core2
cpu4
core3
cpu5
+cpuid 0:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
+cpuid 1:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
+cpuid 2:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
+cpuid 3:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
+cpuid 4:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
+cpuid 5:
WFI
-1
cpu-sleep-0
-1
cluster-sleep-0
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
(null)
-1
idlestat-26701 [000] .... 532764.758856: cpu_frequency:
state=575000 cpu_id=0
idlestat-26701 [001] .... 532764.758856: cpu_frequency:
state=450000 cpu_id=1
idlestat-26701 [002] .... 532764.758856: cpu_frequency:
state=450000 cpu_id=2
idlestat-26701 [003] .... 532764.758856: cpu_frequency:
state=575000 cpu_id=3
idlestat-26701 [004] .... 532764.758856: cpu_frequency:
state=575000 cpu_id=4
idlestat-26701 [005] .... 532764.758856: cpu_frequency:
state=575000 cpu_id=5
<idle>-0 [000] d... 532764.759778: cpu_idle: state=2
cpu_id=0
<idle>-0 [001] .N.. 532764.760055: cpu_idle:
state=4294967295 cpu_id=1
<idle>-0 [001] d... 532764.760153: cpu_idle: state=2
cpu_id=1
<idle>-0 [002] .N.. 532764.760634: cpu_idle:
state=4294967295 cpu_id=2
<idle>-0 [002] d... 532764.760739: cpu_idle: state=1
cpu_id=2
<idle>-0 [003] .N.. 532764.760963: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532764.761077: cpu_idle: state=2
cpu_id=3
<idle>-0 [004] .N.. 532764.761316: cpu_idle:
state=4294967295 cpu_id=4
<idle>-0 [004] d... 532764.761442: cpu_idle: state=2
cpu_id=4
<idle>-0 [005] .N.. 532764.761677: cpu_idle:
state=4294967295 cpu_id=5
<idle>-0 [005] d... 532764.761818: cpu_idle: state=2
cpu_id=5
<idle>-0 [000] d.h. 532764.768460: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532764.768523: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.768534: cpu_idle: state=2
cpu_id=0
<idle>-0 [002] .... 532764.768820: cpu_idle:
state=4294967295 cpu_id=2
<idle>-0 [002] d... 532764.768830: cpu_idle: state=2
cpu_id=2
<idle>-0 [004] .... 532764.768849: cpu_idle:
state=4294967295 cpu_id=4
<idle>-0 [004] d... 532764.768865: cpu_idle: state=2
cpu_id=4
<idle>-0 [000] d.h. 532764.778461: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532764.778549: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.778609: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.788460: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532764.788549: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.788606: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.798461: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532764.798526: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.798537: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.808461: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532764.808540: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.808603: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.818461: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532764.818538: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.818549: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.828113: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532764.828164: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.828174: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532764.929380: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532764.929431: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532764.929441: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.030648: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.030697: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.030709: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.131914: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.131962: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.131973: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.218474: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.218563: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [003] .N.. 532765.218744: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [000] d... 532765.218815: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] d... 532765.218915: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.219136: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.219306: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.219546: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.219692: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.219929: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.220039: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.220493: irq_handler_entry:
irq=68 name=arm_mhu
<idle>-0 [000] .N.. 532765.220528: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.220620: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.220868: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.220978: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.221224: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.221377: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.221605: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.221749: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.221993: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.222151: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.222389: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.222539: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.222780: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.222872: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.223339: irq_handler_entry:
irq=68 name=arm_mhu
<idle>-0 [000] .N.. 532765.223375: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.223453: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.223683: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.223797: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] .N.. 532765.224043: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.224190: cpu_idle: state=1
cpu_id=0
<idle>-0 [003] .N.. 532765.224278: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.224355: cpu_idle: state=2
cpu_id=3
<idle>-0 [000] d.h. 532765.228402: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.228450: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.228456: cpu_idle: state=1
cpu_id=0
<idle>-0 [000] d.h. 532765.233109: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.233132: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.233139: cpu_idle: state=1
cpu_id=0
<idle>-0 [000] d.h. 532765.238396: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.238444: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.238671: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.240168: irq_handler_entry:
irq=67 name=arm_mhu
<idle>-0 [000] .N.. 532765.240208: cpu_idle:
state=4294967295 cpu_id=0
- irq/67-arm_mhu-26712 [000] d.h. 532765.240553: irq_handler_entry:
irq=67 name=arm_mhu
kworker/0:0-27133 [000] .... 532765.240628: cpu_frequency:
state=450000 cpu_id=0
kworker/0:0-27133 [000] .... 532765.240635: cpu_frequency:
state=450000 cpu_id=3
kworker/0:0-27133 [000] .... 532765.240638: cpu_frequency:
state=450000 cpu_id=4
kworker/0:0-27133 [000] .... 532765.240641: cpu_frequency:
state=450000 cpu_id=5
<idle>-0 [000] d... 532765.240701: cpu_idle: state=2
cpu_id=0
<idle>-0 [003] .N.. 532765.241058: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [004] .N.. 532765.241069: cpu_idle:
state=4294967295 cpu_id=4
<idle>-0 [005] .N.. 532765.241093: cpu_idle:
state=4294967295 cpu_id=5
<idle>-0 [003] d... 532765.241135: cpu_idle: state=2
cpu_id=3
<idle>-0 [004] d... 532765.241135: cpu_idle: state=2
cpu_id=4
<idle>-0 [005] d... 532765.241140: cpu_idle: state=2
cpu_id=5
<idle>-0 [000] d.h. 532765.248468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.248568: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.248634: cpu_idle: state=2
cpu_id=0
<idle>-0 [004] .... 532765.248916: cpu_idle:
state=4294967295 cpu_id=4
<idle>-0 [004] d... 532765.248935: cpu_idle: state=2
cpu_id=4
<idle>-0 [000] d.h. 532765.258469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.258560: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.258574: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.268469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.268557: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.268635: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.278468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.278567: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.278580: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.288468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.288538: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.288551: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.298469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.298558: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.298636: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.308469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.308566: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.308581: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.318468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.318562: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.318641: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.328468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.328558: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.328634: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.334366: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.334420: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.334432: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.338468: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.338557: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.338571: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.348469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.348537: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.348551: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.358469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .N.. 532765.358556: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.358626: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.368469: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.368562: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.368576: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.435646: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.435705: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.435718: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.536925: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.536983: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.536997: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.638203: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.638260: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.638274: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.739486: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.739543: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.739556: cpu_idle: state=2
cpu_id=0
<idle>-0 [000] d.h. 532765.762073: irq_handler_entry:
irq=92 name=arch_mem_timer
<idle>-0 [000] .... 532765.762117: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.762130: cpu_idle: state=2
cpu_id=0
<idle>-0 [005] .... 532765.762454: cpu_idle:
state=4294967295 cpu_id=5
<idle>-0 [005] d... 532765.762473: cpu_idle: state=2
cpu_id=5
<idle>-0 [000] .N.. 532765.762747: cpu_idle:
state=4294967295 cpu_id=0
<idle>-0 [000] d... 532765.763013: cpu_idle: state=2
cpu_id=0
<idle>-0 [001] .N.. 532765.763286: cpu_idle:
state=4294967295 cpu_id=1
<idle>-0 [001] d... 532765.763387: cpu_idle: state=2
cpu_id=1
<idle>-0 [002] .N.. 532765.763865: cpu_idle:
state=4294967295 cpu_id=2
<idle>-0 [002] d... 532765.763966: cpu_idle: state=2
cpu_id=2
<idle>-0 [003] .N.. 532765.764204: cpu_idle:
state=4294967295 cpu_id=3
<idle>-0 [003] d... 532765.764339: cpu_idle: state=2
cpu_id=3
<idle>-0 [004] .N.. 532765.764631: cpu_idle:
state=4294967295 cpu_id=4
<idle>-0 [004] d... 532765.764785: cpu_idle: state=2
cpu_id=4
<idle>-0 [005] .N.. 532765.765069: cpu_idle:
state=4294967295 cpu_id=5
idlestat-26701 [000] .... 532765.765473: cpu_frequency: state=0
cpu_id=0
idlestat-26701 [001] .... 532765.765473: cpu_frequency: state=0
cpu_id=1
idlestat-26701 [002] .... 532765.765473: cpu_frequency: state=0
cpu_id=2
idlestat-26701 [003] .... 532765.765473: cpu_frequency: state=0
cpu_id=3
idlestat-26701 [004] .... 532765.765473: cpu_frequency: state=0
cpu_id=4
idlestat-26701 [005] .... 532765.765473: cpu_frequency: state=0
cpu_id=5
1.7.9.5
Sched-tools mailing list Sched-tools@lists.linaro.org https://lists.linaro.org/mailman/listinfo/sched-tools
Hi,
sorry for the obnoxious top-post, but there is not really any relevant passage to quote, so here goes. Since you are doing some other good things to the implementation, here's something I think most people would be happy to see.
What I was thinking back when I thought I would have time for this was to embed the test control data into the test files instead of hardwiring any scripts or Makefile. A shell script would then pick the directives from the trace files and execute them in some order. In particular, if the test data can be (manually) embedded into the trace file, creating a ton of small tests becomes trivially easy. Multiple simple tests are of course good, as they are easier while pinpointing the cause when a regression occurs.
As every line* beginning with a hash mark in idlestat trace file is a comment, this doesn't even break anything existing. Same trace file can be source for multiple tests, so first we declare the test names and then declare what to do and what to compare. Taking the trace in this patch, the beginning would become:
idlestat version = 0.5 cpus=6 clusterA: core0 cpu1 ... #TESTS: TEST1 TEST2 TEST3 #TEST1-CMDLINE: ./idlestat --import -f tests/foo.trace -p -o test-out #TEST2-CMDLINE: ./idlestat --import -f tests/foo.trace -w -o test-out #TEST3-CMDLINE: ./idlestat --import -f tests/foo.trace -c -o test-out #TEST1-COMPARE: test-out tests/foo-p.out #TEST2-COMPARE: test-out tests/foo-w.out #TEST3-COMPARE: test-out tests/foo-c.out #TEST1-DELETE: test-out #TEST2-DELETE: test-out #TEST3-DELETE: test-out ... (Actual trace follows here)
Essentially the test script would be along the lines of: TEST_DEF_FILES = $(find tests -type f -print0|xargs -0 grep -l "^#TESTS:") for TD_FILE in $TEST_DEF_FILES ; do TESTS_NAMES = $(grep "^#TESTS:" $TD_FILE | cut -f 2 -d :) for TESTNAME in $TEST_NAMES ; do CMDLINE = $(grep "^#${TESTNAME}-CMDLINE) $TD_FILE | cut -f 2- -d :) COMPARE = $(grep "^#${TESTNAME}-COMPARE) $TD_FILE | cut -f 2- -d :) DELETE_LIST = $(grep "^#${TESTNAME}-DELETE) $TD_FILE | cut -f 2- -d :) # Run test if ! $CMDLINE ; then echo Terrible horrible error! rm -f $DELETE_LIST exit 1 fi if ! diff -u $COMPARE ; then echo Terrible horrible difference! rm -f $DELETE_LIST exit 1 fi rm -f $DELETE_LIST done done
...I guess that is pretty close to doing the job, actually. Oh well, I guess that wouldn't have taken so much time after all. On the other hand, I really haven't taken care to think about all the possible problems and maybe an eval or two is necessary, but .. well, if you like the idea, I guess you can iron out the wrinkles, I'm unfortunately busy doing solving something bigger.
*) Looking at the source, it would seem that lines beginning with # are NOT ignored anywhere any more. Puzzling, as I have some test files that actually do have comments within them and they work fine. Well, they used to work fine the last time I ran them. So maybe the comment-ignorance went out at some point or I'm looking at some wrong piece of code. Of course you can have the tests defined outside the trace files, the shell script doesn't care. Just less files would be less clutter and having test data and control in same file would be nice, although comparison data is already in a different file. Just sayin'.
Tuukka