Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a008111e60fd904803b106d197a14a5bdc4d32a7 (plain) (blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8" ?>
<!--
   Copyright (C) 2013, Red Hat, Inc. and others

   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Public License v1.0
   which accompanies this distribution, and is available at
   http://www.eclipse.org/legal/epl-v10.html
-->

<project name="Extract Traces" default="main" >
<target name="main">
  <antcall>
    <target name="checkAnyTraceExists"/>
    <target name="verifyChecksum"/>
    <target name="deleteFailedCheckSumTraces"/>
  </antcall>
  <antcall target="downloadTraceFiles"/>
  <exec executable = "git" failifexecutionfails="false" timeout="20000">
    <arg value = "clone"/>
    <arg value = "https://github.com/efficios/ctf-testsuite.git"/>
  </exec>
  <condition property="testSuiteExists">
    <and>
      <available file="ctf-testsuite" type="dir"/>
    </and>
  </condition>
  <antcall target="pullTestSuite"/>
  <condition property="tracesExist">
    <and>
      <available file="sample-ctf-trace-20120412.tar.bz2"/>
      <available file="trace2.tar.bz2"/>
      <available file="kernel_vm.tar.bz2" />
      <available file="synctraces.tar.gz" />
      <available file="django-benchmark.tar.gz" />
      <available file="hello-lost.tar.bz2" />
      <available file="cyg-profile.tar.bz2" />
      <available file="funky_trace.tar.bz2" />
    </and>
  </condition>
  <antcall target="extractTraces"/>
</target>

<target name="checkAnyTraceExists">
  <pathconvert property="anyTraceExists" setonempty="false" pathsep=" ">
    <path>
      <fileset dir="." includes="*.tar.bz2" />
      <fileset dir="." includes="*.tar.gz" />
      <fileset dir="." includes="*.zip" />
    </path>
  </pathconvert>
</target>

<target name="verifyChecksum">
  <echo message="Verifying: ${anyTraceExists}"/>
  <condition property="failedCheckSum">
    <and>
      <isset property="anyTraceExists"/>
      <not>
        <and>
          <checksum>
            <fileset dir="." includes="*.tar.bz2" />
            <fileset dir="." includes="*.tar.gz" />
            <fileset dir="." includes="*.zip" />
          </checksum>
        </and>
      </not>
    </and>
  </condition>
</target>


<target name="deleteFailedCheckSumTraces" if="failedCheckSum">
  <echo message="Some traces have failed the checksum tests. Deleting traces."/>
  <delete verbose="true">
    <fileset dir="." includes="*.tar.bz2" />
    <fileset dir="." includes="*.tar.gz" />
    <fileset dir="." includes="*.zip" />
  </delete>
</target>

<target name="warnFailedCheckSum" if="failedCheckSum">
  <echo message="WARNING: Some downloaded traces failed the checkum."/>
</target>

<target name="downloadTraceFiles">
  <echo message="Attempting to download test traces"/>
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="sample-ctf-trace-20120412.tar.bz2" src="http://lttng.org/files/samples/sample-ctf-trace-20120412.tar.bz2"/>
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="trace2.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/trace2.tar.bz2"/>
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="kernel_vm.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/kernel_vm.tar.bz2" />
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="synctraces.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/synctraces.tar.gz" />
  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="django-benchmark.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/django-benchmark.tgz" />
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="hello-lost.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/hello-lost.tar.bz2" />
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="cyg-profile.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/cyg-profile.tar.bz2" />
  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="funky_trace.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/funky_trace.tar.bz2" />
  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="testtraceExp.zip" src="http://secretaire.dorsal.polymtl.ca/~mattkhouzam/testTrace-200Overlap.zip" />
</target>

<target name="pullTestSuite" if="testSuiteExists">
  <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
    <arg value = "fetch"/>
  </exec>
  <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
    <arg value = "checkout"/>
    <arg value = "1f096f5356d09"/>
  </exec>
</target>

<target name="extractTraces" if="tracesExist">
    <antcall>
      <target name="checkAnyTraceExists"/>
      <target name="verifyChecksum"/>
      <target name="warnFailedCheckSum"/>
    </antcall>
    <bunzip2 src="sample-ctf-trace-20120412.tar.bz2"/>
    <bunzip2 src="trace2.tar.bz2"/>
    <bunzip2 src="kernel_vm.tar.bz2" />
    <gunzip src="synctraces.tar.gz" />
    <gunzip src="django-benchmark.tar.gz" />
    <bunzip2 src="hello-lost.tar.bz2" />
    <bunzip2 src="cyg-profile.tar.bz2" />
    <bunzip2 src="funky_trace.tar.bz2" />
    <unzip src="testtraceExp.zip" dest="./exp" />

    <untar src="sample-ctf-trace-20120412.tar" dest="." />
    <untar src="trace2.tar" dest="." />
    <untar src="kernel_vm.tar" dest="." />
    <untar src="synctraces.tar" dest="." />
    <untar src="django-benchmark.tar" dest="." />
    <untar src="hello-lost.tar" dest="." />
    <untar src="cyg-profile.tar" dest="." />
    <untar src="funky_trace.tar" dest="." />

    <echo message="Traces extracted successfully"/>
</target>
</project>

Back to the top