Skip to content

Commit

Permalink
Merge pull request iovisor#1554 from iovisor/yhs_dev
Browse files Browse the repository at this point in the history
add a probe alias $task in trace.py
  • Loading branch information
4ast committed Jan 25, 2018
2 parents 12f4f6e + f92fef2 commit 08be443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ def _parse_action(self, action):
"$gid": "(unsigned)(bpf_get_current_uid_gid() >> 32)",
"$pid": "(unsigned)(bpf_get_current_pid_tgid() & 0xffffffff)",
"$tgid": "(unsigned)(bpf_get_current_pid_tgid() >> 32)",
"$cpu": "bpf_get_smp_processor_id()"
"$cpu": "bpf_get_smp_processor_id()",
"$task" : "((struct task_struct *)bpf_get_current_task())"
}

def _generate_streq_function(self, string):
Expand Down Expand Up @@ -606,6 +607,8 @@ class Tool(object):
'udpv6_sendmsg(struct sock *sk) (sk->sk_dport == 13568)'
Trace udpv6 sendmsg calls only if socket's destination port is equal
to 53 (DNS; 13568 in big endian order)
trace -I 'linux/fs_struct.h' 'mntns_install "users = %d", $task->fs->users'
Trace the number of users accessing the file system of the current task
"""

def __init__(self):
Expand Down
2 changes: 2 additions & 0 deletions tools/trace_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,6 @@ trace -I 'net/sock.h' \\
'udpv6_sendmsg(struct sock *sk) (sk->sk_dport == 13568)'
Trace udpv6 sendmsg calls only if socket's destination port is equal
to 53 (DNS; 13568 in big endian order)
trace -I 'linux/fs_struct.h' 'mntns_install "users = %d", $task->fs->users'
Trace the number of users accessing the file system of the current task
"

0 comments on commit 08be443

Please sign in to comment.