probe begin
{
    curr = task_current()

    // Compare PIDs
    pid = pid()
    cast_pid = @cast(curr, "task_struct")->tgid
    if (pid == cast_pid)
        println("PID OK")
    else
        printf("PID %d != %d\n", pid, cast_pid)

    // Compare PIDs using a generated kernel module
    cast_pid = @cast(curr, "task_struct", "kernel<linux/sched.h>")->tgid
    if (pid == cast_pid)
        println("PID2 OK")
    else
        printf("PID2 %d != %d\n", pid, cast_pid)

    // Compare PIDs with an array access (PR11556)
    cast_pid = @cast(curr, "task_struct")[0]->tgid
    if (pid == cast_pid)
        println("PID3 OK")
    else
        printf("PID3 %d != %d\n", pid, cast_pid)

    // Compare execnames
    name = execname()
    cast_name = kernel_string(@cast(curr, "task_struct")->comm)
    if (name == cast_name)
        println("execname OK")
    else
        printf("execname \"%s\" != \"%s\"\n", name, cast_name)

    // Compare usage counter values through a struct address
    usage = @cast(curr, "task_struct")->usage->counter
    pusage = & @cast(curr, "task_struct")->usage
    cast_usage = @cast(pusage, "atomic_t")->counter
    if (usage == cast_usage)
        println("usage OK")
    else
        printf("usage %d != %d\n", usage, cast_usage)

    exit()
}
