#! stap -p4

# this tests access to members of a target global variable
# (PR 1191)

probe kernel.function("pipe_write")
{
%( kernel_v > "3.9" %?
	printf("0x%x\n", $pipefifo_fops->llseek)
%:
  %( kernel_v >= "2.6.27" %?
	printf("0x%x\n", $write_pipefifo_fops->llseek)
  %:
	printf("0x%x\n", $write_fifo_fops->llseek)
  %)
%)
}

# PR10000: We're looking for *some* module function that has a nearby global variable in scope
# XXX: See PR4096
probe module("nfs").function("nfs_create_client") !,
      kernel.function("nfs_create_client") !,
      module("nfs").function("nfs_init_client") !,
      kernel.function("nfs_init_client") !,
      kernel.function("nfs_fsync_dir")
{
	println(kernel_string($nfs_program->name))
}

probe timer.s(5) { exit() }
