// stapbpf string manipulation -- store string in global data structure

global var
global tab1
global tab2

@define test_print
%(
  printf("[%s", "str0")
  printf("%s", var)
  printf("%s", tab1[15])
  printf("%s]", tab2["key"])
%)

probe begin {
  printf("BEGIN")

  var = "str1"
  tab1[15] = "str2"
  tab2["key"] = "str3"

  printf("begin")
  @test_print
}

probe kernel.function("vfs_read") {
  printf("probe")
  @test_print
  exit()
}

probe end {
  printf("end")
  @test_print
  printf("END\n")
}
