<runtests>
<test name="one_function">
  <executable name="simpleperf_runtest_one_function"/>

  <symbol_overhead>
    <symbol name="Function1()" min="90" max="100"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" min="90" max="100"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="Function1()">
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="two_functions">
  <executable name="simpleperf_runtest_two_functions"/>

  <symbol_overhead>
    <symbol name="Function1()" min="30" max="70"/>
    <symbol name="Function2()" min="30" max="70"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" min="90" max="100"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="Function1()">
      <symbol name="main"/>
    </symbol>
    <symbol name="Function2()">
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="function_fork">
  <executable name="simpleperf_runtest_function_fork"/>
  <report option="--sort comm,symbol"/>

  <symbol_overhead>
    <symbol name="ParentFunction()" min="10" max="90"/>
    <symbol name="ChildFunction()" min="10" max="90"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" min="10"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="ParentFunction()">
      <symbol name="main"/>
    </symbol>
    <symbol name="ChildFunction()">
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="function_pthread">
  <executable name="simpleperf_runtest_function_pthread"/>

  <symbol_overhead>
    <symbol name="MainThreadFunction()" min="20" max="80"/>
    <symbol name="ChildThreadFunction(void*)" min="20" max="80"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" min="20" max="80"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="MainThreadFunction()">
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="comm_change">
  <executable name="simpleperf_runtest_comm_change"/>

  <symbol_overhead>
    <symbol name="Function1()" comm="RUN_COMM1" min="30" max="70"/>
    <symbol name="Function1()" comm="RUN_COMM2" min="30" max="70"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" comm="RUN_COMM1" min="30" max="70"/>
    <symbol name="main" comm="RUN_COMM2" min="30" max="70"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="Function1()" comm="RUN_COMM1">
      <symbol name="main"/>
    </symbol>
    <symbol name="Function1()" comm="RUN_COMM2">
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>

</test>

<test name="function_recursive">
  <executable name="simpleperf_runtest_function_recursive"/>

  <symbol_overhead>
    <symbol name="FunctionRecursive(int)" min="90"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="main" min="90"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="FunctionRecursive(int)">
      <symbol name="FunctionRecursive(int)">
        <symbol name="FunctionRecursive(int)">
          <symbol name="FunctionRecursive(int)">
            <symbol name="FunctionRecursive(int)">
              <symbol name="FunctionRecursive(int)">
                <symbol name="FunctionRecursive(int)">
                  <symbol name="FunctionRecursive(int)">
                    <symbol name="FunctionRecursive(int)">
                      <symbol name="FunctionRecursive(int)">
                        <symbol name="FunctionRecursive(int)">
                          <symbol name="main"/>
                        </symbol>
                        <symbol name="main"/>
                      </symbol>
                      <symbol name="main"/>
                    </symbol>
                    <symbol name="main"/>
                  </symbol>
                  <symbol name="main"/>
                </symbol>
                <symbol name="main"/>
              </symbol>
              <symbol name="main"/>
            </symbol>
            <symbol name="main"/>
          </symbol>
          <symbol name="main"/>
        </symbol>
        <symbol name="main"/>
      </symbol>
      <symbol name="main"/>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="function_indirect_recursive">
  <executable name="simpleperf_runtest_function_indirect_recursive"/>

  <symbol_overhead>
    <symbol name="FunctionRecursiveOne(int)" min="20"/>
    <symbol name="FunctionRecursiveTwo(int)" min="20"/>
  </symbol_overhead>

  <symbol_children_overhead>
    <symbol name="FunctionRecursiveOne(int)" min="90"/>
    <symbol name="FunctionRecursiveTwo(int)" min="80"/>
  </symbol_children_overhead>

  <symbol_callgraph_relation>
    <symbol name="FunctionRecursiveOne(int)">
      <symbol name="FunctionRecursiveTwo(int)">
        <symbol name="FunctionRecursiveOne(int)">
          <symbol name="FunctionRecursiveTwo(int)">
            <symbol name="FunctionRecursiveOne(int)"/>
          </symbol>
          <symbol name="main"/>
        </symbol>
      </symbol>
      <symbol name="main"/>
    </symbol>

    <symbol name="FunctionRecursiveTwo(int)">
      <symbol name="FunctionRecursiveOne(int)">
        <symbol name="FunctionRecursiveTwo(int)">
          <symbol name="FunctionRecursiveOne(int)">
            <symbol name="FunctionRecursiveTwo(int)">
            </symbol>
            <symbol name="main"/>
          </symbol>
        </symbol>
        <symbol name="main"/>
      </symbol>
    </symbol>
  </symbol_callgraph_relation>
</test>

<test name="selected_comm">
  <executable name="simpleperf_runtest_comm_change"/>
  <report option="--comms RUN_COMM1"/>

  <symbol_overhead>
    <symbol comm="RUN_COMM1" min="100" max="100"/>
  </symbol_overhead>
</test>

<test name="run_and_sleep">
  <executable name="simpleperf_runtest_run_and_sleep"/>

  <symbol_overhead>
    <symbol name="RunFunction()" min="80"/>
  </symbol_overhead>

</test>

<test name="run_and_sleep_trace_offcpu">
  <executable name="simpleperf_runtest_run_and_sleep"/>
  <disable_host/>
  <record option="--trace-offcpu"/>

  <symbol_children_overhead>
    <symbol name="RunFunction()" min="20" max="80"/>
    <symbol name="SleepFunction(unsigned long long)" min="20" max="80"/>
  </symbol_children_overhead>
</test>

</runtests>
