GIF89a; Mini Shell

Mini Shell

Direktori : /usr/share/mysql-test/std_data/
Upload File :
Current File : //usr/share/mysql-test/std_data/system_tap.stp

#  This systamtap script is used by the test "dynamic_tracing.test" for dynamic
#  tracing. This script is executed in background by "dynamic_tracing.test" and
#  SQL queries are executed concurrently. When any probe used in this script are
#  hit then counter is incremented. After hitting all the 8(exp_probe_hits)
#  probes, summary containing probes enabled and their hit state is printed.
#
#  For the dynamic tracing of MySQL code using systemtap on Linux, the dtrace
#  probes defined in the code are converted to systemtap marks by the dtrace
#  tool. This dtrace tool is not used for dynamic tracing like real dtrace tool
#  supplied with Sun OS, Mac, FreeBSD and Oracle Linux.
#  

global query_parse_start
global query_parse_done
global select_start
global select_done
global net_read_start
global net_read_done
global handler_rdlock_start
global handler_rdlock_done

global tot_probe_hits
global exp_probe_hits

probe begin
{
  query_parse_start= 0
  query_parse_done= 0
  select_start= 0
  select_done= 0
  net_read_start= 0
  net_read_done= 0
  handler_rdlock_start= 0
  handler_rdlock_done= 0
  
  tot_probe_hits= 0
  exp_probe_hits= 8
  printf("\n Dynamic tracing ...... started.\n")
}

probe process(@1).mark("query__parse__start")
{
  if (query_parse_start == 0)
  {
    query_parse_start++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("query__parse__done")
{
  if (query_parse_done == 0)
  {
    query_parse_done++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("select__start")
{
  if (select_start == 0)
  {
    select_start++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("select__done")
{
  if (select_done == 0)
  {
    select_done++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("net__read__start")
{
  if (net_read_start == 0)
  {
    net_read_start++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("net__read__done")
{
  if (net_read_done == 0)
  {
    net_read_done++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("handler__rdlock__start")
{
  if (handler_rdlock_start == 0)
  {
    handler_rdlock_start++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

probe process(@1).mark("handler__rdlock__done")
{
  if (handler_rdlock_done == 0)
  {
    handler_rdlock_done++
    tot_probe_hits++
  }

  if (tot_probe_hits >= exp_probe_hits)
  {
    print_summary_and_exit()
  }
}

function print_summary_and_exit()
{
  printf("\n query-parse-start    : %d", query_parse_start)
  printf("\n query-parse-done     : %d", query_parse_done)
  printf("\n select-start         : %d", select_start)
  printf("\n select-done          : %d", select_done)
  printf("\n net-read-start       : %d", net_read_start)
  printf("\n net-read-done        : %d", net_read_done)
  printf("\n handler_rdlock_start : %d", handler_rdlock_start)
  printf("\n handler_rdlock_done  : %d", handler_rdlock_done)
  printf("\n")
  printf("\n Expected probe hits  : %d", exp_probe_hits)
  printf("\n Actual probe hits    : %d\n", tot_probe_hits)
  printf("\n Dynamic tracing ...... completed.\n\n")
  exit()
}

./BlackJoker Mini Shell 1.0